รวม GPU และ Memory จากหลายเครื่องเป็นหนึ่งเดียว แล้วเปิดเป็น OpenAI-compatible API เหมือนเรียก ChatGPT — เริ่มที่เครื่องเดียว เพิ่มเครื่องได้ภายหลัง Mesh ตัดสินใจเองว่าโมเดลจะรัน local, route ไป peer, หรือแบ่ง stage
ทำความเข้าใจแนวคิดหลักก่อนเริ่มใช้งาน
Mesh LLM รวม GPU และ Memory จากเครื่องหลายเครื่องเข้าด้วยกัน ทุกเครื่องที่ join เข้า mesh จะแชร์ทรัพยากรและโมเดล ผู้ใช้เรียก API ที่เดียวก็ได้ผลลัพธ์จากเครื่องที่เหมาะสมที่สุด
Mesh เปิด API ที่ http://localhost:9337/v1 — เหมือนเรียก OpenAI ทุกประการ เครื่องมือที่รองรับ OpenAI (เช่น Goose, Claude Code, OpenCode) ใช้ได้ทันทีโดยไม่ต้องแก้โค้ด
โมเดลใหญ่เกินเครื่องเดียว? Skippy จะแบ่งโมเดลเป็น "stage" แต่ละ stage รันบนเครื่องคนละเครื่อง ส่ง activation ต่อกันผ่านเครือข่าย ผู้ใช้เรียก API เหมือนเดิมไม่ต้องรู้ว่ามีกี่ stage
ส่ง "model": "mesh" แล้ว Mesh จะ fan-out ไปทุกโมเดลใน mesh พร้อมกัน แล้วใช้ arbiter หาคำตอบที่ดีที่สุดรวมกลับมาในคำตอบเดียว
/v1) การ routing อิงจาก "ชื่อโมเดล" ไม่ใช่ชื่อเครื่อง — ผู้ใช้ไม่ต้องรู้ว่าโมเดลอยู่เครื่องไหน
ติดตั้ง Mesh LLM บน macOS, Linux และ Windows
curl -fsSL https://meshllm.cloud/install.sh | bashหรือติดตั้งผ่าน Homebrew:
brew install mesh-llm/tap/mesh-llmเหมาะกับ Apple Silicon (Metal backend)
curl -fsSL https://meshllm.cloud/install.sh | bashรองรับ CUDA, ROCm, Vulkan, และ CPU
irm https://meshllm.cloud/install.ps1 | iexใช้ PowerShell รองรับ CUDA, ROCm, Vulkan, และ CPU
หลังติดตั้ง executable แล้ว ต้องรัน setup เพื่อดาวน์โหลด native runtime และกำหนดค่า:
mesh-llm setupsetup จะดาวน์โหลด native runtime (Metal/CUDA/CPU), เสนอติดตั้ง background service, และกำหนดค่า identity
ตัวเลือกเพิ่มเติม:
mesh-llm setup --service # ติดตั้ง background service
mesh-llm setup --no-service # ข้าม service
mesh-llm setup --yes # auto-yes ทุก prompt
mesh-llm setup --verbose # รายละเอียดเต็ม
| เครื่อง | Flavor แนะนำ | หมายเหตุ |
|---|---|---|
| Apple Silicon Mac | metal | Setup เลือกอัตโนมัติ |
| Linux NVIDIA | cuda | ครอบคลุมทุกสถาปัตยกรรม NVIDIA |
| Linux AMD | rocm | ต้องติดตั้ง ROCm/HIP |
| Linux Vulkan GPU | vulkan | ใช้เมื่อ CUDA/ROCm ไม่พร้อม |
| Linux ARM64 (Jetson) | cuda/cpu | NVIDIA Jetson/Orin |
| Windows NVIDIA | cuda | Setup เลือกอัตโนมัติ |
| ทุก OS | cpu | ช้าที่สุด แต่ใช้ทดสอบได้ |
cudPT-blackwell และ blackwell เป็น alias ของ cuda — ให้ใช้ cuda แทน
ตั้งแต่ติดตั้งจนถึงเพิ่มเครื่องที่สองเข้า mesh
เลือก platform แล้วรันคำสั่งติดตั้ง (ดูวิธีด้านบน)
mesh-llm setupดาวน์โหลด native runtime + ตั้งค่า identity
mesh-llm serve --discover my-private-mesh \
--model unsloth/gemma-4-E4B-it-GGUF:UD-Q4_K_XL
โมเดลนี้เหมาะกับเครื่อง 12GB+ VRAM — ปล่อย terminal เปิดไว้
เปิดเบราว์เซอร์ที่ http://localhost:3131 — ลองส่งข้อความ "Say hello in one sentence."
curl -s http://localhost:9337/v1/models | jq '.data[].id'ควรเห็นอย่างน้อยหนึ่ง model id
mesh-llm gooseหรือ mesh-llm claude, mesh-llm opencode, mesh-llm pi
ติดตั้ง Mesh บนอีกเครื่องแล้วรันคำสั่งเดียวกันด้วย mesh name เดียวกัน:
mesh-llm serve --discover my-private-mesh --model <model-ref>ทั้งสองเครื่องจะหากันเจอและแชร์โมเดลผ่าน API เดียว
อยากลองเลยโดยไม่ตั้งชื่อ mesh? ใช้คำสั่งเดียว:
mesh-llm serve --auto
Mesh จะเลือก backend flavor ดาวน์โหลดโมเดลที่เหมาะสม, join public mesh, เปิด API ที่ port 9337 และ console ที่ port 3131 อัตโนมัติ
--headless เพื่อปิด web UI แต่ยังใช้ management API ได้
แล็ปท็อปที่ต้องการแค่ส่ง request ไม่ serve โมเดล:
mesh-llm client --auto
หรือเข้า private mesh:
mesh-llm client --discover my-private-mesh
| VRAM | โมเดลแนะนำ | ขนาด |
|---|---|---|
| 8 GB | unsloth/gemma-4-E2B-it-GGUF:UD-Q4_K_XL | เล็ก |
| 12 GB | unsloth/gemma-4-E4B-it-GGUF:UD-Q4_K_XL | กลาง |
| 16 GB | unsloth/gemma-4-26B-A4B-it-GGUF:UD-Q3_K_XL | ใหญ่ |
| 24 GB | unsloth/gemma-4-26B-A4B-it-GGUF:UD-Q4_K_M | ใหญ่ |
| 64 GB+ | unsloth/gemma-4-31B-it-GGUF:UD-Q4_K_XL | ใหญ่มาก |
แต่ละเป้าหมายมีคำสั่งที่เหมาะสม
| เป้าหมาย | คำสั่ง |
|---|---|
| 🎯 ลอง public mesh | mesh-llm serve --auto |
| 🔒 สร้าง private mesh | mesh-llm serve --model Qwen3-8B-Q4_K_M |
| 📢 Publish mesh ของตัวเอง | mesh-llm serve --model Qwen3-8B-Q4_K_M --publish |
| 🔑 Join ด้วย invite token | mesh-llm serve --join <token> |
| 💻 Client-only (API เท่านั้น) | mesh-llm client --auto |
| 🧩 รันโมเดลใหญ่ด้วย splits | mesh-llm serve --model hf://meshllm/<repo>@<rev> --split |
| 🔌 Flash-MoE SSD backend | mesh-llm serve + plugin config flash-moe |
| 🤖 Mixture-of-Agents | ส่ง "model":"mesh" ใน API request |
| 🦢 Goose / Claude / OpenCode / Pi | mesh-llm goose, mesh-llm claude, ฯลฯ |
ทำความเข้าใจว่า Mesh ทำงานอย่างไรภายใน
mesh-llm เป็นเจ้าของ "product และ network behavior" ส่วน Skippy เป็นเจ้าของ "model execution" — API เหมือนเดิมไม่ว่า request จะถูกจัดการ local, โดย peer, หรือผ่าน multi-stage pipeline
/v1| Role | หน้าที่ |
|---|---|
| Client | ส่ง inference request โดยไม่ serve โมเดล |
| Host | มี routable model + เปิด inference API |
| Worker | ให้ compute หรือ stage สำหรับ split model |
| Standby | มี capacity พร้อม promote เมื่อต้องการ |
mesh-llm/1 (protobuf) + mesh-llm/0 (legacy JSON)| รูปแบบ | ใช้เมื่อ | Path |
|---|---|---|
| Single Node | โมเดลพอลงเครื่องเดียว | API → local Skippy stage |
| Private Mesh | คุมเครื่องเอง, invite-token | API → QUIC peer routing |
| Public Mesh | ต้องการ discovery + shared capacity | API → public discovery → target |
| Client-only | App ไม่ serve โมเดล | SDK → mesh transport |
| Split Serving | ไม่มีเครื่องเดียวที่พอ | API → stage 0 → pipeline |
| SDK-embedded | App อื่นเป็นเจ้าของ lifecycle | App → SDK → embedded node |
รันโมเดลใหญ่เกินเครื่องเดียว โดยแบ่งเป็น stages
เมื่อโมเดลใหญ่เกินที่จะลงบนเครื่องเดียว Skippy จะแบ่งโมเดลเป็น contiguous layer ranges แต่ละ range รันบนเครื่องคนละเครื่อง (stage) แล้วส่ง activation ต่อกัน:
http://localhost:9337/v1 เหมือนเดิม — ไม่ต้องรู้ว่ามีกี่ stages
Coordinator เลือก stage boundaries จาก model metadata, available memory, backend capability, topology policy
แต่ละ node ดาวน์โหลดเฉพาะ stage files ที่ตัวเองต้องใช้จาก package repository
Stage สุดท้าย start ก่อน → รอ readiness → ขึ้นไป stage ก่อนหน้า → ถึง stage 0
Stage 0 route ถูก publish เมื่อทุก stage ready — request เริ่มไหลผ่าน pipeline
เรียกใช้เหมือน OpenAI API ทุกประการ
http://localhost:9337/v1http://localhost:3131API Key: ใส่อะไรก็ได้ เช่น dummy
curl -s http://localhost:9337/v1/models | jq '.data[].id'
ผลลัพธ์ตัวอย่าง:
"unsloth/gemma-4-E4B-it-GGUF:UD-Q4_K_XL"
"Qwen3-8B-Q4_K_M"
curl http://localhost:9337/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model":"unsloth/gemma-4-E4B-it-GGUF:UD-Q4_K_XL",
"messages":[{"role":"user","content":"What is the capital of Japan?"}]
}'
ส่ง "model": "mesh" → fan-out ไปทุกโมเดลใน mesh → arbiter เลือกคำตอบที่ดีที่สุด:
curl http://localhost:9337/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model":"mesh",
"messages":[{"role":"user","content":"What is the capital of Japan?"}]
}'
| Endpoint | Port | ใช้สำหรับ |
|---|---|---|
/v1/chat/completions | 9337 | Chat (streaming + non-streaming) |
/v1/models | 9337 | ดูโมเดลที่ใช้ได้ |
/v1/completions | 9337 | Text completion |
/v1/responses | 9337 | OpenAI Responses API |
/api/status | 3131 | Node status, peers, models |
เชื่อม Mesh LLM กับเครื่องมือพัฒนายอดนิยม
Mesh มี launcher สำหรับ coding agents ยอดนิยม — เรียกคำสั่งเดียวก็เชื่อมต่ออัตโนมัติ:
mesh-llm goosemesh-llm claudemesh-llm opencode --host 127.0.0.1:9337mesh-llm pi --host 127.0.0.1:9337สำหรับเครื่องมือที่ไม่มี launcher ให้ตั้งค่า OpenAI-compatible provider:
| Setting | Value |
|---|---|
| Base URL | http://localhost:9337/v1 |
| API Key | dummy |
| Model | เลือกจาก /v1/models |
curl -s http://localhost:9337/v1/models — ถ้าไม่มีโมเดล ให้ restart ด้วยโมเดลที่เล็กลง
เพิ่มความสามารถให้ Mesh LLM ผ่าน plugin system
| Plugin | ใช้สำหรับ | ติดตั้ง |
|---|---|---|
| blackboard | แชร์ status, findings, questions, tips ข้าม mesh | mesh-llm plugins install blackboard |
| openai-endpoint | เพิ่ม OpenAI-compatible server ที่รันอยู่ (vLLM, Ollama, TGI) | mesh-llm plugins install openai-endpoint |
| flash-moe | Flash-MoE SSD expert streaming backend | mesh-llm plugins install flash-moe |
| metrics | OpenTelemetry metrics export | mesh-llm plugins install metrics |
| agents | Mesh-native A2A agents + MCP tools | mesh-llm plugins install agents |
เพิ่มใน ~/.mesh-llm/config.toml:
[[plugin]]
name = "openai-endpoint"
url = "http://127.0.0.1:8000/v1"
Plugin ที่ไม่ต้องการ endpoint:
[[plugin]]
name = "blackboard"
[[plugin]]
name = "metrics"
[telemetry]
enabled = true
endpoint = "https://otel.example.com"
mesh-llm plugins install <name> # ติดตั้ง
mesh-llm plugins list # ดูที่ติดตั้งแล้ว
mesh-llm plugins info <name> # รายละเอียด
mesh-llm plugins update <name> # อัปเดต
mesh-llm plugins enable <name> # เปิดใช้งาน
mesh-llm plugins disable <name> # ปิดใช้งาน
mesh-llm plugins delete <name> # ลบ
mesh-llm plugins search [query] # ค้นหา
ฝัง Mesh node หรือ client ลงในแอปพลิเคชันของคุณ
Join mesh + รัน inference โดยไม่ serve โมเดล
ต้องการ: SDK package + owner keypair + invite token
รวม Client + search/download/serve models + optional console
ต้องการ: SDK package + compatible native runtime
| SDK | Inference | Model Mgmt | Local Serving |
|---|---|---|---|
| Rust macOS/Linux | ✅ | ✅ | ✅ with native runtime |
| Node.js macOS/Linux/Win | ✅ | ✅ | ✅ with native runtime |
| JVM/Kotlin macOS/Linux | ✅ | ✅ | ✅ with runtime lib |
| Android | ✅ | ✅ | ❌ not advertised |
| Swift macOS/iOS | ✅ | ✅ | ✅ (macOS) / ❌ (iOS) |
load owner keypair
create Client(invite_token)
start()
list models
stream chat
stop()
resolve native runtime
create Node
start()
download/locate model
load model → serve
run inference
unload model
stop()
ไฟล์ config ของ Mesh LLM
~/.mesh-llm/config.tomlใช้ TOML syntax — override path ได้ด้วย MESH_LLM_CONFIG env var
[gpu]
assignment = "auto" # "auto" หรือ "pinned"
parallel = 2 # total parallel inference slots
[owner_control]
bind = "[::]:7447"
advertise_addr = "" # NAT/Docker override
[telemetry]
enabled = false
service_name = "mesh-llm"
endpoint = "http://localhost:4318"
export_interval_secs = 10
[[models]]
model = "meta-llama/Llama-3.1-8B-Instruct-GGUF"
[models.model_fit]
ctx_size = 8192
[models.throughput]
parallel = 4
[models.request_defaults]
max_tokens = 2048
temperature = 0.7
[[plugin]]
name = "my-plugin"
enabled = true
command = "python3"
args = ["-m", "my_plugin"]
[plugin.startup]
timeout_secs = 30
restart_delay = 2
max_restarts = 3
[mesh_requirements]
min_protocol_version = 0
max_protocol_version = 0
require_release_attestation = false
release_signer_keys = []
คำสั่งหลักของ mesh-llm CLI
| Command | คำอธิบาย | ตัวอย่าง |
|---|---|---|
setup | ตั้งค่าหลังติดตั้ง | mesh-llm setup |
serve | เริ่ม serve โมเดล + join mesh | mesh-llm serve --auto |
client | Client-only (ไม่ serve) | mesh-llm client --auto |
stop | หยุด runtime | mesh-llm stop |
doctor | วินิจฉัยปัญหา | mesh-llm doctor |
uninstall | ลบ Mesh | mesh-llm uninstall --yes |
| Command | คำอธิบาย | ตัวอย่าง |
|---|---|---|
models recommended | โมเดลแนะนำ | mesh-llm models recommended |
models search | ค้นหา GGUF/MLX | mesh-llm models search gemma --gguf |
models show | ดูรายละเอียดก่อนโหลด | mesh-llm models show unsloth/gemma-4-E4B-it-GGUF |
models download | ดาวน์โหลดโมเดล | mesh-llm models download Qwen3-8B-Q4_K_M |
models installed | ดูที่ติดตั้งแล้ว | mesh-llm models installed |
models package | สร้าง layer package | mesh-llm models package unsloth/Qwen3-8B-GGUF:Q4_K_M --dry-run |
models certify | Certify package/endpoint | mesh-llm models certify <ref> --package-only |
models cleanup | ล้าง stale cache | mesh-llm models cleanup --unused-since 30d --yes |
models prune | ล้าง stale stage artifacts | mesh-llm models prune --yes |
models updates | เช็คอัปเดต | mesh-llm models updates --check |
| Flag | คำอธิบาย | Default |
|---|---|---|
--model <M> | โมเดลที่จะ serve | — |
--auto | Auto-join best mesh | — |
--discover [name] | Discover + join mesh ตามชื่อ | — |
--join <token> | Join ด้วย invite token | — |
--port <P> | API port | 9337 |
--console <P> | Console/management port | 3131 |
--headless | ปิด web UI, ใช้ management API | false |
--publish | Publish mesh สำหรับ discovery | false |
--client | API-only mode | false |
--max-vram <V> | Cap VRAM | auto |
--llama-flavor <F> | Force backend (cpu/cuda/rocm/vulkan/metal) | auto |
mesh-llm benchmark tune --model Qwen3-0.6B-Q4_K_M
mesh-llm benchmark tune --model Qwen3-0.6B-Q4_K_M --apply
mesh-llm benchmark import-prompts --source mt-bench --output ./corpus.jsonl
mesh-llm runtime list
mesh-llm runtime install cuda13
mesh-llm gpus
mesh-llm auth init # สร้าง owner keypair
mesh-llm auth status # ดู identity status
เปรียบเทียบสองโปรเจกต์ distributed LLM inference
| Area | Exo | Mesh LLM |
|---|---|---|
| Language | Python, Svelte, Swift | Rust, TypeScript/React |
| Inference | MLX, MLX distributed | Skippy/llama.cpp stages |
| Splitting | Tensor + Pipeline parallelism | Contiguous layer ranges |
| Hardware | Apple Silicon focus | Cross-platform (CUDA, ROCm, Vulkan, Metal, CPU) |
| Networking | libp2p, mDNS | QUIC/iroh, Nostr discovery |
| Architecture | Event sourcing (Master/Worker) | Decentralized mesh + gossip |
| API | OpenAI, Claude, Ollama | OpenAI-compatible /v1 |
| Dashboard | :52415 + macOS app | :3131 console + :9337 API |
| Model artifacts | Full MLX models | Layer packages + GGUF fragments |
| Community | 45k+ stars | 1.1k stars (newer) |
http://localhost:9337/v1 · Console: http://localhost:3131โครงสร้าง repository ของ Mesh LLM
| Concern | Source |
|---|---|
| Binary + CLI | crates/mesh-llm/, crates/mesh-llm-cli/ |
| Host orchestration | crates/mesh-llm-host-runtime/src/runtime/ |
| Mesh, gossip, peers | crates/mesh-llm-host-runtime/src/mesh/ |
| Routing, proxying, tunnels | crates/mesh-llm-host-runtime/src/network/ |
| Model resolution | crates/mesh-llm-host-runtime/src/models/ |
| React console | crates/mesh-llm-ui/, crates/mesh-llm-console-server/ |
| SDK facade + embedded node | crates/mesh-llm-sdk/, crates/mesh-llm-node/ |
| FFI + language packages | crates/mesh-llm-ffi/, sdk/ |
| Skippy runtime | crates/skippy-* |
| Protocol definitions | crates/mesh-llm-protocol/, proto/ |