🔍 TOPMANIDMB LLM Stack — วิเคราะห์ครบระบบ

อัปเดต 27 ส.ค. 2569 · ข้อมูลจาก repo, memory, scripts, reports, launchd plist

9
Ollama Models
3
MLX Models
5
Custom Fine-tuned
6
Router Profiles
16
Heartbeat Lanes
5
Fleet Nodes
4
Providers

🏗️ สถาปัตยกรรมรวม

[HERMES / CC / Codex] ← ผู้การ + AI agents │ ├── travis_ai_router :8787 ← Smart routing layer │ ├── profile=local-fast → Ollama qwen3:8b (bot-tier default) │ ├── profile=local-private → Ollama qwen3:8b (privacy guard) │ ├── profile=local-case → aibeast-qwen3.6-35b-Q8 (PII/case) → fallback: Ollama 27B │ ├── profile=local-mlx → MLX qwen2.5-7b-4bit │ ├── profile=local-rag → Ollama qwen3:8b + bge-m3 embedding │ └── profile=hybrid-strong → Ollama qwen3:8b (long-context >12K chars) │ ├── travis-service :8100 (PM2 Hybrid LLM Gateway v3.3-glm5) │ ├── Layer 1 Classify → gemma4:31b (keyword fast-route) │ ├── Layer 1.5 Cloud → Gemini Flash (free) → GLM-5 Turbo (฿0.13/call) │ ├── Layer 2 Medium → llama3.3:70b (⚠️ dead fallback — ไม่มีใน Ollama) │ ├── Layer 2 Heavy → gemma4:31b (32K context) │ └── Layer 3 Commander → gemma4:31b (longdoc/report) │ ├── TPO intel-agent :8026 │ └── Jin-MLX → travis ollama (socat proxy 100.76.21.34:11434) → macpro → cloud │ ├── │ ▼ TRAVIS (Mac Studio M1 Ultra · 128GB · 100.76.21.34) ├── Ollama :11434 (launchd managed) │ ├── qwen2.5vl:7b (5.56GB · 8.3B · Q4 · 128K ctx · vision) │ ├── qwen3:8b (4.87GB · 8.2B · Q4 · 40K ctx · default bot-tier) │ ├── qwen3.6:35b (22.29GB · 36B · Q4 · 262K ctx · speed benchmark) │ ├── qwen3.6:27b (16.22GB · 27.8B · Q4 · 262K ctx · case tier) │ ├── gemma4:26b (16.75GB · 25.8B · Q4 · tools) │ ├── gemma4:31b (18.5GB · 31.3B · Q4 · ✅ default accuracy F1 0.974) │ └── bge-m3:latest (1.08GB · 566M · F16 · 8K ctx · embedding dim 1024) ├── MLX Server :8082 │ ├── mlx-community/Qwen2.5-7B-Instruct-4bit │ ├── mlx-community/Qwen2.5-14B-Instruct-4bit │ └── /Users/mac/fine-tune/models/qwen2.5-7b-4bit (fine-tuned) ├── Custom fine-tuned (Ollama) │ ├── idmb-analyst:latest (case analysis) │ ├── idmb-extract:latest (extraction) │ ├── idmb-law-analyst:latest │ ├── idmb-fast:latest (speed) │ └── idmb-writer:latest (writing) ├── aibeast (100.75.87.68:30000 · GPU server) │ └── aibeast-qwen3.6-35b-q8 (Q8 quantized · case/PII primary) ├── lane-heartbeat.sh — 16 lanes freshness probes └── travis-service :8100 — Hybrid LLM Gateway (PM2) │ ├── ROSE (MBP M4 Max · Hermes rosa · grok-4.3 primary) ├── MACPRO (MacPro7,1 · T2 · macprowin BootCamp · Windows) │ └── GPU Factory: OCR/vision/embedding queue ├── DONWIN (investigator workstation · SFTP submitter) └── DO / DSM / QNAP / RABBIT (offsite backup, n8n, PG)

📦 คลังโมเดล — Ollama (Travis)

Travis (M1 Ultra 128GB) รัน Ollama 7 ตัว — เป็นฐาน LLM หลักของ fleet ทั้งหมด

โมเดลขนาด (GB)ParamsQuantContextCapabilitiesบทบาท
qwen2.5vl:7b5.568.3BQ4_K_M128Kvision, completionMultimodal (ภาพ+ข้อความ)
qwen3:8b4.878.2BQ4_K_M40Kcompletion, tools, thinking🟢 default bot-tier · local-fast
qwen3.6:35b22.2936BQ4_K_M262Kvision, completion, tools, thinkingSpeed benchmark (2.5x gemma)
qwen3.6:27b16.2227.8BQ4_K_M262Kvision, completion, tools, thinking📋 case-tier · local-case fallback
gemma4:26b16.7525.8BQ4_K_Mcompletion, tools, thinkingMedium fallback (travis-service)
gemma4:31b18.531.3BQ4_K_Mcompletion, tools, thinking✅ default accuracy · F1 0.974
bge-m3:latest1.08566MF168Kembedding🔤 embedding dim=1024 · RAG

Custom Fine-tuned (Ollama)

โมเดลฐานบทบาทโจทย์ที่ออกแบบมาทำ
idmb-analyst:latestCase analysisวิเคราะห์บันทึกบริษัท/บัญชีม้า/นอมินี (แยก 4 หัวข้อ)
idmb-extract:latestData extractionสกัดข้อมูลจากเอกสารคดี
idmb-law-analyst:latestLegal analysisวิเคราะห์ด้านกฎหมายทั่วไป
idmb-fast:latestSpeed queriesตอบคำถามทั่วไปเร็ว
idmb-writer:latestWritingเขียนเอกสาร/รายงาน

MLX Models (Travis)

โมเดลแหล่งPortบทบาท
mlx-community/Qwen2.5-7B-Instruct-4bitHuggingFace:8082MLX local inference (Apple Silicon native)
mlx-community/Qwen2.5-14B-Instruct-4bitHuggingFaceMLX local inference — ขนาดกลาง
/Users/mac/fine-tune/models/qwen2.5-7b-4bitFine-tuned local🟢 Router profile=local-mlx (fine-tuned)

AIbeast (GPU Server)

โมเดลHost:PortQuantบทบาทTimeout
aibeast-qwen3.6-35b-q8100.75.87.68:30000Q8📋 Case/PII primary — local-case profile180s

หมายเหตุ: aibeast มี fallback ไป Ollama 27B ถ้า Q8 ล้ม (ใน router code)

Hermes (Rose) — Cloud Primary

ProviderModelRoleCost
xai-oauthgrok-4.3🟢 Hermes primary reasoning$200/mo flat (tier-5 SuperGrok)
xai-oauthgrok-4.20-0309-reasoningFallback 1$0 marginal
xai-oauthgrok-4.20-0309-non-reasoningFallback 2$0 marginal
⚠️ Doctrine: ซับ xAI เป็น flat-rate → ทุก call ที่วิ่งผ่าน xai-oauth = $0 ส่วนเพิ่ม ห้ามรั่วไป openrouter (401 key เสีย + จ่ายต่อ token)

Custom GGUF — Qwen3.8-27B Abliterated

ไฟล์ขนาดVRAM ต้องการหมายเหตุ
Qwen3.8-27B-abliterated-mtp-f16.gguf~54.6 GB48 GB+highest quality · imatrix source
Qwen3.8-27B-abliterated-mtp-Q6_K.gguf~22.4 GB24 GB🟢 recommended balance
Qwen3.8-27B-abliterated-mtp-Q4_K_M.gguf~16.8 GB16 GBยังไม่มี imatrix — คุณภาพจะดีขึ้น
mmproj-Qwen3.8-27B-GGUF.gguf~931 MB+extramultimodal projector (ภาพ)

abliterated = training-free refusal removal · MTP head preserved (self-speculative decoding) · Apache-2.0

🔀 AI Router — Smart Routing Layer

script: scripts/travis_ai_router.py · Port: :8787 · launchd managed

ProfileProviderModelMax TokensContextKeep AliveCloud?Use Case
local-fastOllamaqwen3:8b51216K12hBot-tier default — always-warm
local-privateOllamaqwen3:8b51216K12hPrivacy guard — no escalation to case
local-caseaibeastQwen3.6:35b Q8150032K45m📋 PII/case — fallback: Ollama 27B
local-mlxMLXqwen2.5-7b-4bit512Apple Silicon native inference
local-ragOllamaqwen3:8b76816K12hRAG answer + bge-m3 embedding
hybrid-strongOllamaqwen3:8b76816K12hLong-context >12K chars

Routing Logic (choose_profile)

Decision Flow

1. Explicit profile parameter? → use it
2. case=true / case_work=true? → local-case (aibeast Q8)
3. private=true OR text contains "protected|pii|credential|token"? → local-private (stay bot-tier, NO escalation)
4. use_mlx=true? → local-mlx
5. text length > 12,000 chars? → hybrid-strong
6. Default → local-fast (qwen3:8b)

Fallback Chain

aibeast Q8 (local-case primary)
  ↓ [ถ้า timeout / 400 / empty response]
Ollama qwen3.6:27b (travis fallback — case keep_alive 45m, num_ctx 32K)

📊 Benchmark & Accuracy

A/B Benchmark: gemma4:31b vs qwen3.6:35b

Metricgemma4:31bqwen3.6:35bผู้ชนะ
Speed (tok/s, M1 Ultra)19–2047–55🟢 qwen3.6 (2.5x)
Extraction F10.9740.883🔴 gemma4 (10% Δ)
Composite F1 (100-ข้อ golden set)0.9820.874🔴 gemma4
Context window262K🟢 qwen3.6
🎯 Doctrine คำตัดสิน: ผู้การกำหนด "ถูก/แม่นมาก่อนเร็ว" → ยอมแลก speed เพื่อ extraction accuracy ไม่ได้ default = gemma4:31b คงเดิม สำหรับงานคดี/extract/จัดหมวด

Latest Health Check (2026-07-05)

ProbeModelResultElapsedOutput
Ollama tagsPASS0.02s7 models loaded
Ollama chatqwen3:8bPASS0.95s57 tokens
Embeddingbge-m3PASS0.20sdim=1024
MLX modelsPASS0.02s3 models
MLX chatqwen2.5-7b-4bitPASS0.66sprompt=49, comp=15
Router healthPASS0.01sok
Router chatlocal-fastPASS0.31s310 tokens

Concurrency Probe (2026-07-05)

MetricValue
Requests2
PASS2/2
Min elapsed1.01s
Median elapsed1.44s
Max elapsed1.87s

🫀 Monitoring — Lane Heartbeat

script: scripts/lane-heartbeat.sh · Deploy: travis (launchd) · Principle: freshness ≠ process up

LaneSeverityProbe TypeSource
aibeast-storagecriticalstorage freshnesstravis
aibeast-aiwarnfleet_gen_test.pytravis
aibeast-mineruwarnOCR content probetravis
aibeast-vramwarnVRAM utilizationtravis
aibeast-unitswarnmodel inventorytravis
aibeast-dashboardwarndashboard healthtravis
rabbit-ollamawarningress queuetravis
memory-git-synccriticalunpushed commit / dirty treetravis
hermes-pollerscriticalTelegram webhookInfo (pending+409)travis/rose/DO
offsite-backupcriticalrecovery-status / receiptrose
n8ncriticalService-Health workflow freshnessHOS
existing-monitorscriticalfleetbrief + fleetmon stalenesstravis
postgrescriticalpg_isready + restart+FATAL countstravis
postgres-rosecriticalthaithabian.doc count + backup freshnessrose
db-vaultcriticalDSM/QNAP artifact freshnesstravis
metabasewarndashboard freshnesstravis
vercelwarnsite accessibilityexternal
webui-hubwarnOpen WebUI hubtravis
travis-ai-serviceswarnrouter+ollama+mlx healthtravis
macos-autoupdatewarn4 toggles must be 0self

🖥️ Fleet Nodes — AI Infrastructure

🟦 Travis (Mac Studio M1 Ultra)

100.76.21.34 · 128GB RAM · macOS

LLM Hub — Ollama 7 models + MLX 3 models + Router :8787 + Service :8100
Monitoring — lane-heartbeat (primary) · fleet-brief · Tailscale proxy
Services — n8n, metabase, memory-git-sync, hermes pollers

🟥 Rose (MBP M4 Max)

100.100.28.11 · Hermes rosa · PostgreSQL :5432

Primary AI — grok-4.3 via xai-oauth ($200 flat)
Database — thaithabian (คดี 25690605) · backup → Rabbit
Operations — topman-data-recovery · Telegram bot (jin/rosa)

🟨 MacPro (MacPro7,1 T2)

macprowin (BootCamp) · Windows · GPU

GPU Factory — OCR/vision/embedding queue
Storage — 8TB APFS (1.82T + DATA 3.63T + BOOTCAMP 1.83T)
Template drift — compare against travis sha256

🟩 Donwin (Investigator WS)

Windows · SFTP submitter · chroot jailed

Submitter — protected chroot @ /drop (gpusubmit account)
Pipeline — prepare-pilot → submit-pilot (fail-closed receipt SHA-256)
GPU — macprowin worker pulls via Tailscale SFTP

🟪 Aibeast (GPU Server)

100.75.87.68:30000 · Qwen3.6:35b-Q8

Case LLM — aibeast profile → Q8 quantized primary
OCR — MinerU pipeline · pipeline > vlm (OOM on vlm)
Fallback → Ollama 27B if aibeast down

⬜ DO / DSM / QNAP / Rabbit

Tailscale mesh · offsite backup

DO — Tier 1 Git (PII-allowed) · Leo DO
DSM — Primary backup destination (DB_VAULT)
QNAP — Secondary backup (rabbit mirror 07:30)
Rabbit — Recovery receipt · PostgreSQL backup relay

⚠️ ปัญหา & คำเตือนที่ตรวจพบ

🔴 P0 — travis-service: MEDIUM_MODEL = llama3.3:70b (dead)

config ชี้ llama3.3:70b แต่ Travis Ollama ไม่มีโมเดลนี้ → Layer 2 Medium ยอมแพ้ตลอด แก้: เปลี่ยนเป็น gemma4:26b ที่มีอยู่

🟡 P1 — Qwen3.8-27B Abliterated ยังไม่มี imatrix

GGUF quant (Q4_K_M) คุณภาพจะดีขึ้นมากเมื่อทำ imatrix calibration กับ corpus ไทย TODO: สร้าง imatrix corpus → re-quantize → benchmark

template คดี (iOS tel-autolink guard) ต่างกันระหว่าง travis/rose/macpro lane-heartbeat เฝ้า drift แล้ว แต่ไม่มีกลไก sync อัตโนมัติ — ต้อง push มือ เสี่ยง: คดีใหม่จากเครื่องเก่าจะขาดตัวกัน iOS tel-autolink

🟡 P3 — aibeast vram monitor ยังต้องพัฒนา

VLM pipeline OOM ทุกครั้ง (ต้องการ ~2.2GB แต่เหลือ ~1.5GB) แก้: ใช้ pipeline backend (ชนะ benchmark) แทน vlm/hybrid หรือ: เพิ่ม VRAM / ลด batch size

🟡 P4 — MLX default route ยังไม่ config

Router ต้องระบุ model id/path ชัดเจนสำหรับ MLX เพราะไม่มี default model แก้: ใช้ profile=local-mlx หรือ use_mlx=true เสมอ

💡 คำแนะนำ & Next Steps

ลำดับข้อเสนอผลกระทบความเร่งด่วน
1แก้ llama3.3:70bgemma4:26b ใน travis-service .envLayer 2 Medium จะทำงานได้สูง
2ทำ imatrix calibration สำหรับ Qwen3.8-27B Abliteratedคุณภาพ Q4 จะดีขึ้นมากกลาง
3auto-sync template คดีระหว่าง nodesทุกเครื่องมี iOS guard เดียวกันกลาง
4เพิ่ม concurrency router จาก 2 → 4 (หลังจาก health check ผ่าน)รองรับ agent traffic สูงขึ้นต่ำ
5pin aux models (vision/compression) ไป xai-oauth แทน openrouterประหยัด token + ป้องกัน 401กลาง
6deploy aibeast VRAM monitor (ไม่ใช่แค่ /health 200)จับ OOM ก่อน productionกลาง

🛠️ Scripts & Tools ที่เกี่ยวข้อง

เครื่องมือตำแหน่งหน้าที่Deploy
travis_ai_router.pyscripts/Smart LLM routing (6 profiles)launchd
travis_llm_health_check.shscripts/Health check → report markdownmanual / make
travis_llm_benchmark.shscripts/Benchmark + concurrency testmanual / make
fleet_gen_test.pyscripts/aibeast/วัดผลผลิตจริง (ไม่เชื่อ /health 200)manual
lane-heartbeat.shscripts/16-lane freshness monitoringlaunchd (travis)
llama-relaunch.shscripts/aibeast/เปลี่ยนค่า llama-server อย่างปลอดภัยmanual
ocr_backend_bench.pyscripts/aibeast/เทียบ pipeline vs vlm vs hybridmanual
ocr_content_probe.pyscripts/aibeast/ตรวจ OCR ได้เนื้อหาจริงหรือเปล่าmanual
topman-gpu-factory CLIprojects/topman-gpu-factory/GPU queue on macprowin (OCR/vision/embed)Windows service
travis-service :8100~/travis-service/ (travis)Hybrid LLM Gateway v3.3-glm5PM2

สร้างโดย โรซ่า · ข้อมูลจาก: reports/travis_llm_*.md, scripts/*.sh, scripts/*.py, TOPMANIDMB-Vault/CC-Memory/, launchagents/, Makefile, projects/topman-gpu-factory/

ตรวจสอบความถูกต้องกับระบบ live ก่อนนำไปปฏิบัติ