This is an update to our Docker Swarm cluster and V100 GPU build posts. Over the past three months, the cluster has evolved from a simple round-robin LLM proxy into something closer to a real serving platform — with intelligent routing, speculative decoding, multi-LoRA adapters, and the beginnings of a training-as-a-service system. This post covers what we’ve built, what the numbers look like now, and where we’re headed.
The platform is live at swarm.ftds.online. The system design lives in ftulabs/cluster. This is ongoing work — some parts are in production, some are being built.
The Problem
A university has wildly heterogeneous users. A first-year student asking “what is GDP?” and a law professor analyzing a 50-page contract should not hit the same model on the same hardware. The student’s query can run on a 4B model on a CPU node in milliseconds. The professor’s query needs a 28B model on a V100 with domain-specific knowledge.
We also have departments that want their own fine-tuned models — law, finance, international business — but nobody has the infrastructure or expertise to train and serve them. They want to upload a dataset and get a working model back.
So the platform has two services:
- Inference-as-a-Service — chat via OpenWebUI with automatic routing to the right hardware and the right domain configuration (LoRA, RAG, MCP tools).
- Training-as-a-Service — submit a fine-tuning job, get back a deployed LoRA adapter that plugs into the inference tier.
What Changed: Performance Update
Since the original posts, every tier has gotten significantly faster. The biggest surprise was the CPU workers.
| Tier | Before | Now | What Changed |
|---|---|---|---|
| CPU (40× i7) | ~2 t/s | ~10 t/s | Qwen3.5-4B-MTP Q4_K_XL + flash attention + q4_0 KV cache + batch tuning |
| Xavier AGX | ~11 t/s | ~16 t/s | Qwen3.6-35B-A3B Q4_K_XL, turbo2 KV cache (6.4× compression), 524K context |
| V100 4×SXM2 | (new) | ~78 t/s | REAP-28B Q4_K_M, 4-GPU NVLink shared memory |
The CPU speedup deserves a deeper look. The old config ran Qwen3.5-4B at Q8_0 quantization with 1 parallel slot, no flash attention. We benchmarked exhaustively on an i7-13700 and found that:
- Q4_K_XL beats Q8_0 by +33% throughput — the model is memory-bandwidth-bound on DDR5, and halving the weight size helps more than preserving precision.
- Flash attention + KV cache quantization (q4_0) frees enough RAM to run 4 parallel slots within the 16 GB budget, which is the real throughput multiplier under concurrent load.
- Intel iGPU (Vulkan) is a dead end: −40% vs pure CPU. The UHD 770 can’t beat AVX_VNNI + DDR5 on a model this small.
- Speculative decoding with a draft model (0.8B Qwen) also loses: −25-30%. No GPU to hide the draft compute cost.
In production, the CPU workers mostly sit idle — the semantic router sends traffic to Xavier and V100 first. But when 20+ students hit the system simultaneously during an exam review session, having 40 nodes at ~10 t/s each (~396 t/s aggregate at 80 concurrent users) means nobody waits.
Semantic Router: Three Tiers, One Chat
The user sees a single chat interface at swarm.ftds.online. Behind it, an OpenWebUI filter scores every message and routes it to the appropriate hardware tier.
User message
│
▼
┌─────────────────────────────┐
│ Semantic Router │
│ │
│ 1. Extract text + images │
│ 2. Score complexity: │
│ - word count │
│ - pattern matching │
│ (code? analysis? │
│ explain? debug?) │
│ - conversation depth │
│ 3. Check conversation │
│ affinity (sticky tier) │
│ 4. Health-probe GPU tiers │
│ 5. Route to tier │
└──────┬──────┬──────┬────────┘
│ │ │
┌────▼──┐ ┌─▼───┐ ┌▼─────┐
│ CPU │ │Xavier│ │ V100 │
│ 4B │ │ 35B │ │ 28B │
│ ~10t/s│ │~16t/s│ │~78t/s│
└───────┘ └──────┘ └──────┘
The routing logic:
- V100 tier: messages with 100+ words, or complexity score ≥ 60 with 50+ words. This catches code review requests, long analysis prompts, multi-step reasoning.
- Xavier tier: 50+ words, or complexity score ≥ 30, or any message containing images (Xavier has the vision projector). Code generation, medium-length explanations, translations.
- CPU tier: greetings, short factual questions (“what is GDP?”), and fallback when GPU tiers are down.
Conversation affinity is the key design choice. Once a conversation is assigned to a tier, all subsequent messages in that chat stay on the same tier. The tier can escalate (CPU → Xavier → V100) but never downgrade. This preserves KV cache coherence — if a user starts a complex debugging session on the V100 and then sends a short follow-up message, that message stays on the V100 where the context is already cached.
Health-aware failover: the router probes each GPU tier’s /health endpoint
(cached for 15 seconds). If the V100 goes down mid-conversation, requests fall through to Xavier, then to CPU.
When the V100 comes back, new conversations can route to it again.
Domain-Aware Serving: LoRA + RAG + MCP
The next layer we’re building selects domain-specific configuration based on the user’s request. The V100 tier runs vLLM with multi-LoRA support, meaning a single base model can serve dozens of fine-tuned variants simultaneously without reloading.
vLLM (REAP-28B base model, frozen)
│
├── Request: "Analyze this contract clause"
│ → LoRA: law-v2 (50MB adapter)
│ → RAG: Vietnamese legal corpus
│ → MCP: legal-search tool
│
├── Request: "What's the DCF valuation of VNM?"
│ → LoRA: finance-v1 (50MB adapter)
│ → RAG: market data, SEC filings
│ → MCP: stock ticker tool
│
└── Request: "Explain photosynthesis"
→ LoRA: none (base model)
→ RAG: course materials
→ MCP: web-search, calculator
The architecture follows the pattern AWS documented for
serving dozens of fine-tuned models with vLLM.
The core insight: LoRA adapters are small (two matrices per layer, ~50MB for rank-16 on a 28B model).
The base model weights are frozen and shared across all requests.
Per request, the output is y = xW + xAB —
the base projection plus the low-rank adapter contribution.
No cold start, no model reload, no wasted GPU memory.
Each domain configuration bundles three things:
- LoRA adapter — fine-tuned on domain-specific data (legal texts, financial reports, medical guidelines). Hot-swapped per request via vLLM’s multi-LoRA API.
- RAG collection — a partitioned vector store (ChromaDB or Qdrant) with domain-specific documents. The router attaches relevant context before the request hits the LLM.
- MCP tools — domain-specific tool servers. A law adapter gets a legal database search tool. A finance adapter gets a real-time stock data tool. The LLM can call these tools as part of its response.
Training-as-a-Service
The second half of the platform. Departments want custom models but don’t have ML engineers. The idea: provide a web UI where users upload a dataset, pick a base model (4B only, for now), and get back a deployed LoRA adapter — without touching a terminal.
This is inspired by platforms like Thinking Machines’ Tinker, HuggingFace AutoTrain, and LLaMA Factory — but scoped to our hardware and use case.
Training Pipeline:
Upload dataset → Validate & → QLoRA training → Automated → Deploy to
(JSONL / CSV) auto-format (Unsloth/PEFT) evaluation LoRA library
to chat (lm-eval + → hot-swap
template V100 or H100 custom into vLLM
off-hours prompts) → router
scheduling update
The platform handles:
- Data preprocessing — auto-converts CSV/JSONL to the model’s chat template format. Users don’t need to know about special tokens or role tags.
- Training optimization — QLoRA (4-bit NF4 quantization) via Unsloth, which halves memory and doubles speed. Default hyperparameters are auto-tuned; power users can override.
- GPU scheduling — training jobs run on V100 or H100 during off-hours (22:00–08:00) or when inference load is below 50%. Inference always has priority — a training job will be preempted rather than degrade chat response times.
- Evaluation — automated benchmarks (lm-eval-harness) plus user-defined test prompts. The adapter must pass a quality gate before deployment.
- Deployment — passing adapters are copied to the shared LoRA library on NFS. vLLM picks them up via API without restart. The semantic router is updated to map domain requests to the new adapter.
Architecture Overview
How all the pieces connect:
Internet (swarm.ftds.online)
│
frp reverse proxy
│
┌─────────▼──────────────────────────────────┐
│ Leader Node (10.0.190.65) │
│ │
│ OpenWebUI :3001 ← Google OAuth (ftu.edu.vn)
│ │ │
│ ┌───▼───────────────┐ │
│ │ Semantic Router │ complexity + │
│ │ (OWUI filter) │ domain scoring │
│ └───┬──────┬────┬───┘ │
│ │ │ │ Training UI :8500 │
│ │ │ │ ChromaDB :8000 │
│ │ │ │ Redis :6379 │
│ │ │ │ Prometheus :9090 │
│ │ │ │ Grafana :3000 │
└──────┼──────┼────┼──────────────────────────┘
│ │ │
┌────────────────┘ │ └──────────────────┐
│ │ │
┌──────▼──────┐ ┌──────────▼────────┐ ┌─────────▼──────────┐
│ CPU Tier │ │ Xavier Tier │ │ V100 Tier │
│ │ │ │ │ │
│ 40x i7 │ │ Jetson Xavier AGX │ │ 4x V100-SXM2 │
│ 16GB each │ │ 30GB RAM │ │ 64GB VRAM, NVLink │
│ │ │ │ │ │
│ llama.cpp │ │ llama.cpp │ │ vLLM │
│ Qwen 4B │ │ Qwen 35B MoE │ │ REAP-28B base │
│ Q4_K_XL │ │ IQ4_XS │ │ + multi-LoRA │
│ +ngram+MTP │ │ +MTP d=3 │ │ + domain adapters │
│ │ │ +vision (mmproj) │ │ │
│ ~10 t/s │ │ ~16 t/s │ │ ~78 t/s │
│ │ │ │ │ │
│ Simple Q&A │ │ Reasoning, │ │ Complex analysis, │
│ Greetings │ │ Vision, Code │ │ Domain-specific, │
│ Fallback │ │ │ │ Long-form │
└─────────────┘ └───────────────────┘ └─────────┬──────────┘
│
┌─────────▼──────────┐
│ LoRA Library │
│ (NFS shared) │
│ │
│ law-v2 ~50MB │
│ finance-v1 ~50MB │
│ medical-v1 ~50MB │
│ code-v1 ~50MB │
│ ... │
└────────────────────┘
What We Learned So Far
- CPU inference is better than expected. With the right quantization (Q4_K_XL), speculative decoding (ngram+MTP), and batch tuning, i7-13700 nodes went from ~2 t/s to ~10 t/s per node — fast enough for real-time chat. Under Locust stress tests, the cluster sustains ~396 t/s aggregate at 80 concurrent users.
- Speculative decoding is hardware-dependent. MTP helps on H100 (+12%), helps on CPU with ngram-mod (+49% concurrent), but hurts on V100 and Xavier (compute-bound, not bandwidth-bound). DFlash speculative decoding shows 4.2× speedup on H100, but is net-negative on V100 via llama.cpp — Volta’s compute throughput can’t amortize the draft overhead. Always benchmark on your actual hardware before committing to a speculative strategy.
- REAP pruning doesn’t hurt quality. Our REAP-28B (pruned from 35B, 256→205 experts) runs faster per token with negligible quality loss on our eval suite. The pruned model serves well on V100 where the smaller active parameter count matters for VRAM and compute.
- Multi-LoRA changes the economics. Instead of one GPU per department, one GPU serves all departments simultaneously. Each LoRA adapter adds ~50MB to a 28B base model — you can fit dozens of domain-specific models in 64GB of VRAM. Hot-swapping per request means no cold starts, no idle GPUs.
- Conversation affinity matters for KV cache. Letting the router downgrade mid-conversation (V100 → CPU) wastes the KV cache built up on the GPU and forces re-prefill on the new tier. Sticky routing (escalate-only) keeps the cache warm.
What’s Next
The immediate work:
- Domain detection in the router — extending the semantic router to classify domain (law/finance/medical/general) and pass the correct LoRA adapter name to vLLM.
- RAG pipeline — ChromaDB with per-domain collections, integrated into the OpenWebUI request pipeline.
- Training UI — a web interface for submitting QLoRA fine-tuning jobs, monitoring progress, and browsing the adapter library.
- Multi-LoRA on V100 — migrating the V100 from llama.cpp to vLLM with
--enable-lorafor per-request adapter hot-swap.
The full system design and implementation roadmap is in the cluster repo README. We’ll post updates as each component lands in production.
Links
- swarm.ftds.online — live cluster
- ftulabs/cluster — source code, deployment docs
- Blog: Building a 40-Node LLM Cluster with Docker Swarm
- Blog: Building a V100 SXM2 GPU Cluster on a University Budget
- AWS: Multi-LoRA serving with vLLM — architecture reference