Serving open-weight MoEs: what we measured
Prefix caching, data and expert parallelism with pinned sessions, and contract-gated quantisation cut a 64K agent turn from 104 s to 2.5 s on eight PCIe GPUs.
Prefix caching, data and expert parallelism with pinned sessions, and contract-gated quantisation cut a 64K agent turn from 104 s to 2.5 s on eight PCIe GPUs.
Prompt caching reuses the processed start of a repeated prompt, so it bills at a tenth or less of the input price. How Claude, OpenAI and Gemini differ.
Make the model a setting, not a dependency: a thin interface, evals per task and a tested fallback. Route across models only where cost or residency pays.
A recurring report. A slow review. A prototype that needs to work in the real world.
For long-context agent work on open-weight mixture-of-experts models, three choices held up in our measurements: turn prefix caching on, run data and expert parallelism with each session pinned to one replica, and admit a quantisation only when it passes the agent's own contracts rather than component tests alone. On eight PCIe GPUs that combination cut time to first token for a 64,000-token agent turn from 104 seconds to 2.5 seconds. On raw, uncached long prompts, the data-parallel layout also ran roughly 2.3× faster than tensor parallelism, pinned or not.
Mixture-of-experts (MoE) models split their feed-forward layers into many smaller "experts" and activate only a few per token: cheap to run per token, awkward to serve, because every expert still sits in GPU memory and how you spread them across cards sets your speed ceiling. The numbers below come from Project Venus, our open-weight serving work for the Company Twin, measured mostly on DeepSeek V4.1 Flash (~475 GiB checkpoint) running under vLLM on eight NVIDIA RTX PRO 6000 Blackwell GPUs (768 GB total, connected over PCIe rather than NVLink). DeepSeek serves as our teacher model for generating training text; the product model is the smaller Qwen3.8-27B, and where a lesson came from that stack we say so. Every run was judged against pre-written gates and a fixed correctness suite we call the gold test, misses included.
Key takeaways
An agent turn is mostly repetition. Every request sends the same instructions and tool definitions, then the conversation and every tool result so far, with something new only at the very end. Without a cache the engine rebuilds its key-value state for the entire prefix on every turn; with one, it reuses the blocks it already computed and prefills only the new tail. Our guide to prompt caching covers the same mechanism on hosted APIs. When you run the engine yourself, you also own the switch.
We learned that the hard way. vLLM supports automatic prefix caching for DeepSeek V4.1 and enables it by default, yet our early launch scripts passed --no-enable-prefix-caching, a stray flag left over from deterministic evaluation runs. Removing it dropped a 64K-token shared-prefix agent turn at 32 concurrent sessions from 104 seconds to 4.2 seconds p90 time to first token on TP8, at a 0.97 cache hit rate. For this model, the cache stores compressed key-value and indexer blocks at 64-token granularity and replays the 128-token sliding window after a hit. The gold test passed with caching enabled, including a retrieval answered from a cache hit.
Time to first token, 64K-token agent turn at 32 concurrent sessions (p90)
The natural worry is that caching shifts outputs. We checked that directly on the Qwen3.8-27B stack before switching it on in production: four arms on one GPU, every request sent twice, caching on and off, with and without the speculative draft model. With the draft model, 106 of 106 perplexity windows were bit-equal, 40 of 40 GSM8K outputs were identical, all six facts planted in a 51,753-token document were found, and repeat time to first token on that document fell from 18.1 seconds to 0.46 seconds.
Tensor parallelism (TP8) splits every layer across all eight GPUs, ending each layer in an all-reduce between them. Over NVLink that's cheap; over PCIe it hurts. Measured inside the CUDA graph, NCCL's all-reduce took 41 to 45 microseconds and FlashInfer's PCIe all-reduce 22 to 29, whereas a raw peer-to-peer hop takes about one microsecond. Data plus expert parallelism (DP8+EP8) gives each GPU its own copy of the attention layers while sharing experts across cards, turning the node into eight independent prefill engines with no per-layer attention all-reduce. It also expanded our key-value pool to 60.8 million tokens, against 9.5 million on TP8.
On raw, uncached long prompts, DP8+EP8 reached 44,200 tokens per second at 64K context and 128 concurrent requests, and 42,700 at 32K and 256. TP8 topped out around 19,000. Our pre-registered bar was 40,000.
Raw long-prompt throughput, prefix cache cold (tokens per second)
Data parallelism comes with one catch, and it matters more than the parallelism itself. Each replica keeps its own cache, so a session bouncing across replicas pays for its prefix all over again. Unpinned, DP8 managed a 0.76 first-turn hit rate and 15 seconds p90 time to first token, slower than TP8. Pinning each session to one replica (or routing by prefix) brought that down to 2.5 seconds. We configured that pinning for the benchmark; it isn't yet wired into our model gateway, which already knows the session behind every request and is where the rule belongs. Today the gateway serves a single tensor-parallel replica.
Prefill is half of an agent turn; generation is the rest, and bulk jobs and single users want different layouts. Our untuned TP8 qualification peaked at 416 output tokens per second (2K-token prompts, 128 concurrent), and at 8K-token prompts the queue backed up until first token took up to 1,037 seconds. Prefill and inter-GPU communication were the bottleneck, not the experts.
| Bulk lane | Interactive lane | |
|---|---|---|
| Layout | DP8+EP8, the model's Engram memory tables (lookup tables of learned embeddings it reads alongside its experts) in host RAM, CUDA graphs captured up to batch 512 | TP8 with FlashInfer's PCIe all-reduce and DSpark speculative decoding, which proposes several tokens ahead for the model to check in one pass |
| Measured | 8,687 output tokens/s at 2K prompts and 768 concurrent; 4,013 at 8K and 512 | 224–251 tokens/s per user at concurrency 1; p90 time to first token 0.31–0.64 s |
| Use it for | Parallel agent work, batch extraction, evaluation sweeps | One person waiting on one answer |
| Watch for | 16K batched tokens failed the gold test; 1,024 concurrent is unqualified | DSpark doubles speed at concurrency 1 but costs about a third at 256, so gate it per lane |
DeepSeek V4.1 Flash, 1,024-token outputs with thinking on, 31 October to 1 November 2026. The bulk lane is about 21× the untuned qualification's best output throughput.
For perspective, the interactive lane sits at about a quarter of SemiAnalysis's published per-user figure on an NVIDIA GB300 system with NVLink. Most of that gap is simply the price of PCIe.
We run one champion stack that all serving work assumes, and one challenger that has to hit parity before it can displace it. For a spell we ran three engines: vLLM, SGLang and llama.cpp (which served our GGUF builds nicely on single streams). The drag showed up in October when a round of cache research turned out to have targeted llama.cpp, the exact engine we were retiring. Since 22 October, vLLM is the champion, SGLang the sole challenger, and llama.cpp is out of serving research.
vLLM earned the champion slot on numbers. On Qwen3.8-27B with the official FP8 checkpoint on an H100, stock vLLM decoded at 80.5 tokens per second, 129.4 with two-token multi-token prediction, and 155.2 with a DFlash2 draft model (a small companion proposing seven tokens at a time for the main model to verify), 93% faster, with zero failures on our length canaries. On an H200 the same recipe climbed from 97.8 to 179.4.
Having a champion and challenger also gives you a clean way to say no. In the same weeks we rejected:
Because agents fail in ways standard benchmarks don't count. In September we put 13 arms of Qwen3.8-27B checkpoints through 224 component tests exercising the real agent loop: tool calls, streaming, cancellation and dependent answers over a sealed test warehouse. Both the BF16 and 5-bit references passed all 224. The faster 4-bit NVFP4 builds passed 223 and 222.
One or two misses sound harmless until you inspect them: extra prose where the loop expected a structured action, and a call to a tool the agent isn't allowed to touch. The first breaks a parser; the second breaks a security boundary. Our gate allows zero degradation against the reference, so neither quantisation was promoted and their speed counted for nothing.
| Component tests | What failed | Admitted | |
|---|---|---|---|
| BF16 reference | 224/224 | Nothing | Reference |
| 5-bit GGUF reference | 224/224 | Nothing | Reference |
| NVFP4 build A | 223/224 | One agent-loop test | No |
| NVFP4 build B | 222/224 | Extra prose; a forbidden tool call | No |
| Heavily quantised W4A16 | General benchmark parity | None on that benchmark; held back as too heavily quantised | Emergency tier only, then dropped |
Qwen3.8-27B, 7 and 30 September 2026, with all 2,072 attempts retained. We also excluded an NVFP4 key-value cache everywhere after a speculative-verify crash and correctness failures on the CUDA-graph path.
We stand by that last row. A W4A16 checkpoint matched the full model on a general benchmark and we still pulled it from production: we'd rather tell a user capacity is unavailable than hand them a quietly worse model. The same standard holds for tuning flags. When 16K batched tokens produced wrong SQL on the gold test, we didn't rerun until it got lucky; the setting stayed out.
Every study starts with its gates written down: the thresholds, the metrics that count, and what happens on a pass or miss. Our serving-levers study included a conditional second phase on larger B200 GPUs, triggered only if the RTX PRO 6000 node missed its targets on long-context agent turns. It cleared both (raw uncached reading included), so the B200 phase never ran. The custom decode engine stopped by the same rule once a milestone missed its projection and the follow-up all-reduce sprint missed its gate. It cuts both ways: one cold-start recipe missed its startup gate by 55.6 seconds and wasn't admitted, and the recipe we run today was accepted only with an explicit, recorded latency waiver.
On 1 November we froze work specific to DeepSeek V4.1. At 475 GiB it spans all eight GPUs, pushing tensor and expert traffic across CPU sockets over PCIe, keeping tensor-parallel prefill under ~19,000 tokens per second and capping long-context concurrency. A ~200 GB model fits on the four GPUs behind one socket, giving two replicas per node with far less cross-socket traffic. With new open-weight MoEs in that weight class due within days, we built onboarding as a repeatable pipeline instead of another heap of model-specific patches.
Onboarding a new open-weight MoE
The pipeline carries 45 tests and a full dry run across all eight stages for DeepSeek V4.1, plus an offline safety check confirming it can't touch a provider or the network while running locally. It runs CPU-first, with GPU stages executed per model when a release drops. Its starting priors are the findings above: prefix caching on, data and expert parallelism with session pinning for agent traffic, and tensor parallelism with speculative decoding for one person waiting.
If you're weighing self-hosted models, measure your own traffic before picking hardware. Log a week of agent runs and check prefix length, turns per session and concurrency: that tells you immediately whether prefix caching and session routing will dominate (as they did for us) or whether single-user latency matters more. Pick one champion engine, write the gates before renting GPUs, and test every quantisation through your real agent loop rather than a leaderboard.
For most teams the sensible first step is still a hosted model behind a gateway that can later route to a self-hosted one, just as the Twin does. Our guide to multi-model AI without lock-in lays out that architecture, and the Project Venus research page tracks where the private model stands today.
The Company Twin runs hosted providers and our private open-weight stack behind the same governance, so switching models never alters who can see what. See Venus inside the Twin →
Further reading