<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Sglang on lo0 — Tech Blog</title><link>https://blog.lo0.es/en/tags/sglang/</link><description>Recent content in Sglang on lo0 — Tech Blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Tue, 16 Jun 2026 02:00:00 +0200</lastBuildDate><atom:link href="https://blog.lo0.es/en/tags/sglang/index.xml" rel="self" type="application/rss+xml"/><item><title>LLM serving engines compared on the Pareto frontier: vLLM, SGLang, TRT-LLM and Dynamo</title><link>https://blog.lo0.es/en/posts/llm-serving-engines-pareto-frontier-comparison/</link><pubDate>Tue, 16 Jun 2026 02:00:00 +0200</pubDate><guid>https://blog.lo0.es/en/posts/llm-serving-engines-pareto-frontier-comparison/</guid><description>&lt;blockquote>
&lt;p>Notation: amounts in &lt;strong>euros (N €)&lt;/strong>, decimals with a point. The dollar symbol is not used
(on this site it is a formula delimiter). Reference hardware: generic configuration
4×H100 SXM 80 GB; the figures are illustrative for comparing engines, not production
metrics from any real infrastructure.&lt;/p>
&lt;/blockquote>
&lt;h2 id="tldr">TL;DR&lt;/h2>
&lt;p>Four OSS engines dominate on-premise LLM serving in 2026: &lt;strong>vLLM&lt;/strong>, &lt;strong>SGLang&lt;/strong>,
&lt;strong>NVIDIA TensorRT-LLM&lt;/strong> and &lt;strong>NVIDIA Dynamo&lt;/strong>. None is superior on every axis. In
raw throughput with a shared prompt, SGLang beats vLLM by 29 % on Llama-3.3-70B
FP8 over H100 (16,200 vs 12,500 tok/s). In decode latency, TRT-LLM keeps ITL more
stable at high concurrency (9–12 ms P50 against 18–22 ms for vLLM). Dynamo is not an
inference engine: it is the &lt;strong>orchestration layer&lt;/strong> on top of the previous three for
multi-node clusters, and it reports up to 7× additional throughput in disaggregated serving on Blackwell.
The right choice depends on three variables: &lt;strong>load pattern&lt;/strong> (batch/interactive),
&lt;strong>deployment scale&lt;/strong> (single node/multi-node) and &lt;strong>operational constraints&lt;/strong> (OSS
maturity, ease of operation). The Pareto decision table is at the end of the article.&lt;/p>
&lt;hr>
&lt;h2 id="framing-the-article-what-this-b8-is-and-is-not">Framing the article: what this B8 is and is not&lt;/h2>
&lt;p>This article (B8 of the benchmarking pillar) takes for granted the metrics from the
&lt;a href="https://blog.lo0.es/en/posts/llm-inference-benchmarking-frameworks-metrics-state-of-the-art/">introduction to benchmarking&lt;/a> and
the tool catalogue from &lt;a href="https://blog.lo0.es/en/posts/llm-benchmark-tool-catalogue-practical-deep-dive/">the card-by-card piece&lt;/a>.
It applies those concepts to engine selection. The protocol from &lt;a href="https://blog.lo0.es/en/posts/guidellm-validating-slo-under-load-sizing-knee/">GuideLLM for SLO
validation&lt;/a> and &lt;a href="https://blog.lo0.es/en/posts/genai-perf-llm-inference-profiling-in-depth/">AIPerf in depth&lt;/a>
detail how to run the harness; here the result is used. The fundamentals of
&lt;a href="https://blog.lo0.es/en/posts/continuous-batching-orca-vllm-chunked-prefill-goodput/">continuous batching&lt;/a>,
&lt;a href="https://blog.lo0.es/en/posts/disaggregated-serving-prefill-decode-specialised-pods/">disaggregated serving&lt;/a>,
&lt;a href="https://blog.lo0.es/en/posts/vllm-attention-backend-flashattention-flashinfer-prefill-decode-asymmetry/">the attention backend&lt;/a> and
&lt;a href="https://blog.lo0.es/en/posts/quantization-llm-inference-fp8-int4-gguf/">quantisation&lt;/a> are assumed known.&lt;/p>
&lt;hr>
&lt;h2 id="card-for-each-engine">Card for each engine&lt;/h2>
&lt;h3 id="vllm">vLLM&lt;/h3>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Attribute&lt;/th>
&lt;th>Value&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Reference version&lt;/td>
&lt;td>v0.9.x (June 2026)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Licence&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Maintainer / governance&lt;/td>
&lt;td>vLLM Project (Linux Foundation AI), led by UC Berkeley + Red Hat&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Supported hardware&lt;/td>
&lt;td>NVIDIA (Ampere/Hopper/Blackwell), AMD ROCm, Intel Gaudi, TPU, CPU&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Repository&lt;/td>
&lt;td>github.com/vllm-project/vllm&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>API&lt;/td>
&lt;td>OpenAI-compatible (completions, chat, embeddings)&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>Origin: PagedAttention (Kwon et al., 2023). The first implementation of continuous batching
with a paged KV cache. In 2026 it is the most deployed engine in OSS environments and the one that
accumulates the most integrations (Ray Serve, Kubernetes, llm-d, Dynamo).&lt;/p>
&lt;h3 id="sglang">SGLang&lt;/h3>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Attribute&lt;/th>
&lt;th>Value&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Reference version&lt;/td>
&lt;td>v0.4.x (June 2026)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Licence&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Maintainer / governance&lt;/td>
&lt;td>LMSYS Org (Berkeley, CMU, UCSD)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Supported hardware&lt;/td>
&lt;td>NVIDIA (Ampere/Hopper/Blackwell), AMD ROCm&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Repository&lt;/td>
&lt;td>github.com/sgl-project/sglang&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>API&lt;/td>
&lt;td>OpenAI-compatible + SGLang runtime API&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>Origin: the SGLang paper, 2024 (Zheng et al.). It introduces RadixAttention as a generalisation of
prefix caching: a radix tree of KV blocks with an LRU policy shared across all
in-flight requests. A structural advantage in workloads with shared prefixes (long system
prompts, few-shot, RAG).&lt;/p>
&lt;h3 id="nvidia-tensorrt-llm-trt-llm">NVIDIA TensorRT-LLM (TRT-LLM)&lt;/h3>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Attribute&lt;/th>
&lt;th>Value&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Reference version&lt;/td>
&lt;td>v0.18.x (June 2026)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Licence&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Maintainer / governance&lt;/td>
&lt;td>NVIDIA (proprietary in practice, OSS in name)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Supported hardware&lt;/td>
&lt;td>NVIDIA only: Ampere (A100), Hopper (H100/H200/GH200), Ada (L40/L40S), Blackwell (B200/GB200)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Repository&lt;/td>
&lt;td>github.com/NVIDIA/TensorRT-LLM&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>API&lt;/td>
&lt;td>Python + C++ runtime; integrates with Triton Inference Server&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>The lowest-level engine: it compiles inference graphs with TensorRT, applies kernel fusion
and generates binary engines specific to model + hardware + precision. Maximum performance
on NVIDIA, with no portability to other hardware. It requires recompilation when the model or
configuration changes; build time ranges from minutes to hours depending on the model.&lt;/p>
&lt;h3 id="nvidia-dynamo">NVIDIA Dynamo&lt;/h3>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Attribute&lt;/th>
&lt;th>Value&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Reference version&lt;/td>
&lt;td>v1.1.1 (May 2026)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Licence&lt;/td>
&lt;td>Apache 2.0&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Maintainer / governance&lt;/td>
&lt;td>NVIDIA + OSS community (ai-dynamo org on GitHub)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Supported hardware&lt;/td>
&lt;td>NVIDIA (through the underlying engine: vLLM, SGLang or TRT-LLM)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Repository&lt;/td>
&lt;td>github.com/ai-dynamo/dynamo&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Role&lt;/td>
&lt;td>Orchestration layer, NOT an inference engine&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>Dynamo &lt;strong>does not run inference directly&lt;/strong>: it is the scheduler and router that
coordinates pools of workers (vLLM, SGLang, TRT-LLM) across multiple nodes. Implemented in Rust
(performance) + Python (extensibility). It adds: disaggregated prefill/decode serving across
nodes, KV-aware routing (avoiding prefill recompute if another worker already has the KV in
cache), automatic scaling by SLA, a KV Block Manager (KVBM) with offload to CPU/SSD/remote
and transfer via NIXL over NVLink/InfiniBand.&lt;/p>
&lt;h3 id="honourable-mentions-lmdeploy-and-hf-tgi">Honourable mentions: LMDeploy and HF TGI&lt;/h3>
&lt;p>&lt;strong>LMDeploy&lt;/strong> (OpenMMLab/InternLM, Apache 2.0): an engine with two backends, TurboMind (C++,
maximum performance on NVIDIA) and PyTorch (flexibility). KV cache blocking and persistent
batching; 4-bit inference up to 2.4× faster than FP16 in its own benchmark. A narrower
ecosystem; no AMD support.&lt;/p>
&lt;p>&lt;strong>HF TGI&lt;/strong> (Hugging Face, Apache 2.0): the reference engine for the HuggingFace ecosystem.
TGI v3.0 cuts latency by up to 13× on long prompts against earlier versions; it integrates
FlashAttention + PagedAttention. The usual entry point for teams already operating the
HF stack; it is not the most efficient in throughput at maximum load.&lt;/p>
&lt;hr>
&lt;h2 id="capability-matrix">Capability matrix&lt;/h2>
&lt;p>The table uses this notation: &lt;strong>Yes&lt;/strong> = supported and stable, &lt;strong>Beta&lt;/strong> = available but not
recommended for production, &lt;strong>No&lt;/strong> = not available or only with a manual workaround.&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Capability&lt;/th>
&lt;th>vLLM&lt;/th>
&lt;th>SGLang&lt;/th>
&lt;th>TRT-LLM&lt;/th>
&lt;th>Dynamo (via backend)&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;strong>Continuous batching&lt;/strong>&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes (delegates to the engine)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>PagedAttention&lt;/strong>&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>RadixAttention / prefix caching&lt;/strong>&lt;/td>
&lt;td>Yes (chunked prefill + prefix)&lt;/td>
&lt;td>Yes (native RadixAttention)&lt;/td>
&lt;td>Yes (prefix caching)&lt;/td>
&lt;td>Yes + KV-aware routing&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Speculative decoding&lt;/strong>&lt;/td>
&lt;td>Yes (n-gram, EAGLE, DFlash, suffix)&lt;/td>
&lt;td>Yes (draft+verify)&lt;/td>
&lt;td>Yes (EAGLE-3, MTP)&lt;/td>
&lt;td>Yes&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>FP8 quantisation&lt;/strong>&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>MXFP4/NVFP4 quantisation&lt;/strong>&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Beta&lt;/td>
&lt;td>Yes (Blackwell)&lt;/td>
&lt;td>Yes&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>INT4 AWQ quantisation&lt;/strong>&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>GPTQ quantisation&lt;/strong>&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Not native&lt;/td>
&lt;td>Yes (via vLLM)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>INT8 quantisation (SmoothQuant)&lt;/strong>&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Structured output&lt;/strong>&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes (compressed FSM)&lt;/td>
&lt;td>Beta&lt;/td>
&lt;td>Yes&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Dynamic multi-LoRA&lt;/strong>&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Beta&lt;/td>
&lt;td>Yes&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Disaggregated prefill/decode&lt;/strong>&lt;/td>
&lt;td>Beta (experimental)&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes (first class)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Chunked prefill&lt;/strong>&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Multimodal support (VLM)&lt;/strong>&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Multi-node tensor parallelism&lt;/strong>&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes (+ pipeline across nodes)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>OpenAI API compatible&lt;/strong>&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes (via Triton)&lt;/td>
&lt;td>Yes&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Non-NVIDIA hardware&lt;/strong>&lt;/td>
&lt;td>Yes (AMD/Intel/TPU)&lt;/td>
&lt;td>Yes (AMD)&lt;/td>
&lt;td>No&lt;/td>
&lt;td>No&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>Sources for the matrix: docs.vllm.ai, docs.sglang.io, nvidia.github.io/TensorRT-LLM,
docs.nvidia.com/dynamo, github.com/ai-dynamo/dynamo (feature matrix, June 2026).&lt;/p>
&lt;hr>
&lt;h2 id="why-they-are-not-compared-lightly-the-variables-that-break-a-comparison">Why they are not compared lightly: the variables that break a comparison&lt;/h2>
&lt;p>Before the table of figures, the four decisions that invalidate any cross-engine benchmark:&lt;/p>
&lt;p>&lt;strong>1. A different harness.&lt;/strong> A benchmark run with each engine&amp;rsquo;s native micro-bench (vllm bench
serve vs SGLang bench) measures the client, not the engine. The discrepancy can be up to 7.2× at
high concurrency. The correct protocol: a single load generator (AIPerf or GuideLLM)
against every endpoint. The engine is the variable, the tool is the constant.&lt;/p>
&lt;p>&lt;strong>2. Different ISL/OSL.&lt;/strong> Input Sequence Length and Output Sequence Length determine the
prefill/decode ratio and therefore which engine is favoured. A benchmark with low ISL (64 tokens)
favours engines with fast decode; with high ISL (2,048 tokens) and shared prefixes, it
favours SGLang (RadixAttention). Fixing ISL and OSL is mandatory for the comparison
to be valid.&lt;/p>
&lt;p>&lt;strong>3. Different precision.&lt;/strong> FP16 and FP8 are not comparable: FP8 gives between 1.5× and 2× more
throughput on Hopper. Comparing vLLM FP16 with TRT-LLM FP8 says nothing about the engine.&lt;/p>
&lt;p>&lt;strong>4. Not reporting P99.&lt;/strong> Maximum throughput is reached at the point where TTFT P99 already
violates the SLO. The defensible number is goodput, throughput under the SLO, not the raw
maximum. The end-to-end latency formula:&lt;/p>
$$\text{latency}_{e2e} \approx \text{TTFT} + (N_{\text{out}} - 1) \times \text{TPOT}$$
&lt;p>where \(N_{\text{out}}\) is the number of output tokens, makes it clear that a high TTFT with low TPOT
has the same effect as the inverse case only for one specific \(N_{\text{out}}\):
both must be reported separately.&lt;/p>
&lt;p>The complete fair-comparison protocol is in
&lt;a href="https://blog.lo0.es/en/posts/llm-benchmark-tool-catalogue-practical-deep-dive/">the tools article&lt;/a>.&lt;/p>
&lt;hr>
&lt;h2 id="performance-on-the-pareto-frontier-illustrative-figures">Performance on the Pareto frontier: illustrative figures&lt;/h2>
&lt;p>Reference configuration for every row: &lt;strong>4×H100 SXM 80 GB NVLink&lt;/strong>,
model &lt;strong>Llama-3.1-70B-Instruct FP8&lt;/strong>, harness &lt;strong>AIPerf&lt;/strong> (formerly genai-perf, the multi-process successor),
dataset &lt;strong>ShareGPT&lt;/strong> (realistic length distribution), mean ISL ~512 tok, mean OSL
~256 tok, SLO TTFT P99 &amp;lt; 500 ms. The figures are illustrative and representative of benchmarks
published by the community (Cerebrium, LMSYS, Spheron, Red Hat MLPerf v5.1); they are not measurements
from any real infrastructure. Exact figures vary with engine versions, compilation
flags and load distribution.&lt;/p>
&lt;h3 id="throughput-vs-latency-pareto-table">Throughput vs latency: Pareto table&lt;/h3>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Engine&lt;/th>
&lt;th>Config&lt;/th>
&lt;th>Throughput (tok/s)&lt;/th>
&lt;th>TTFT P50 (ms)&lt;/th>
&lt;th>TTFT P99 (ms)&lt;/th>
&lt;th>ITL P50 (ms)&lt;/th>
&lt;th>Goodput (@SLO)&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;strong>vLLM v0.9&lt;/strong>&lt;/td>
&lt;td>FP8, chunked prefill&lt;/td>
&lt;td>12,500&lt;/td>
&lt;td>160&lt;/td>
&lt;td>420&lt;/td>
&lt;td>18&lt;/td>
&lt;td>~96 %&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>SGLang v0.4&lt;/strong>&lt;/td>
&lt;td>FP8, RadixAttention&lt;/td>
&lt;td>16,200&lt;/td>
&lt;td>140&lt;/td>
&lt;td>390&lt;/td>
&lt;td>21&lt;/td>
&lt;td>~97 %&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>TRT-LLM v0.18&lt;/strong>&lt;/td>
&lt;td>FP8, compiled engine&lt;/td>
&lt;td>14,800&lt;/td>
&lt;td>190&lt;/td>
&lt;td>480&lt;/td>
&lt;td>10&lt;/td>
&lt;td>~93 %&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>vLLM + Dynamo&lt;/strong>&lt;/td>
&lt;td>FP8, disagg. P/D 2+2&lt;/td>
&lt;td>18,500&lt;/td>
&lt;td>120&lt;/td>
&lt;td>310&lt;/td>
&lt;td>19&lt;/td>
&lt;td>~98 %&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>SGLang + Dynamo&lt;/strong>&lt;/td>
&lt;td>FP8, disagg. P/D 2+2&lt;/td>
&lt;td>21,000&lt;/td>
&lt;td>110&lt;/td>
&lt;td>280&lt;/td>
&lt;td>22&lt;/td>
&lt;td>~99 %&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>TRT-LLM + Dynamo&lt;/strong>&lt;/td>
&lt;td>FP8, disagg. P/D 2+2&lt;/td>
&lt;td>22,500&lt;/td>
&lt;td>130&lt;/td>
&lt;td>350&lt;/td>
&lt;td>11&lt;/td>
&lt;td>~97 %&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>Reading notes:&lt;/p>
&lt;ul>
&lt;li>&amp;ldquo;Disagg. P/D 2+2&amp;rdquo; = 2 prefill GPUs + 2 decode GPUs (the same 4×H100 budget).&lt;/li>
&lt;li>Goodput falls against raw throughput when the latency tail exceeds the SLO of
500 ms P99. TRT-LLM without Dynamo has the lowest ITL but the highest TTFT at high
concurrency, which brings its goodput down to ~93 % under this SLO.&lt;/li>
&lt;li>Dynamo adds ~30–40 % of effective throughput over 4 GPUs thanks to disaggregated serving
and KV-aware routing, in the scenario with reusable prefixes (ShareGPT).&lt;/li>
&lt;li>In workloads without shared prefixes (short ISL, unique prompts), Dynamo&amp;rsquo;s advantage
shrinks to ~10–15 % over the base engine.&lt;/li>
&lt;/ul>
&lt;h3 id="saturation-point-concurrency-sweep-vllm-fp8-4h100">Saturation point (concurrency sweep, vLLM FP8, 4×H100)&lt;/h3>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Concurrency&lt;/th>
&lt;th>TTFT P99 (ms)&lt;/th>
&lt;th>ITL P50 (ms)&lt;/th>
&lt;th>Throughput (tok/s)&lt;/th>
&lt;th>Goodput (tok/s)&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>8&lt;/td>
&lt;td>210&lt;/td>
&lt;td>14&lt;/td>
&lt;td>5,200&lt;/td>
&lt;td>5,200&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>16&lt;/td>
&lt;td>370&lt;/td>
&lt;td>18&lt;/td>
&lt;td>9,800&lt;/td>
&lt;td>9,800&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>32&lt;/td>
&lt;td>420&lt;/td>
&lt;td>18&lt;/td>
&lt;td>12,500&lt;/td>
&lt;td>12,200&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>48&lt;/td>
&lt;td>680&lt;/td>
&lt;td>26&lt;/td>
&lt;td>13,800&lt;/td>
&lt;td>7,400&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>64&lt;/td>
&lt;td>1,200&lt;/td>
&lt;td>41&lt;/td>
&lt;td>14,100&lt;/td>
&lt;td>2,100&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>The knee is between 32 and 48: throughput rises only 10 % (12,500 → 13,800) but TTFT
P99 already violates the 500 ms SLO and goodput halves. The defensible operational
capacity is the one at concurrency 32 (12,200 useful tok/s). Reporting 14,100 tok/s (concurrency 64)
would be maximum throughput with 15 % goodput.&lt;/p>
&lt;div class="diagram" style="max-width:780px;margin:1rem auto;">
&lt;svg viewBox="0 0 780 260" role="img" aria-label="Pareto frontier of LLM engines: throughput on the X axis, TTFT P99 on the Y axis. Each engine occupies a different point in the space, and Dynamo shifts the points up and to the right." xmlns="http://www.w3.org/2000/svg">
&lt;style>.ax{fill:none;stroke:currentColor;stroke-width:1}.cv{fill:none;stroke:currentColor;stroke-width:1.5}.dsh{fill:none;stroke:currentColor;stroke-width:1;stroke-dasharray:4 3}.tl{font:700 12px sans-serif;fill:currentColor}.ts{font:11px sans-serif;fill:currentColor}.pt{r:6;fill:currentColor}&lt;/style>
&lt;line class="ax" x1="60" y1="30" x2="60" y2="210"/>
&lt;line class="ax" x1="60" y1="210" x2="740" y2="210"/>
&lt;text x="20" y="125" class="ts" transform="rotate(-90 20 125)">TTFT P99 (ms) ↑ lower is better&lt;/text>
&lt;text x="360" y="235" class="ts" text-anchor="middle">Throughput (tok/s) → higher is better&lt;/text>
&lt;line class="dsh" x1="60" y1="80" x2="740" y2="80"/>
&lt;text x="66" y="76" class="ts">SLO 500 ms&lt;/text>
&lt;circle class="pt" cx="290" cy="108"/>
&lt;text x="298" y="103" class="tl">vLLM&lt;/text>
&lt;text x="298" y="116" class="ts">12,500 tok/s · 420 ms&lt;/text>
&lt;circle class="pt" cx="380" cy="98"/>
&lt;text x="388" y="93" class="tl">SGLang&lt;/text>
&lt;text x="388" y="106" class="ts">16,200 tok/s · 390 ms&lt;/text>
&lt;circle class="pt" cx="340" cy="118"/>
&lt;text x="348" y="113" class="tl">TRT-LLM&lt;/text>
&lt;text x="348" y="126" class="ts">14,800 tok/s · 480 ms&lt;/text>
&lt;circle class="pt" cx="480" cy="72"/>
&lt;text x="488" y="67" class="tl">vLLM+Dynamo&lt;/text>
&lt;text x="488" y="80" class="ts">18,500 tok/s · 310 ms&lt;/text>
&lt;circle class="pt" cx="580" cy="62"/>
&lt;text x="588" y="57" class="tl">SGLang+Dynamo&lt;/text>
&lt;text x="588" y="70" class="ts">21,000 tok/s · 280 ms&lt;/text>
&lt;circle class="pt" cx="660" cy="85"/>
&lt;text x="554" y="165" class="tl">TRT-LLM+Dynamo&lt;/text>
&lt;text x="554" y="177" class="ts">22,500 tok/s · 350 ms&lt;/text>
&lt;line class="dsh" x1="660" y1="85" x2="610" y2="160"/>
&lt;path class="cv" d="M290,108 Q380,80 480,72 Q580,60 660,85" fill="none"/>
&lt;text x="66" y="210" class="ts">0&lt;/text>
&lt;text x="290" y="225" class="ts">12 K&lt;/text>
&lt;text x="380" y="225" class="ts">16 K&lt;/text>
&lt;text x="480" y="225" class="ts">18.5 K&lt;/text>
&lt;text x="580" y="225" class="ts">21 K&lt;/text>
&lt;text x="660" y="225" class="ts">22.5 K&lt;/text>
&lt;/svg>
&lt;/div>
&lt;hr>
&lt;h2 id="fair-comparison-methodology-the-harness-as-the-constant">Fair-comparison methodology: the harness as the constant&lt;/h2>
&lt;p>The protocol that makes numbers comparable across different engines. The engine is the only
variable; everything else is constant and pinned in the output JSON.&lt;/p>
&lt;h3 id="variables-that-are-fixed-constants-of-the-experiment">Variables that are fixed (constants of the experiment)&lt;/h3>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Variable&lt;/th>
&lt;th>Value fixed in the reference experiment&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Load tool&lt;/td>
&lt;td>AIPerf v2.x (multi-process)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Model&lt;/td>
&lt;td>Llama-3.1-70B-Instruct&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Precision&lt;/td>
&lt;td>FP8&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Hardware&lt;/td>
&lt;td>4×H100 SXM 80 GB NVLink&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Dataset&lt;/td>
&lt;td>ShareGPT (realistic ISL/OSL distribution)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>SLO&lt;/td>
&lt;td>TTFT P99 &amp;lt; 500 ms, ITL P50 &amp;lt; 30 ms&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Warm-up&lt;/td>
&lt;td>200 requests discarded before measuring&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Sweep&lt;/td>
&lt;td>concurrencies 1, 4, 8, 16, 32, 48, 64&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Primary metric&lt;/td>
&lt;td>goodput (useful tok/s under SLO)&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h3 id="harness-steps">Harness steps&lt;/h3>
&lt;ol>
&lt;li>Deploy the engine with the exact config (pinned flags, fixed version).&lt;/li>
&lt;li>Warm-up: 200 requests; discard the results.&lt;/li>
&lt;li>Concurrency sweep: &lt;code>aiperf profile --concurrency-range 1:64:step&lt;/code> with AIPerf.&lt;/li>
&lt;li>Extend the sweep past the knee (until goodput falls below 50 %).&lt;/li>
&lt;li>Collect the JSON: TTFT P50/P99, ITL P50, raw throughput, goodput.&lt;/li>
&lt;li>Change &lt;strong>only the engine&lt;/strong>; repeat steps 1–5.&lt;/li>
&lt;li>Compare the goodput column across rows.&lt;/li>
&lt;/ol>
&lt;p>The &lt;a href="https://blog.lo0.es/en/posts/guidellm-validating-slo-under-load-sizing-knee/">sweep with GuideLLM&lt;/a> is equivalent
for SLO validation; AIPerf is preferable for engine comparisons because its
automatic &lt;code>estimatedCapacity&lt;/code> normalises the saturation point. Both can be used:
GuideLLM for the operational SLO, AIPerf for reference capacity.&lt;/p>
&lt;h3 id="reproducible-output-format">Reproducible output format&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-json" data-lang="json">&lt;span class="line">&lt;span class="cl">&lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;harness&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;aiperf&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nt">&amp;#34;harness_version&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;2.x&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;model&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;Llama-3.1-70B-Instruct&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nt">&amp;#34;precision&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;FP8&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;hardware&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;4xH100_SXM_80GB_NVLink&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;dataset&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;sharegpt&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;slo&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="p">{&lt;/span>&lt;span class="nt">&amp;#34;ttft_p99_ms&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mi">500&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nt">&amp;#34;itl_p50_ms&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mi">30&lt;/span>&lt;span class="p">},&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;motor&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;vllm&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nt">&amp;#34;motor_version&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;0.9.x&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;concurrency_sweep&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="p">[&lt;/span>&lt;span class="mi">8&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mi">16&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mi">32&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mi">48&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mi">64&lt;/span>&lt;span class="p">],&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;results_at_knee&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;concurrency&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mi">32&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;ttft_p50_ms&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mi">210&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nt">&amp;#34;ttft_p99_ms&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mi">420&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;itl_p50_ms&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mi">18&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nt">&amp;#34;throughput_tok_s&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mi">12500&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;goodput_tok_s&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mi">12200&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>This versioned JSON is the auditable datum: anyone can reproduce the figure with the same
tool, version, model, hardware and load.&lt;/p>
&lt;hr>
&lt;h2 id="state-of-the-art-2026-relative-maturity">State of the art 2026: relative maturity&lt;/h2>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Dimension&lt;/th>
&lt;th>vLLM&lt;/th>
&lt;th>SGLang&lt;/th>
&lt;th>TRT-LLM&lt;/th>
&lt;th>Dynamo&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;strong>Production maturity&lt;/strong>&lt;/td>
&lt;td>High (3+ years)&lt;/td>
&lt;td>Medium-high (2 years)&lt;/td>
&lt;td>High (NVIDIA)&lt;/td>
&lt;td>Medium (1.0 GA Mar 2026)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Release cadence&lt;/strong>&lt;/td>
&lt;td>Weekly&lt;/td>
&lt;td>Weekly&lt;/td>
&lt;td>Monthly&lt;/td>
&lt;td>Fortnightly&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Integration ecosystem&lt;/strong>&lt;/td>
&lt;td>Very broad (Ray, k8s, llm-d, Dynamo, NIM)&lt;/td>
&lt;td>Broad (Dynamo, k8s)&lt;/td>
&lt;td>NVIDIA-centric (Triton, NIM)&lt;/td>
&lt;td>NVIDIA-centric&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Ease of operation&lt;/strong>&lt;/td>
&lt;td>High (pip install, OpenAI API)&lt;/td>
&lt;td>High&lt;/td>
&lt;td>Medium (requires compiling engines)&lt;/td>
&lt;td>Medium-low (multi-node, etcd/NATS)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Non-NVIDIA hardware&lt;/strong>&lt;/td>
&lt;td>Yes (AMD, Intel, TPU)&lt;/td>
&lt;td>Yes (AMD)&lt;/td>
&lt;td>No&lt;/td>
&lt;td>No&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Disaggregated serving&lt;/strong>&lt;/td>
&lt;td>Beta&lt;/td>
&lt;td>Stable&lt;/td>
&lt;td>Stable&lt;/td>
&lt;td>First class&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Dynamic multi-LoRA&lt;/strong>&lt;/td>
&lt;td>Stable&lt;/td>
&lt;td>Stable&lt;/td>
&lt;td>Beta&lt;/td>
&lt;td>Stable (via vLLM/SGLang)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Structured output&lt;/strong>&lt;/td>
&lt;td>Stable&lt;/td>
&lt;td>Stable (FSM)&lt;/td>
&lt;td>Beta&lt;/td>
&lt;td>Stable (via the engine)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>OSS community support&lt;/strong>&lt;/td>
&lt;td>Very high (&amp;gt;30 K GitHub stars)&lt;/td>
&lt;td>High (~20 K stars)&lt;/td>
&lt;td>High (~10 K stars)&lt;/td>
&lt;td>Growing (6.8 K stars)&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;hr>
&lt;h2 id="pareto-decision-table-when-to-choose-each-engine">Pareto decision table: when to choose each engine&lt;/h2>
&lt;p>No prose; the decision as a table of criteria and outcome.&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Selection criterion&lt;/th>
&lt;th>Recommended engine&lt;/th>
&lt;th>Quantitative justification&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Single node, quick prototype, team with no LLM serving experience&lt;/td>
&lt;td>&lt;strong>vLLM&lt;/strong>&lt;/td>
&lt;td>pip install + OpenAI API in minutes; the broadest community support&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Workload with long shared prefixes (RAG, few-shot, system prompts &amp;gt; 512 tok)&lt;/td>
&lt;td>&lt;strong>SGLang&lt;/strong>&lt;/td>
&lt;td>RadixAttention: up to 6.4× more throughput vs a baseline without prefix caching&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Maximum throughput on NVIDIA, no portability, team with TRT experience&lt;/td>
&lt;td>&lt;strong>TRT-LLM&lt;/strong>&lt;/td>
&lt;td>Fused kernels + native FP8: ITL 9–12 ms vs 18–22 ms for vLLM on the same hardware&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Multi-node (&amp;gt; 8 GPUs), mixed prefill-intensive/decode-intensive traffic&lt;/td>
&lt;td>&lt;strong>Dynamo + SGLang&lt;/strong>&lt;/td>
&lt;td>Disaggregated P/D: up to 7× additional throughput on Blackwell; 2× TTFT with KV-aware routing&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>AMD ROCm or Intel Gaudi hardware&lt;/td>
&lt;td>&lt;strong>vLLM&lt;/strong>&lt;/td>
&lt;td>The only SOTA engine with stable non-NVIDIA support&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Structured output + high concurrency&lt;/td>
&lt;td>&lt;strong>SGLang&lt;/strong>&lt;/td>
&lt;td>Compressed FSM: guided decode with no appreciable overhead&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Stable dynamic multi-LoRA in production&lt;/td>
&lt;td>&lt;strong>vLLM or SGLang&lt;/strong>&lt;/td>
&lt;td>TRT-LLM multi-LoRA still in beta (Jun 2026)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Hugging Face ecosystem, models &amp;lt; 13B&lt;/td>
&lt;td>&lt;strong>HF TGI v3&lt;/strong>&lt;/td>
&lt;td>Direct HF Hub integration; competitive latency on small models&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Maximum energy efficiency (J/token) on NVIDIA&lt;/td>
&lt;td>&lt;strong>TRT-LLM&lt;/strong>&lt;/td>
&lt;td>Lower-overhead kernels → fewer J/token at iso-throughput&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;hr>
&lt;h2 id="quantisation-effect-on-throughput-and-quality">Quantisation: effect on throughput and quality&lt;/h2>
&lt;p>The four main options in order of decreasing speed and increasing quality:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Format&lt;/th>
&lt;th>Relative throughput (H100)&lt;/th>
&lt;th>Quality degradation (perplexity)&lt;/th>
&lt;th>Engines with stable support&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;strong>NVFP4 / MXFP4&lt;/strong>&lt;/td>
&lt;td>~2.2× vs FP16&lt;/td>
&lt;td>1–3 % on MMLU&lt;/td>
&lt;td>TRT-LLM (Blackwell), vLLM (experimental)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>FP8 (W8A8)&lt;/strong>&lt;/td>
&lt;td>~1.7× vs FP16&lt;/td>
&lt;td>&amp;lt; 1 % on MMLU&lt;/td>
&lt;td>vLLM, SGLang, TRT-LLM&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>INT4 AWQ&lt;/strong>&lt;/td>
&lt;td>~1.5× vs FP16&lt;/td>
&lt;td>1–2 % on MMLU&lt;/td>
&lt;td>vLLM, SGLang, TRT-LLM&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>GPTQ (INT4)&lt;/strong>&lt;/td>
&lt;td>~1.4× vs FP16&lt;/td>
&lt;td>1–3 % on MMLU&lt;/td>
&lt;td>vLLM, SGLang&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>FP16 (baseline)&lt;/strong>&lt;/td>
&lt;td>1.0×&lt;/td>
&lt;td>0 %&lt;/td>
&lt;td>All&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>FP8 is the de facto standard on Hopper for production: 1.7× throughput with degradation
below 1 %. The article on &lt;a href="https://blog.lo0.es/en/posts/quantization-llm-inference-fp8-int4-gguf/">quantisation in depth&lt;/a>
develops the quality/speed trade-off by format and model architecture.&lt;/p>
&lt;hr>
&lt;h2 id="disaggregated-serving-when-the-overhead-is-worth-it">Disaggregated serving: when the overhead is worth it&lt;/h2>
&lt;p>Separating prefill/decode into independent pools introduces transfer latency for
KV tensors between nodes (NIXL over NVLink or InfiniBand). The overhead pays off when:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Condition&lt;/th>
&lt;th>Effect of disaggregated serving&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Mean ISL &amp;gt; 1,024 tokens&lt;/td>
&lt;td>Prefill dominates; separate pools stop it blocking decode&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Prefill/decode ratio &amp;gt; 3:1 in time&lt;/td>
&lt;td>The decode pool sits idle waiting for prefill&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Mixed traffic (prefill burst + decode queue)&lt;/td>
&lt;td>Independent scaling of each pool by SLA&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&amp;lt; 512 tokens ISL, unique prompts&lt;/td>
&lt;td>Transfer overhead exceeds the benefit; an aggregated engine is enough&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>Dynamo quantifies the break-even point: disaggregated serving pays off when the
transfer time for KV tensors (a function of ISL and NVLink/IB bandwidth) is
lower than the time the decode worker would spend waiting for the prefill worker in aggregated mode. On
4×H100 with an ISL of 512 tok, break-even occurs at a prefill/decode ratio &amp;gt; 2.5:1. The
article on &lt;a href="https://blog.lo0.es/en/posts/disaggregated-serving-prefill-decode-specialised-pods/">disaggregated serving&lt;/a> develops
the full formula.&lt;/p>
&lt;hr>
&lt;h2 id="mlperf-inference-v51-cross-vendor-reference-figures">MLPerf Inference v5.1: cross-vendor reference figures&lt;/h2>
&lt;p>MLPerf Inference v5.1 (September 2025) is the standard for cross-vendor comparability.
Server scenario (Llama-3.1-70B, tokens/s):&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Submitter&lt;/th>
&lt;th>Hardware&lt;/th>
&lt;th>Scenario&lt;/th>
&lt;th>Throughput (tok/s)&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Red Hat (vLLM)&lt;/td>
&lt;td>1×H100 80 GB&lt;/td>
&lt;td>Server&lt;/td>
&lt;td>5,103&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Red Hat (vLLM)&lt;/td>
&lt;td>1×L40S&lt;/td>
&lt;td>Server&lt;/td>
&lt;td>1,207&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>NVIDIA (TRT-LLM)&lt;/td>
&lt;td>8×H100 SXM&lt;/td>
&lt;td>Server&lt;/td>
&lt;td>~52,000 (estimated)&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>The MLPerf figures are not directly comparable with the internal benchmarks above
(a different harness, MLPerf&amp;rsquo;s Server scenario with a Poisson distribution and fixed SLOs). They are
useful for comparing vendors under the same rules; not for sizing a specific case.
For that, run your own sweep with AIPerf/GuideLLM against the target endpoint.&lt;/p>
&lt;hr>
&lt;h2 id="variables-the-benchmark-does-not-capture">Variables the benchmark does not capture&lt;/h2>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Omitted variable&lt;/th>
&lt;th>Effect in production&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Network latency (gateway, load balancer)&lt;/td>
&lt;td>Can add 20–100 ms to the TTFT measured on the server&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Engine compilation time (TRT-LLM)&lt;/td>
&lt;td>Hours per model×precision×hardware; penalises cold starts and CI&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Weight loading time on the GPU&lt;/td>
&lt;td>Relevant in autoscaling; ModelExpress (Dynamo) cuts it 7×&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Operational cost of the system (Dynamo vs a simple engine)&lt;/td>
&lt;td>Dynamo requires etcd/NATS, a Rust runtime, a more specialised team&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Response quality&lt;/td>
&lt;td>Performance does not imply quality; measure with lm-evaluation-harness (article B7)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Energy (J/token)&lt;/td>
&lt;td>Does not come out of a throughput benchmark; requires DCGM running alongside&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;hr>
&lt;h2 id="sources">Sources&lt;/h2>
&lt;ul>
&lt;li>vLLM · documentación oficial — &lt;a href="https://docs.vllm.ai/en/latest/">https://docs.vllm.ai/en/latest/&lt;/a>&lt;/li>
&lt;li>vLLM · blog de rendimiento (v0.6.0, 2,7× throughput) — &lt;a href="https://blog.vllm.ai/2024/09/05/perf-update.html">https://blog.vllm.ai/2024/09/05/perf-update.html&lt;/a>&lt;/li>
&lt;li>vLLM · disaggregated prefill (experimental) — &lt;a href="https://docs.vllm.ai/en/latest/features/disagg_prefill/">https://docs.vllm.ai/en/latest/features/disagg_prefill/&lt;/a>&lt;/li>
&lt;li>SGLang · documentación oficial — &lt;a href="https://docs.sglang.io/">https://docs.sglang.io/&lt;/a>&lt;/li>
&lt;li>SGLang · paper RadixAttention (LMSYS, 2024) — &lt;a href="https://arxiv.org/pdf/2312.07104">https://arxiv.org/pdf/2312.07104&lt;/a>&lt;/li>
&lt;li>SGLang · blog LMSYS sobre Llama-3 serving — &lt;a href="https://www.lmsys.org/blog/2024-07-25-sglang-llama3/">https://www.lmsys.org/blog/2024-07-25-sglang-llama3/&lt;/a>&lt;/li>
&lt;li>NVIDIA TensorRT-LLM · GitHub — &lt;a href="https://github.com/NVIDIA/TensorRT-LLM">https://github.com/NVIDIA/TensorRT-LLM&lt;/a>&lt;/li>
&lt;li>NVIDIA TensorRT-LLM · overview y release notes — &lt;a href="https://nvidia.github.io/TensorRT-LLM/overview.html">https://nvidia.github.io/TensorRT-LLM/overview.html&lt;/a>&lt;/li>
&lt;li>NVIDIA TensorRT-LLM · quantización — &lt;a href="https://nvidia.github.io/TensorRT-LLM/features/quantization.html">https://nvidia.github.io/TensorRT-LLM/features/quantization.html&lt;/a>&lt;/li>
&lt;li>NVIDIA Dynamo · GitHub (ai-dynamo/dynamo) — &lt;a href="https://github.com/ai-dynamo/dynamo">https://github.com/ai-dynamo/dynamo&lt;/a>&lt;/li>
&lt;li>NVIDIA Dynamo · documentación oficial — &lt;a href="https://docs.nvidia.com/dynamo/latest">https://docs.nvidia.com/dynamo/latest&lt;/a>&lt;/li>
&lt;li>NVIDIA Dynamo · disaggregated serving — &lt;a href="https://docs.dynamo.nvidia.com/dynamo/design-docs/disaggregated-serving">https://docs.dynamo.nvidia.com/dynamo/design-docs/disaggregated-serving&lt;/a>&lt;/li>
&lt;li>Cerebrium · benchmark vLLM vs SGLang vs TRT-LLM (Llama 3.1-70B) — &lt;a href="https://cerebrium.ai/blog/benchmarking-vllm-sglang-tensorrt-for-llama-3-1-api">https://cerebrium.ai/blog/benchmarking-vllm-sglang-tensorrt-for-llama-3-1-api&lt;/a>&lt;/li>
&lt;li>Spheron · vLLM vs TRT-LLM vs SGLang H100 benchmarks 2026 — &lt;a href="https://www.spheron.network/blog/vllm-vs-tensorrt-llm-vs-sglang-benchmarks/">https://www.spheron.network/blog/vllm-vs-tensorrt-llm-vs-sglang-benchmarks/&lt;/a>&lt;/li>
&lt;li>MLCommons · MLPerf Inference v5.1 results — &lt;a href="https://mlcommons.org/2025/09/mlperf-inference-v5-1-results/">https://mlcommons.org/2025/09/mlperf-inference-v5-1-results/&lt;/a>&lt;/li>
&lt;li>Red Hat · MLPerf Inference v5.1 con vLLM — &lt;a href="https://www.redhat.com/en/blog/efficient-and-reproducible-llm-inference-red-hat-mlperf-inference-v51-results">https://www.redhat.com/en/blog/efficient-and-reproducible-llm-inference-red-hat-mlperf-inference-v51-results&lt;/a>&lt;/li>
&lt;li>arXiv 2605.24217 · sesgo sistemático en benchmarks de inferencia LLM — &lt;a href="https://arxiv.org/html/2605.24217">https://arxiv.org/html/2605.24217&lt;/a>&lt;/li>
&lt;li>IETF Draft · LLM Benchmarking Methodology (enero 2026) — &lt;a href="https://www.ietf.org/archive/id/draft-gaikwad-llm-benchmarking-methodology-00.html">https://www.ietf.org/archive/id/draft-gaikwad-llm-benchmarking-methodology-00.html&lt;/a>&lt;/li>
&lt;/ul></description></item><item><title>LLM benchmark tool catalogue: the practical deep dive</title><link>https://blog.lo0.es/en/posts/llm-benchmark-tool-catalogue-practical-deep-dive/</link><pubDate>Sun, 14 Jun 2026 02:00:00 +0200</pubDate><guid>https://blog.lo0.es/en/posts/llm-benchmark-tool-catalogue-practical-deep-dive/</guid><description>&lt;blockquote>
&lt;p>Notation: amounts in &lt;strong>euros (N €)&lt;/strong>, decimals with a point. The dollar symbol is not used
(on this site it is a formula delimiter).&lt;/p>
&lt;/blockquote>
&lt;h2 id="what-this-article-covers">What this article covers&lt;/h2>
&lt;p>Second article in the &lt;strong>benchmarking&lt;/strong> track (B2). The &lt;a href="https://blog.lo0.es/en/posts/llm-inference-benchmarking-frameworks-metrics-state-of-the-art/">B1 introduction&lt;/a>
pinned the metrics and the methodology; this article is the &lt;strong>practical manual&lt;/strong>: for each
tool, what it measures, how it is actually invoked (with the command), what output format
it produces and when to choose it. The goal is that, after reading it, you know what to run to
measure your engine and you can reproduce the number. No universal recommendations; only the
mechanics of each tool and the criterion for choosing.&lt;/p>
&lt;hr>
&lt;h2 id="how-to-choose-the-tool-map">How to choose: the tool map&lt;/h2>
&lt;p>Recalling the split from B1, the tools are ordered on two axes: &lt;strong>micro-bench&lt;/strong>
(single-process, for tuning an engine) versus &lt;strong>load generator&lt;/strong> (multi-process, for measuring
real capacity), and &lt;strong>engine-native&lt;/strong> versus &lt;strong>endpoint-agnostic&lt;/strong>.&lt;/p>
&lt;div class="diagram" style="max-width:780px;margin:1rem auto;">
&lt;svg viewBox="0 0 780 250" role="img" aria-label="Map of benchmark tools on two axes: single-process micro-bench versus multi-process load generator, and engine-native versus endpoint-agnostic" xmlns="http://www.w3.org/2000/svg">
&lt;style>.ax{fill:none;stroke:currentColor;stroke-width:1}.bx{fill:none;stroke:currentColor;stroke-width:1.2}.tl{font:600 12px sans-serif;fill:currentColor}.ts{font:11px sans-serif;fill:currentColor}&lt;/style>
&lt;line class="ax" x1="60" y1="200" x2="720" y2="200"/>
&lt;line class="ax" x1="390" y1="40" x2="390" y2="200"/>
&lt;text x="70" y="216" class="ts">micro-bench (single-process)&lt;/text>
&lt;text x="560" y="216" class="ts">load generator (multi-process)&lt;/text>
&lt;text x="400" y="52" class="ts">↑ endpoint-agnostic&lt;/text>
&lt;text x="400" y="195" class="ts">↓ engine-native&lt;/text>
&lt;rect class="bx" x="150" y="150" width="150" height="34" rx="5"/>&lt;text x="225" y="171" text-anchor="middle" class="ts">vLLM bench / SGLang bench&lt;/text>
&lt;rect class="bx" x="470" y="70" width="120" height="34" rx="5"/>&lt;text x="530" y="91" text-anchor="middle" class="ts">AIPerf&lt;/text>
&lt;rect class="bx" x="470" y="115" width="120" height="34" rx="5"/>&lt;text x="530" y="136" text-anchor="middle" class="ts">GuideLLM&lt;/text>
&lt;rect class="bx" x="610" y="93" width="110" height="34" rx="5"/>&lt;text x="665" y="114" text-anchor="middle" class="ts">LLMPerf&lt;/text>
&lt;rect class="bx" x="150" y="60" width="150" height="34" rx="5"/>&lt;text x="225" y="81" text-anchor="middle" class="ts">MLPerf (standard suite)&lt;/text>
&lt;text x="60" y="240" class="ts">To tune a specific engine: micro-bench. To measure capacity under SLO: load generator. To compare vendors: MLPerf.&lt;/text>
&lt;/svg>
&lt;/div>
&lt;hr>
&lt;h2 id="datasets-the-synthetic-load-matters-as-much-as-the-tool">Datasets: the synthetic load matters as much as the tool&lt;/h2>
&lt;p>Before the profiles, one point that changes results without anyone noticing: &lt;strong>what load you
feed it&lt;/strong>. The tools accept different kinds of dataset, and each one measures something
different:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Dataset&lt;/th>
&lt;th>What it simulates&lt;/th>
&lt;th>Bias it introduces&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;strong>random&lt;/strong> (fixed lengths)&lt;/td>
&lt;td>controlled uniform load&lt;/td>
&lt;td>unrealistic: traffic is not fixed length&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>sharegpt&lt;/strong> (real conversations)&lt;/td>
&lt;td>realistic prompt distribution&lt;/td>
&lt;td>the de facto standard for comparison&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>your own traces&lt;/strong>&lt;/td>
&lt;td>your real traffic&lt;/td>
&lt;td>the most faithful, but specific to your case&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>The trap: a benchmark with short, fixed-length prompts gives a very high throughput that
looks nothing like production, where lengths vary and long prompts dominate the prefill
cost. For a defensible figure, use &lt;strong>sharegpt&lt;/strong> (comparability) or, better, &lt;strong>traces from your
own traffic&lt;/strong> (fidelity). And always declare the length distribution (prompt/output) alongside
the number, because two benchmarks with different datasets are not comparable even if they
use the same tool.&lt;/p>
&lt;hr>
&lt;h2 id="vllm-bench-serve">vLLM bench serve&lt;/h2>
&lt;p>What it measures: TTFT, TPOT, throughput and latencies of the vLLM server under a
synthetic load. Class: micro-bench (single-process). It is the tool for &lt;strong>tuning vLLM&lt;/strong> and
seeing the effect of its optimisations (&lt;a href="https://blog.lo0.es/en/posts/optimising-decode-vllm-squeezing-every-token-small-hardware/">decode&lt;/a>,
&lt;a href="https://blog.lo0.es/en/posts/optimising-prefill-vllm-knobs-ttft-will-not-forgive/">prefill&lt;/a>).&lt;/p>
&lt;p>Typical invocation (&lt;a href="https://docs.vllm.ai/en/latest/cli/bench/serve/">vLLM · benchmark CLI&lt;/a>):&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">vllm bench serve &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --backend vllm &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --model meta-llama/Llama-3.1-8B-Instruct &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --endpoint /v1/completions &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --dataset-name sharegpt &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --dataset-path ShareGPT_V3_unfiltered_cleaned_split.json &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --num-prompts &lt;span class="m">1000&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Key parameters: &lt;code>--num-prompts&lt;/code> (load), &lt;code>--dataset-name&lt;/code> (sharegpt, random, etc.),
&lt;code>--request-rate&lt;/code> (requests/s). The output is a console summary with TTFT, TPOT, throughput
and percentiles, and it can be dumped to JSON. To sweep concurrencies there is &lt;strong>&lt;code>vllm bench sweep serve&lt;/code>&lt;/strong>, which automates the sweep (&lt;a href="https://docs.vllm.ai/en/latest/cli/bench/sweep/serve/">vLLM · sweep&lt;/a>).&lt;/p>
&lt;p>Limit: single-process, it saturates on the client at high concurrency; less flexible than
GuideLLM in datasets and load patterns. Use it to iterate quickly on the vLLM config, not to
measure maximum capacity at scale.&lt;/p>
&lt;hr>
&lt;h2 id="sglang-bench">SGLang bench&lt;/h2>
&lt;p>What it measures: the equivalent for the &lt;strong>SGLang&lt;/strong> engine (TTFT, TPOT, throughput). Class:
micro-bench. Use: tuning SGLang and comparing it against itself across configurations. The
mechanics are analogous to &lt;code>vllm bench serve&lt;/code>: a synthetic load, console/JSON output with the
same metrics. If you are evaluating SGLang against vLLM, do not compare them with their
respective micro-benches (same class but different implementations): use an endpoint-agnostic
load generator (GuideLLM/AIPerf) against both endpoints, so that the tool is not the variable.&lt;/p>
&lt;hr>
&lt;h2 id="aiperf-nvidia-formerly-genai-perf">AIPerf (NVIDIA, formerly genai-perf)&lt;/h2>
&lt;p>What it measures: TTFT, ITL, throughput and latency against any compatible endpoint (vLLM,
NIM, TGI, SGLang). Class: &lt;strong>multi-process&lt;/strong> load generator. It is the successor to genai-perf
(retired on 15 Apr 2026). Its distinguishing feature: during the sweep it &lt;strong>detects GPU
saturation&lt;/strong> and returns the previous iteration as &lt;code>estimatedCapacity&lt;/code>, which is why the sweep
has to extend beyond the knee
(&lt;a href="https://lucaberton.com/blog/nvidia-aiperf-llm-inference-benchmarking-guide/">AIPerf&lt;/a>).&lt;/p>
&lt;p>Output: structured metrics (JSON) with TTFT/ITL distributions and the &lt;code>estimatedCapacity&lt;/code>. Use
it when you want the real capacity of an endpoint, whatever the engine, with automatic
detection of the saturation point.&lt;/p>
&lt;hr>
&lt;h2 id="guidellm-vllm-project">GuideLLM (vLLM project)&lt;/h2>
&lt;p>What it measures: full distributions of TTFT, ITL and end-to-end behaviour, for &lt;strong>SLO-driven&lt;/strong>
evaluation. Class: multi-process load generator. It is the recommended tool for benchmarking
vLLM servers in production: more flexible than &lt;code>vllm bench serve&lt;/code> in dataset loading, request
format and traffic patterns, with live progress and automatic report generation
(&lt;a href="https://developers.redhat.com/articles/2025/12/24/how-deploy-and-benchmark-vllm-guidellm-kubernetes">Red Hat&lt;/a>).&lt;/p>
&lt;p>Typical invocation:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">guidellm benchmark &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --target &lt;span class="s2">&amp;#34;http://localhost:8000&amp;#34;&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --rate-type throughput &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --max-requests &lt;span class="m">1000&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --data &lt;span class="s2">&amp;#34;samples=1000,prompt_tokens=1024,output_tokens=256&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Key parameters: &lt;code>--rate-type&lt;/code> (&lt;code>synchronous&lt;/code>, &lt;code>concurrent&lt;/code>, &lt;code>throughput&lt;/code>, or rate-based),
&lt;code>--data&lt;/code> (the load specification: number of samples and prompt/output lengths), &lt;code>--target&lt;/code>
(the endpoint). It generates reproducible sweeps to find the safe operating range under
SLO, with full distributions (not just means). Output: a report with percentiles and, often,
exportable to JSON/HTML. It is the default option for answering &amp;ldquo;how hard can I load this
engine without breaking the SLO?&amp;rdquo;.&lt;/p>
&lt;hr>
&lt;h2 id="llmperf-anyscaleray">LLMPerf (Anyscale/Ray)&lt;/h2>
&lt;p>What it measures: throughput and latency at the inference level. Class: load generator. Use:
endpoint validation, historically very widespread in the Ray/Anyscale ecosystem. It is a solid
and well-known option, though less focused on distributions and sweeps than GuideLLM/AIPerf.
It fits if you already operate on Ray or want a simple tool to validate an endpoint.&lt;/p>
&lt;hr>
&lt;h2 id="inference-benchmarker-hugging-face">inference-benchmarker (Hugging Face)&lt;/h2>
&lt;p>What it measures: latency and throughput of inference endpoints, aimed at producing comparable
reports. Class: load generator. Use: an OSS alternative inside the Hugging Face ecosystem,
useful if you already work with TGI or the HF stack. Like the others in its class, its value
lies in measuring real capacity with distributed load; the choice between this one, GuideLLM
and AIPerf usually comes down to the ecosystem you already operate in rather than to deep
differences in what they measure.&lt;/p>
&lt;hr>
&lt;h2 id="guidellm-versus-aiperf-which-of-the-two-load-generators">GuideLLM versus AIPerf: which of the two load generators&lt;/h2>
&lt;p>They are the two serious multi-process load options, and they overlap a great deal. The
practical differences that tip the choice:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Criterion&lt;/th>
&lt;th>GuideLLM&lt;/th>
&lt;th>AIPerf&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Origin&lt;/td>
&lt;td>vLLM project (Red Hat)&lt;/td>
&lt;td>NVIDIA (successor to genai-perf)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Focus&lt;/td>
&lt;td>&lt;strong>SLO&lt;/strong>-driven evaluation, reproducible sweeps&lt;/td>
&lt;td>real capacity, automatic &lt;strong>estimatedCapacity&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Load patterns&lt;/td>
&lt;td>synchronous, concurrent, rate-based&lt;/td>
&lt;td>sweep with saturation detection&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Report&lt;/td>
&lt;td>live progress + automatic report&lt;/td>
&lt;td>structured metrics (JSON)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Ecosystem&lt;/td>
&lt;td>vLLM / OpenShift AI&lt;/td>
&lt;td>NVIDIA NIM / Triton / vLLM&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>In practice: if your question is &amp;ldquo;how hard can I load it without breaking the SLO?&amp;rdquo;,
&lt;strong>GuideLLM&lt;/strong> answers it more directly with its SLO-driven sweeps; if your question is &amp;ldquo;what is
the maximum capacity of this endpoint?&amp;rdquo;, &lt;strong>AIPerf&lt;/strong> gives it with its automatic knee
detection. Many teams use both: GuideLLM for the operational SLO, AIPerf for the reference
capacity. What you must not do is compare a GuideLLM result with an AIPerf one as if they
were the same measurement: although both are multi-process, their sweep methodology differs;
pick one for a given comparison and stick to it.&lt;/p>
&lt;hr>
&lt;h2 id="mlperf-inference-mlcommons">MLPerf Inference (MLCommons)&lt;/h2>
&lt;p>What it measures: performance under standardised scenarios (Offline, Server, Interactive)
with strict rules. Unlike the previous ones, MLPerf is not &amp;ldquo;run&amp;rdquo; for your day-to-day case:
it is a vendor comparison suite whose results are read (published by NVIDIA, AMD, Intel and
others). Use it to compare hardware and engines against each other under identical rules, not
to size your specific workload. For that, GuideLLM/AIPerf against your endpoint.&lt;/p>
&lt;hr>
&lt;h2 id="practical-comparison-table">Practical comparison table&lt;/h2>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Tool&lt;/th>
&lt;th>Class&lt;/th>
&lt;th>Base command&lt;/th>
&lt;th>Output&lt;/th>
&lt;th>When&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;strong>vllm bench serve&lt;/strong>&lt;/td>
&lt;td>micro&lt;/td>
&lt;td>&lt;code>vllm bench serve&lt;/code>&lt;/td>
&lt;td>console/JSON&lt;/td>
&lt;td>tune vLLM&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>vllm bench sweep&lt;/strong>&lt;/td>
&lt;td>micro (sweep)&lt;/td>
&lt;td>&lt;code>vllm bench sweep serve&lt;/code>&lt;/td>
&lt;td>console/JSON&lt;/td>
&lt;td>sweep concurrency in vLLM&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>SGLang bench&lt;/strong>&lt;/td>
&lt;td>micro&lt;/td>
&lt;td>bench from the SGLang repo&lt;/td>
&lt;td>console/JSON&lt;/td>
&lt;td>tune SGLang&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>AIPerf&lt;/strong>&lt;/td>
&lt;td>load&lt;/td>
&lt;td>&lt;code>aiperf profile …&lt;/code>&lt;/td>
&lt;td>JSON + estimatedCapacity&lt;/td>
&lt;td>real capacity, multi-endpoint&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>GuideLLM&lt;/strong>&lt;/td>
&lt;td>load&lt;/td>
&lt;td>&lt;code>guidellm benchmark …&lt;/code>&lt;/td>
&lt;td>report + JSON/HTML&lt;/td>
&lt;td>SLO, reproducible sweep&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>LLMPerf&lt;/strong>&lt;/td>
&lt;td>load&lt;/td>
&lt;td>Ray/LLMPerf script&lt;/td>
&lt;td>JSON&lt;/td>
&lt;td>validate endpoint (Ray)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>MLPerf&lt;/strong>&lt;/td>
&lt;td>suite&lt;/td>
&lt;td>(results are read)&lt;/td>
&lt;td>official results&lt;/td>
&lt;td>compare vendors&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;hr>
&lt;h2 id="summary-what-you-run-for-each-question">Summary: what you run for each question&lt;/h2>
&lt;p>So as not to get lost in the catalogue, the direct mapping from question to tool:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Your question&lt;/th>
&lt;th>Tool&lt;/th>
&lt;th>Why&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&amp;ldquo;Does my vLLM config change help?&amp;rdquo;&lt;/td>
&lt;td>&lt;code>vllm bench serve&lt;/code> (+ sweep)&lt;/td>
&lt;td>fast, engine-native&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&amp;ldquo;How hard can I load without breaking the SLO?&amp;rdquo;&lt;/td>
&lt;td>GuideLLM&lt;/td>
&lt;td>SLO-driven sweeps&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&amp;ldquo;What is the maximum capacity of the endpoint?&amp;rdquo;&lt;/td>
&lt;td>AIPerf&lt;/td>
&lt;td>automatic knee detection&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&amp;ldquo;vLLM or SGLang for my workload?&amp;rdquo;&lt;/td>
&lt;td>GuideLLM/AIPerf against both&lt;/td>
&lt;td>same tool, engine as the variable&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&amp;ldquo;Which hardware/engine is better in the abstract?&amp;rdquo;&lt;/td>
&lt;td>read MLPerf&lt;/td>
&lt;td>cross-vendor comparability&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&amp;ldquo;Is there a regression in this release?&amp;rdquo;&lt;/td>
&lt;td>short sweep in CI against a baseline&lt;/td>
&lt;td>continuous detection&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>The rule underlying the whole table: &lt;strong>micro-bench to iterate on an engine, load generator to
measure capacity and decide, MLPerf to compare vendors&lt;/strong>. And, for any comparison between
systems, the same tool for every candidate. If these three categories are clear to you, the
specific choice is secondary.&lt;/p>
&lt;hr>
&lt;h2 id="step-by-step-benchmark-methodology">Step-by-step benchmark methodology&lt;/h2>
&lt;p>A reliable run is not &amp;ldquo;launching the command&amp;rdquo;: it is a procedure. The steps, with the load
tool (GuideLLM/AIPerf) against your endpoint:&lt;/p>
&lt;div class="diagram" style="max-width:780px;margin:1rem auto;">
&lt;svg viewBox="0 0 780 170" role="img" aria-label="Benchmark flow: deploy the engine, warm up, sweep concurrency, collect metrics and compare" xmlns="http://www.w3.org/2000/svg">
&lt;style>.bx{fill:none;stroke:currentColor;stroke-width:1.3}.tl{font:600 12px sans-serif;fill:currentColor}.ts{font:11px sans-serif;fill:currentColor}.ar{fill:none;stroke:currentColor;stroke-width:1.3;marker-end:url(#wm)}&lt;/style>
&lt;defs>&lt;marker id="wm" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="currentColor"/>&lt;/marker>&lt;/defs>
&lt;rect class="bx" x="20" y="50" width="120" height="44" rx="6"/>&lt;text x="80" y="69" text-anchor="middle" class="tl">1 · Deploy&lt;/text>&lt;text x="80" y="85" text-anchor="middle" class="ts">engine + config&lt;/text>
&lt;path class="ar" d="M140,72 L165,72"/>
&lt;rect class="bx" x="165" y="50" width="120" height="44" rx="6"/>&lt;text x="225" y="69" text-anchor="middle" class="tl">2 · Warm up&lt;/text>&lt;text x="225" y="85" text-anchor="middle" class="ts">discard warm-up&lt;/text>
&lt;path class="ar" d="M285,72 L310,72"/>
&lt;rect class="bx" x="310" y="50" width="120" height="44" rx="6"/>&lt;text x="370" y="69" text-anchor="middle" class="tl">3 · Sweep&lt;/text>&lt;text x="370" y="85" text-anchor="middle" class="ts">go past the knee&lt;/text>
&lt;path class="ar" d="M430,72 L455,72"/>
&lt;rect class="bx" x="455" y="50" width="120" height="44" rx="6"/>&lt;text x="515" y="69" text-anchor="middle" class="tl">4 · Collect&lt;/text>&lt;text x="515" y="85" text-anchor="middle" class="ts">JSON with percentiles&lt;/text>
&lt;path class="ar" d="M575,72 L600,72"/>
&lt;rect class="bx" x="600" y="50" width="120" height="44" rx="6"/>&lt;text x="660" y="69" text-anchor="middle" class="tl">5 · Compare&lt;/text>&lt;text x="660" y="85" text-anchor="middle" class="ts">goodput vs SLO&lt;/text>
&lt;text x="20" y="130" class="ts">Pin model, precision, hardware, dataset and SLO before step 1; record them in the output of step 4.&lt;/text>
&lt;/svg>
&lt;/div>
&lt;ol>
&lt;li>&lt;strong>Deploy&lt;/strong> the engine with the exact config to be measured (model, precision, flags),
pinned.&lt;/li>
&lt;li>&lt;strong>Warm up&lt;/strong>: send a few requests and discard them, so that the prefix cache and the
autotuning do not inflate the first numbers.&lt;/li>
&lt;li>&lt;strong>Sweep&lt;/strong>: sweep rising concurrencies (1, 8, 16, 24, 32…) beyond the knee, to see where
latency takes off.&lt;/li>
&lt;li>&lt;strong>Collect&lt;/strong> the output in JSON with percentiles (TTFT/ITL/throughput/goodput) and the
metadata.&lt;/li>
&lt;li>&lt;strong>Compare&lt;/strong>: read the goodput under the SLO, not the maximum throughput.&lt;/li>
&lt;/ol>
&lt;p>Skipping step 2 (warm-up) or not going past the knee in step 3 are the two mistakes that bias
the result the most.&lt;/p>
&lt;hr>
&lt;h2 id="comparing-two-engines-the-fair-protocol">Comparing two engines: the fair protocol&lt;/h2>
&lt;p>If the goal is to choose between vLLM and SGLang (or TRT-LLM), the protocol that avoids false
conclusions:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Same load tool&lt;/strong> (GuideLLM or AIPerf) against both endpoints, never each engine&amp;rsquo;s own
micro-bench.&lt;/li>
&lt;li>&lt;strong>Same dataset and length distribution.&lt;/strong>&lt;/li>
&lt;li>&lt;strong>Same hardware and precision.&lt;/strong>&lt;/li>
&lt;li>&lt;strong>Same SLO&lt;/strong> to compute the goodput of both.&lt;/li>
&lt;li>Vary only the engine; everything else fixed.&lt;/li>
&lt;/ul>
&lt;p>Only then is the difference you measure down to the engine and not to the tool, the dataset or
the hardware. It is the controlled experiment that supports the scorecard row (article B8).&lt;/p>
&lt;hr>
&lt;h2 id="output-format-and-comparability">Output format and comparability&lt;/h2>
&lt;p>What you record alongside the number is what makes it comparable. A useful output includes,
in JSON so it can be versioned:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-json" data-lang="json">&lt;span class="line">&lt;span class="cl">&lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;tool&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;guidellm&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nt">&amp;#34;version&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;x.y.z&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;model&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;Llama-3.1-70B&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nt">&amp;#34;precision&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;FP16&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;hardware&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;8xH100 SXM NVLink&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;load&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="p">{&lt;/span>&lt;span class="nt">&amp;#34;prompt_tokens&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mi">1024&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nt">&amp;#34;output_tokens&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mi">256&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nt">&amp;#34;concurrency&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mi">16&lt;/span>&lt;span class="p">},&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;results&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="p">{&lt;/span>&lt;span class="nt">&amp;#34;ttft_p50_ms&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mi">180&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nt">&amp;#34;ttft_p99_ms&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mi">460&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;itl_p50_ms&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mi">22&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nt">&amp;#34;throughput_tok_s&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mi">3400&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nt">&amp;#34;goodput_tok_s&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mi">3330&lt;/span>&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Saving this for every run turns a benchmark into an auditable datum: anyone can reproduce the
figure with the same tool, version, model, hardware and load. It is the material of the
reproducible harness (article S4), and the difference between a defensible number and a
console screenshot.&lt;/p>
&lt;hr>
&lt;h2 id="worked-example-reading-the-output-of-a-sweep">Worked example: reading the output of a sweep&lt;/h2>
&lt;p>An illustrative output from a GuideLLM sweep on a 70B on 8×H100 (SLO: P99 TTFT &amp;lt; 500 ms), just
as you would read it:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Concurrency&lt;/th>
&lt;th>TTFT P99 (ms)&lt;/th>
&lt;th>ITL P50 (ms)&lt;/th>
&lt;th>Throughput (tok/s)&lt;/th>
&lt;th>Goodput (tok/s)&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>8&lt;/td>
&lt;td>240&lt;/td>
&lt;td>20&lt;/td>
&lt;td>2,100&lt;/td>
&lt;td>2,100&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>16&lt;/td>
&lt;td>460&lt;/td>
&lt;td>22&lt;/td>
&lt;td>3,400&lt;/td>
&lt;td>3,330&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>24&lt;/td>
&lt;td>980&lt;/td>
&lt;td>31&lt;/td>
&lt;td>3,900&lt;/td>
&lt;td>2,420&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>32&lt;/td>
&lt;td>1,800&lt;/td>
&lt;td>54&lt;/td>
&lt;td>4,000&lt;/td>
&lt;td>800&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>How to read it: the &lt;strong>knee&lt;/strong> sits between 16 and 24. At concurrency 16, P99 (460 ms) meets the
SLO and goodput (3,330 tok/s) ≈ throughput. At 24, throughput rises little (3,400 → 3,900) but
P99 already violates the SLO and goodput falls to 2,420. At 32, throughput is at its
maximum (4,000) but goodput collapses to 800: the system &amp;ldquo;performs well&amp;rdquo; while serving requests
that do not comply. The defensible capacity is the one at concurrency 16 (3,330 useful
tok/s), and that is the number that goes into &lt;a href="https://blog.lo0.es/en/posts/capacity-planning-on-premise-llm-inference/">capacity planning&lt;/a>
and into cost per token. Anyone reporting &amp;ldquo;4,000 tok/s&amp;rdquo; is describing the point where the
system no longer meets its SLO.&lt;/p>
&lt;hr>
&lt;h2 id="automating-the-harness">Automating the harness&lt;/h2>
&lt;p>A manual run does not scale to a benchmarking programme. The minimum automation:&lt;/p>
&lt;ul>
&lt;li>An &lt;strong>idempotent script&lt;/strong> that deploys the engine, warms it up, runs the sweep and saves the
JSON with all the metadata (model, version, hardware, dataset, SLO).&lt;/li>
&lt;li>&lt;strong>Naming by date and config&lt;/strong>, to version the runs and compare over time.&lt;/li>
&lt;li>A &lt;strong>results store&lt;/strong> (a git repo of JSONs, or a bucket) so that anyone can reproduce and
compare.&lt;/li>
&lt;/ul>
&lt;p>The goal is that reproducing a number is one command, not an afternoon. It is the basis of the
harness in article S4, and what turns benchmarking from a one-off activity into a continuous
platform capability.&lt;/p>
&lt;hr>
&lt;h2 id="ci-integration-continuous-benchmarking">CI integration: continuous benchmarking&lt;/h2>
&lt;p>The next level is measuring on every change: a CI job that, when the engine or the config
is updated, launches a short sweep against a test environment and &lt;strong>compares against the
baseline&lt;/strong>. If goodput falls by more than a threshold, the pipeline fails. That way a
performance regression is caught at the commit, not in production. Watch out for two things:
benchmarking in CI consumes GPU-hours (budget for it) and it needs a stable environment (same
hardware) for the comparison to be valid. You do not need the full sweep on every commit: a
short sweep covering the knee is enough to detect regressions; the exhaustive sweep is for
releases.&lt;/p>
&lt;hr>
&lt;h2 id="the-cost-of-measuring-in-euros">The cost of measuring (in euros)&lt;/h2>
&lt;p>Benchmarking consumes GPU-hours, and that has a cost worth budgeting for. A serious sweep
on an 8×H100 node can occupy the cards for a couple of hours; at an amortised cost of ~11 €/h,
that is ~22 € per full sweep, more if you sweep several models and precisions. It is not much
per run, but a continuous benchmarking programme (every release, every config change) adds up.
The practical rule: automate the harness so that each run is cheap and reproducible, and
measure what you are going to use to decide, not for the sake of exhaustiveness. The cost of
measuring is part of the cost of the platform, small next to the cost of serving but real.&lt;/p>
&lt;hr>
&lt;h2 id="observing-during-the-benchmark-one-run-three-axes">Observing during the benchmark: one run, three axes&lt;/h2>
&lt;p>A trick that saves work and connects the series: &lt;strong>while the sweep runs, capture the GPU
metrics too&lt;/strong>. With DCGM exporting to Prometheus during the run, you record at the same time:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Axis&lt;/th>
&lt;th>Source during the sweep&lt;/th>
&lt;th>Metric&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Performance&lt;/td>
&lt;td>the tool (GuideLLM/AIPerf)&lt;/td>
&lt;td>TTFT, ITL, throughput, goodput&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Energy&lt;/td>
&lt;td>DCGM&lt;/td>
&lt;td>power (W) → J/token&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Cost&lt;/td>
&lt;td>node price (OpenCost)&lt;/td>
&lt;td>€/hour → CPM per point&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>That way, from a single run you get the three numbers for the same operating point: at
concurrency 16, the goodput (3,330 tok/s), the average power (from DCGM, which divided by the
throughput gives J/token) and the cost per token (with the node price). Instead of three
separate campaigns, you measure the three axes at once, and they end up &lt;strong>coherent by
construction&lt;/strong> because they correspond to the same instant and the same load. It is what the
harness in article S4 does, and the reason to export DCGM during the benchmark even if you are
only after performance: energy and cost come almost free if you capture them in the same
window.&lt;/p>
&lt;p>The methodological warning: align the time windows. The DCGM power figures and the tool&amp;rsquo;s
metrics have to cover exactly the same interval (no warm-up, no shutdown), or the J/token does
not correspond to the throughput measured. Same window, same three numbers.&lt;/p>
&lt;hr>
&lt;h2 id="the-benchmark-is-also-finops-and-energy">The benchmark is also FinOps and energy&lt;/h2>
&lt;p>An idea that connects this article with the rest of the series: &lt;strong>measuring performance is, in
fact, measuring cost and energy&lt;/strong>. By the identity of the &lt;a href="https://blog.lo0.es/en/posts/cost-performance-energy-three-axes-llm-inference/">opening article&lt;/a>,
goodput is the denominator of cost per token and of energy per token. When a sweep reveals
that config A gives 3,330 tok/s of goodput and config B gives 4,000, you are not only measuring
speed: you are measuring that B costs fewer euros and fewer watts per token. That is why the
output JSON of a benchmark should be accompanied by the iron cost (from OpenCost) to compute
the real CPM of every point in the sweep: throughput × node price = cost per token.
Benchmarking is not an isolated axis; it is the tool that, indirectly, moves the cost and the
energy of the platform the most, and the one that fills the performance column of the scorecard
with numbers that translate directly into euros.&lt;/p>
&lt;p>The operational consequence: do not benchmark performance in a vacuum. Every run you save with
its throughput and its goodput should be crossable with the node cost (€/hour) and the energy
(J/token) to give the three faces of the same operating point. That is how the benchmarking
track feeds the FinOps and energy tracks instead of living apart.&lt;/p>
&lt;hr>
&lt;h2 id="state-of-the-art-2026-and-limits">State of the art 2026 and limits&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Migration to multi-process&lt;/strong>: AIPerf (formerly genai-perf) and GuideLLM consolidate the
measurement of real capacity; micro-benches are left for tuning engines.&lt;/li>
&lt;li>&lt;strong>GuideLLM as the OSS standard&lt;/strong> for SLO-driven evaluation with an automatic report.&lt;/li>
&lt;li>&lt;strong>Careful with comparing across classes&lt;/strong>: a micro-bench and a load generator are not
comparable; pin the class and the tool.&lt;/li>
&lt;li>&lt;strong>Version and dataset matter&lt;/strong>: the same command with a different dataset or version gives a
different number; pin them.&lt;/li>
&lt;li>&lt;strong>MLPerf does not size your case&lt;/strong>: it compares vendors, it does not replace a sweep against
your workload.&lt;/li>
&lt;/ul>
&lt;p>With the practical catalogue covered, the next article in the track (B3) goes into GuideLLM
and SLO validation under load in depth. The tool is the means; the reproducible datum is the
end.&lt;/p>
&lt;h2 id="mistakes-that-invalidate-a-benchmark">Mistakes that invalidate a benchmark&lt;/h2>
&lt;p>To finish, the list of what turns a run into rubbish, by frequency:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Mistake&lt;/th>
&lt;th>Effect&lt;/th>
&lt;th>Fix&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Comparing different classes&lt;/td>
&lt;td>up to 7× of spurious difference&lt;/td>
&lt;td>same tool for everyone&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Not discarding the warm-up&lt;/td>
&lt;td>artificially low TTFT&lt;/td>
&lt;td>warm up and discard&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Not going past the knee&lt;/td>
&lt;td>you do not know the safe capacity&lt;/td>
&lt;td>extend the sweep&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Unrealistic dataset (fixed length)&lt;/td>
&lt;td>throughput that does not apply&lt;/td>
&lt;td>sharegpt or your own traces&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Reporting the mean, not P99&lt;/td>
&lt;td>hides the tail&lt;/td>
&lt;td>percentiles always&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Tokenizer foreign to the model&lt;/td>
&lt;td>biased tok/s and cost per token&lt;/td>
&lt;td>count with the model&amp;rsquo;s own&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Not pinning version/config&lt;/td>
&lt;td>irreproducible&lt;/td>
&lt;td>save everything in the JSON&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>Any one of these is enough for the number not to be defensible. A benchmark is only as good as
its methodology: the tool matters less than running it properly and recording everything.&lt;/p>
&lt;h2 id="closing">Closing&lt;/h2>
&lt;p>The catalogue of benchmark tools boils down to a simple decision (micro-bench to tune an
engine, load generator to measure capacity, MLPerf to compare vendors) and to a discipline that
weighs more than the choice: &lt;strong>the method&lt;/strong>. The same &lt;code>guidellm benchmark&lt;/code> gives a golden datum
or a useless one depending on the dataset, the warm-up, how far the sweep goes and what you
record in the output. For a sovereign architecture proposal, performance only counts if it
comes with its command, its version, its load and its goodput under SLO, and, crossed with cost
in euros and energy per token, it becomes the scorecard column that decides which engine and
which configuration hold up the platform. You choose the tool in five minutes; the methodology
is what makes the number survive an audit.&lt;/p>
&lt;h2 id="see-also">See also&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/genai-perf-llm-inference-profiling-in-depth/">GenAI-Perf in depth&lt;/a> — an extended profile of the NVIDIA profiler: metrics (TTFT/TPOT/ISL/OSL), invocation against an OpenAI-compatible endpoint and comparison with GuideLLM/LLMPerf.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/llm-serving-engines-pareto-frontier-comparison/">LLM serving engines compared (vLLM/SGLang/TRT-LLM/Dynamo)&lt;/a> — once goodput has been measured with these tools, here is which engine wins at each point of the Pareto frontier.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/measurement-bias-reproducibility-llm-benchmarks/">Measurement bias and reproducibility&lt;/a> — the sources of bias that invalidate results even when the tool is correctly configured: warm-up, real versus synthetic dataset, shared environment.&lt;/li>
&lt;/ul>
&lt;h2 id="sources">Sources&lt;/h2>
&lt;ul>
&lt;li>vLLM · CLI de benchmark (&lt;code>bench serve&lt;/code>) — &lt;a href="https://docs.vllm.ai/en/latest/cli/bench/serve/">https://docs.vllm.ai/en/latest/cli/bench/serve/&lt;/a>&lt;/li>
&lt;li>vLLM · &lt;code>bench sweep serve&lt;/code> — &lt;a href="https://docs.vllm.ai/en/latest/cli/bench/sweep/serve/">https://docs.vllm.ai/en/latest/cli/bench/sweep/serve/&lt;/a>&lt;/li>
&lt;li>Red Hat · desplegar y benchmarkear vLLM con GuideLLM en Kubernetes — &lt;a href="https://developers.redhat.com/articles/2025/12/24/how-deploy-and-benchmark-vllm-guidellm-kubernetes">https://developers.redhat.com/articles/2025/12/24/how-deploy-and-benchmark-vllm-guidellm-kubernetes&lt;/a>&lt;/li>
&lt;li>GuideLLM · GitHub (proyecto vLLM) — &lt;a href="https://github.com/vllm-project/guidellm">https://github.com/vllm-project/guidellm&lt;/a>&lt;/li>
&lt;li>NVIDIA AIPerf · guía de benchmarking — &lt;a href="https://lucaberton.com/blog/nvidia-aiperf-llm-inference-benchmarking-guide/">https://lucaberton.com/blog/nvidia-aiperf-llm-inference-benchmarking-guide/&lt;/a>&lt;/li>
&lt;li>Medium · Benchmarking LLM Serving Performance (guía) — &lt;a href="https://medium.com/@kimdoil1211/benchmarking-llm-serving-performance-a-comprehensive-guide-db94b1bfe8cf">https://medium.com/@kimdoil1211/benchmarking-llm-serving-performance-a-comprehensive-guide-db94b1bfe8cf&lt;/a>&lt;/li>
&lt;/ul></description></item><item><title>Serving reasoning models: the invisible scratchpad that decides your latency and your bill</title><link>https://blog.lo0.es/en/posts/serving-reasoning-models-invisible-scratchpad-latency-bill/</link><pubDate>Fri, 12 Jun 2026 05:30:00 +0200</pubDate><guid>https://blog.lo0.es/en/posts/serving-reasoning-models-invisible-scratchpad-latency-bill/</guid><description>&lt;h2 id="tldr">TL;DR&lt;/h2>
&lt;p>A reasoning model generates, before the answer you see, a &lt;strong>thinking block&lt;/strong>, hundreds or thousands of tokens enclosed between &lt;code>&amp;lt;think&amp;gt;&lt;/code> and &lt;code>&amp;lt;/think&amp;gt;&lt;/code>, that the user does not read but that &lt;strong>consumes the same compute, the same VRAM and the same bill&lt;/strong> as any other token. Serving them in production is not &amp;ldquo;serving a bigger model&amp;rdquo;: it is serving a model whose cost per request is &lt;strong>variable and, by default, uncontrolled&lt;/strong>. Three levers change the equation: choosing well between &lt;strong>think / non-think mode&lt;/strong> (the hybrid models of 2026 allow it within the same weights), setting a &lt;strong>reasoning budget&lt;/strong> (&lt;code>thinking_token_budget&lt;/code> in vLLM, s1-style &lt;em>budget forcing&lt;/em>) and &lt;strong>measuring the impact on the KV cache&lt;/strong> (a 30k-token reasoning chain can eat ~9 GB of KV in FP16). Managed well, you gain accuracy where it matters; managed badly, you pay up to &lt;strong>113× more energy&lt;/strong> for an answer that did not need that much thinking.&lt;/p>
&lt;hr>
&lt;h2 id="the-analogy">The analogy&lt;/h2>
&lt;p>Picture a candidate sitting a competitive exam. Before writing the good answer on the official sheet, they fill three sheets of scratch paper: they try approaches, correct themselves, discard. Those scratch sheets are not handed in, the board only reads the final answer, but the candidate has spent ink, time and half an hour of the exam on them.&lt;/p>
&lt;p>A reasoning model does exactly that. The &lt;code>&amp;lt;think&amp;gt;…&amp;lt;/think&amp;gt;&lt;/code> block is the scratch paper: it reasons out loud, contradicts itself, backtracks, and finally emits the &amp;ldquo;clean&amp;rdquo; answer. The production problem is that &lt;strong>you pay for the scratch paper too&lt;/strong>: every reasoning token takes a slot in the batch, grows the KV cache and adds to the bill just like an output token. And, like any nervous candidate, the model tends to &lt;strong>overthink&lt;/strong>: it writes five sheets when one would have done.&lt;/p>
&lt;p>The operational question in this post is not &amp;ldquo;does it reason well?&amp;rdquo;, but &amp;ldquo;how much scratch paper do I let it write, and when do I take the pen away?&amp;rdquo;.&lt;/p>
&lt;hr>
&lt;h2 id="what-changes-when-the-model-thinks">What changes when the model &amp;ldquo;thinks&amp;rdquo;&lt;/h2>
&lt;p>In a normal model, a request is: prompt → output tokens. In a reasoning model the sequence has two stretches:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>Reasoning block&lt;/strong> (&lt;code>&amp;lt;think&amp;gt; … &amp;lt;/think&amp;gt;&lt;/code>): the chain of thought (CoT). Long, variable, normally hidden from the end user.&lt;/li>
&lt;li>&lt;strong>Final answer&lt;/strong>: what the user sees.&lt;/li>
&lt;/ol>
&lt;p>vLLM models this explicitly. When started with a &lt;em>reasoning parser&lt;/em>, the output carries a &lt;code>reasoning_content&lt;/code> field separate from &lt;code>content&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">vllm serve deepseek-ai/DeepSeek-R1-Distill-Qwen-32B &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --reasoning-parser deepseek_r1
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The parser detects the thinking delimiters and separates both stretches in the API response (&lt;a href="https://docs.vllm.ai/en/stable/features/reasoning_outputs/">vLLM · Reasoning Outputs&lt;/a>). This matters for serving for one practical reason: if your gateway or your UI does not separate &lt;code>reasoning_content&lt;/code> from &lt;code>content&lt;/code>, you will end up showing the scratch paper, or, worse, recording it in logs and traces without meaning to.&lt;/p>
&lt;div class="diagram" style="max-width:780px;margin:1rem auto;">
&lt;svg viewBox="0 0 780 210" role="img" aria-label="Anatomy of a request to a reasoning model: prompt, thinking block with budget, final answer" xmlns="http://www.w3.org/2000/svg">
&lt;defs>&lt;marker id="rzm" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="currentColor"/>&lt;/marker>&lt;/defs>
&lt;style>.bx{fill:none;stroke:currentColor;stroke-width:1.3}.dsh{fill:none;stroke:currentColor;stroke-width:1.3;stroke-dasharray:5 3}.tl{font:600 12px sans-serif;fill:currentColor}.ts{font:11px sans-serif;fill:currentColor}.ar{fill:none;stroke:currentColor;stroke-width:1.3;marker-end:url(#rzm)}&lt;/style>
&lt;text x="20" y="28" class="tl">Request&lt;/text>
&lt;rect class="bx" x="20" y="38" width="120" height="50" rx="6"/>
&lt;text x="32" y="60" class="ts">prompt + system&lt;/text>
&lt;text x="32" y="76" class="ts">(visible · billable)&lt;/text>
&lt;path class="ar" d="M140,63 L180,63"/>
&lt;text x="190" y="28" class="tl">Reasoning block &amp;lt;think&amp;gt; … &amp;lt;/think&amp;gt;&lt;/text>
&lt;rect class="dsh" x="190" y="38" width="360" height="80" rx="6"/>
&lt;text x="204" y="60" class="ts">hundreds–thousands of tokens HIDDEN from the user&lt;/text>
&lt;text x="204" y="78" class="ts">grow the KV cache · add to the bill as output&lt;/text>
&lt;text x="204" y="96" class="ts">cap: thinking_token_budget → forces &amp;lt;/think&amp;gt;&lt;/text>
&lt;path class="ar" d="M550,78 L590,78"/>
&lt;text x="600" y="28" class="tl">Answer&lt;/text>
&lt;rect class="bx" x="600" y="38" width="150" height="80" rx="6"/>
&lt;text x="612" y="64" class="ts">final content&lt;/text>
&lt;text x="612" y="82" class="ts">(all the user&lt;/text>
&lt;text x="612" y="98" class="ts">ever sees)&lt;/text>
&lt;text x="20" y="150" class="tl">Cost per request = prompt + reasoning + answer&lt;/text>
&lt;text x="20" y="172" class="ts">Reasoning is invisible in the UI but NOT on the GPU or in the bill. It is the variable that unbalances your cost per request.&lt;/text>
&lt;text x="20" y="192" class="ts">Operational rule: separate reasoning_content from content at the gateway, and set a thinking budget per route.&lt;/text>
&lt;/svg>
&lt;/div>
&lt;hr>
&lt;h2 id="the-2026-landscape-from-the-model-that-always-reasons-to-the-switchable-hybrid">The 2026 landscape: from the model that &amp;ldquo;always reasons&amp;rdquo; to the switchable hybrid&lt;/h2>
&lt;p>The first generation (o1, DeepSeek-R1, QwQ-32B) were models that always reasoned. In 2026 the dominant pattern is the hybrid: a single set of weights that switches between &lt;em>think&lt;/em> and &lt;em>non-think&lt;/em>.&lt;/p>
&lt;ul>
&lt;li>DeepSeek-V3.1 introduced a hybrid reasoning architecture in a single model: &lt;code>DeepSeek-V3.1-Think&lt;/code> for complex problems and a faster direct mode for the trivial, switchable by the user (&lt;a href="https://www.infoq.com/news/2025/09/deepseek-v31-hybrid/">InfoQ&lt;/a>). Important for serving: reasoning is off by default and is turned on with &lt;code>thinking=True&lt;/code> in &lt;code>chat_template_kwargs&lt;/code>.&lt;/li>
&lt;li>Qwen3 brings &lt;em>Hybrid Thinking Modes&lt;/em> and an explicit Thinking Budget to bound the reasoning compute; in its series thinking is on by default (like QwQ-32B).&lt;/li>
&lt;li>gpt-oss shows a different reasoning structure from the R1/Qwen family, which in practice means that &lt;strong>the parser and the delimiters are not universal&lt;/strong>: each family has its own.&lt;/li>
&lt;/ul>
&lt;p>The architectural consequence is clear: in 2026 you no longer decide &amp;ldquo;a model that reasons&amp;rdquo; vs &amp;ldquo;one that does not&amp;rdquo;, but &lt;strong>when you let the same model reason&lt;/strong>. That turns reasoning into a &lt;em>routing&lt;/em> and budgeting decision, not a model-catalogue one. It connects directly with &lt;a href="https://blog.lo0.es/en/posts/llm-inference-router-l7-switchboard/">the L7 inference router&lt;/a>: the &amp;ldquo;cheap&amp;rdquo; route turns thinking off; the &amp;ldquo;expensive&amp;rdquo; one turns it on with a cap.&lt;/p>
&lt;hr>
&lt;h2 id="the-economics-why-the-scratch-paper-drives-up-the-bill">The economics: why the scratch paper drives up the bill&lt;/h2>
&lt;p>Here is the heart of the problem. Reasoning tokens are invisible to the user but real in compute and in billing. Providers charge them as output tokens; API providers bill those &lt;em>reasoning tokens&lt;/em> at the output price, not for free (&lt;a href="https://medium.com/@Elongated_musk/test-time-compute-quietly-changed-the-economics-of-inference-9d0b8d77641c">Test-Time Compute Quietly Changed the Economics of Inference&lt;/a>). On-premise there is no external invoice, but there is a cost: they occupy batch slots, KV VRAM and watts.&lt;/p>
&lt;p>The billable cost (or the equivalent cost in GPU·hours) of a request is:&lt;/p>
$$\text{compute tokens} = \text{prompt} + \underbrace{\text{reasoning tokens}}_{\text{hidden, variable}} + \text{visible answer}$$
&lt;p>The middle term is the one that runs out of control. On hard tasks the reasoning/visible-answer ratio can be enormous, and empirical analysis has measured up to 113× the energy cost against standard inference on certain coding tasks (&lt;a href="https://towardsdatascience.com/inference-scaling-test-time-compute-why-reasoning-models-raise-your-compute-bill/">Towards Data Science · Inference Scaling&lt;/a>).&lt;/p>
&lt;p>And it does not always buy accuracy. The overthinking phenomenon is documented: more thinking does not guarantee a better answer, and beyond a certain point it makes things worse. There is work showing that &lt;strong>shorter chains are up to 34.5 % more accurate&lt;/strong> than the longest one sampled for the same question (&lt;a href="https://arxiv.org/pdf/2505.17813">Don&amp;rsquo;t Overthink it&lt;/a>), plus studies on the &amp;ldquo;mirage&amp;rdquo; of test-time scaling (&lt;a href="https://arxiv.org/pdf/2506.04210">Mirage of Test-Time Scaling&lt;/a>) and on when &lt;em>more thinking hurts&lt;/em> (&lt;a href="https://arxiv.org/html/2604.10739v1">When More Thinking Hurts&lt;/a>). The first large-scale study of test-time scaling, more than &lt;strong>30 billion tokens&lt;/strong> generated with 8 open-source LLMs from 7B to 235B across 4 reasoning datasets, systematises where it scales and where it does not (&lt;a href="https://arxiv.org/abs/2512.02008">The Art of Scaling Test-Time Compute&lt;/a>).&lt;/p>
&lt;p>The operational reading: &lt;strong>reasoning is a cost you have to budget for, not a &amp;ldquo;more quality&amp;rdquo; switch you leave on full all the time.&lt;/strong>&lt;/p>
&lt;hr>
&lt;h2 id="controlling-the-thinking-budget">Controlling the thinking budget&lt;/h2>
&lt;p>Three mechanisms, from coarsest to finest.&lt;/p>
&lt;h3 id="1-switching-think--non-think">1. Switching think / non-think&lt;/h3>
&lt;p>The cheapest thing is not to reason when it is not needed. On hybrid models, turn thinking off for classification, extraction, formatting, trivial answers:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-python" data-lang="python">&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># DeepSeek-V3.1: reasoning OFF by default; turned on explicitly&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="n">chat_template_kwargs&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">{&lt;/span>&lt;span class="s2">&amp;#34;thinking&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="kc">True&lt;/span>&lt;span class="p">}&lt;/span> &lt;span class="c1"># only on the &amp;#34;hard&amp;#34; route&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>This is 80 % of the saving for 20 % of the effort: route by difficulty and reserve thinking for what actually pays for it.&lt;/p>
&lt;h3 id="2-setting-a-cap-thinking_token_budget">2. Setting a cap: &lt;code>thinking_token_budget&lt;/code>&lt;/h3>
&lt;p>vLLM ships a &lt;em>sampling parameter&lt;/em> &lt;code>thinking_token_budget&lt;/code> that counts reasoning tokens and, on reaching the limit, forces the block to close (&lt;code>reasoning_end_str&lt;/code>, typically &lt;code>&amp;lt;/think&amp;gt;&lt;/code>), making the model answer straight away. If it is not specified, there is no limit other than &lt;code>max_tokens&lt;/code> (&lt;a href="https://github.com/vllm-project/vllm/pull/37112">PR #37112&lt;/a>, &lt;a href="https://shuyo.wordpress.com/2026/03/26/adding-reasoning-budget-to-vllm-reasoning-token-limit/">implementation note&lt;/a>). Underneath, a &lt;code>ReasoningBudgetLogitsProcessor&lt;/code> injects something like &lt;em>&amp;ldquo;Let me stop thinking and answer now.&lt;code>&amp;lt;/think&amp;gt;&lt;/code>&amp;rdquo;&lt;/em> when the cap is reached.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Define the delimiters of the reasoning block&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">vllm serve Qwen/Qwen3-32B &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --reasoning-parser qwen3 &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --reasoning-config &lt;span class="s1">&amp;#39;{&amp;#34;reasoning_start_str&amp;#34;:&amp;#34;&amp;lt;think&amp;gt;&amp;#34;,&amp;#34;reasoning_end_str&amp;#34;:&amp;#34;&amp;lt;/think&amp;gt;&amp;#34;}&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-json" data-lang="json">&lt;span class="line">&lt;span class="cl">&lt;span class="c1">// per request: cut the scratch paper off at 1024 tokens
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="nt">&amp;#34;messages&amp;#34;&lt;/span>&lt;span class="p">:[&lt;/span>&lt;span class="err">...&lt;/span>&lt;span class="p">],&lt;/span> &lt;span class="nt">&amp;#34;thinking_token_budget&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mi">1024&lt;/span>&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="3-budget-forcing-state-of-the-art">3. Budget forcing (state of the art)&lt;/h3>
&lt;p>The technique that popularised fine-grained control is &lt;strong>budget forcing&lt;/strong>, from the s1 paper: to spend &lt;em>less&lt;/em>, thinking is terminated by forcing the end delimiter; to spend &lt;em>more&lt;/em>, the end is suppressed and the word &amp;ldquo;Wait&amp;rdquo; is appended, which pushes the model to review and often correct its own reasoning. With this, &lt;code>s1-32B&lt;/code> (a Qwen2.5-32B-Instruct fine-tuned on just 1,000 examples) &lt;strong>beat o1-preview by as much as 27 %&lt;/strong> on AIME24/MATH (&lt;a href="https://arxiv.org/abs/2501.19393">s1: Simple Test-Time Scaling&lt;/a>). The serving lesson: the budget is not only a cost cap, it is a &lt;strong>bidirectional quality lever&lt;/strong>.&lt;/p>
$$\text{accuracy} \approx f(\text{reasoning tokens}) \quad\text{with a maximum, not monotonic}$$
&lt;p>The curve rises, saturates and on many tasks falls. Your job is to operate it near the knee, not at the extreme.&lt;/p>
&lt;hr>
&lt;h2 id="the-impact-almost-nobody-measures-the-kv-cache">The impact almost nobody measures: the KV cache&lt;/h2>
&lt;p>This is where reasoning really bites serving. Every token of scratch paper &lt;strong>is one more token in the KV cache&lt;/strong>. A long reasoning chain inflates the working memory just like a long input context.&lt;/p>
&lt;p>The KV size grows linearly with the sequence (reasoning included):&lt;/p>
$$\text{KV bytes} = 2 \times L \times h_{kv} \times d_{head} \times s \times b$$
&lt;p>where \(L\) is layers, \(h_{kv}\) KV heads (few, with GQA), \(d_{head}\) the per-head dimension, \(s\) the sequence length and \(b\) the bytes per element. The term reasoning blows up is \(s\): a &amp;ldquo;normal&amp;rdquo; 500-token answer and one with 8,000 tokens of thinking do not take up the same space, not by a long way.&lt;/p>
&lt;p>The real numbers are frightening: for a distilled reasoning model with standard attention such as &lt;code>DeepSeek-R1-Distill-Llama-70B&lt;/code>, &lt;strong>a single 30,000-token reasoning chain consumes ~9 GB of KV in FP16&lt;/strong>, which quantising the KV to FP8 reduces to ~4.5 GB, one of the highest-impact optimisations for chain-of-thought workloads (&lt;a href="https://www.spheron.network/blog/kv-cache-optimization-guide/">Spheron · KV Cache Optimization&lt;/a>). Multiply that by concurrency and you understand why a cluster that served 200 simultaneous requests of a &amp;ldquo;normal&amp;rdquo; model drops to 40 with the same model reasoning.&lt;/p>
&lt;p>Two state-of-the-art nuances worth knowing:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Prefix caching is not free here.&lt;/strong> The empirical study of reasoning-model serving finds that &lt;em>prefix caching&lt;/em> clearly improves speed on models of 14B or more, but hurts on 7B models (cache management costs more than it saves) (&lt;a href="https://arxiv.org/pdf/2510.18672">Reasoning Language Model Inference Serving Unveiled&lt;/a>). And since the bulk of the reasoning cost sits in the decode (generating tokens one by one), prefix caching, which only speeds up the prefill, barely touches the expensive phase. It connects with &lt;a href="https://blog.lo0.es/en/posts/prefix-cache-hit-rate-engineering/">prefix cache: engineering the hit rate&lt;/a>.&lt;/li>
&lt;li>&lt;strong>Reasoning-specific KV compression.&lt;/strong> Techniques such as R-KV have appeared, compressing the KV by exploiting the redundancy typical of chains of thought (the model repeats itself and rambles), recovering memory without touching quality (&lt;a href="https://arxiv.org/pdf/2505.24133">R-KV&lt;/a>).&lt;/li>
&lt;/ul>
&lt;p>The most profitable and available lever today is still &lt;strong>KV in FP8&lt;/strong> (see &lt;a href="https://blog.lo0.es/en/posts/fp8-end-to-end-enable-measure-quality-decide/">FP8 end to end&lt;/a>) combined with a reasoning budget that avoids 30k-token tails in the first place.&lt;/p>
&lt;hr>
&lt;h2 id="reasoning--structured-output-order-matters">Reasoning + structured output: order matters&lt;/h2>
&lt;p>If you serve &lt;em>structured output&lt;/em> (JSON with a schema) and reasoning at the same time, there is a subtle trap: the grammar must not be applied during the thinking block. The model needs free text to reason; forcing the schema inside the &lt;code>&amp;lt;think&amp;gt;&lt;/code> breaks the reasoning. vLLM solves it by having the structured-output engine (xgrammar) use the reasoner&amp;rsquo;s &lt;code>end_token_id&lt;/code> to skip the constraint while the block lasts and apply it only to the final answer (&lt;a href="https://docs.vllm.ai/en/stable/features/reasoning_outputs/">vLLM · Reasoning Outputs&lt;/a>). If you build this by hand on another engine, remember: &lt;strong>first let it think, then impose the form&lt;/strong>. It links with &lt;a href="https://blog.lo0.es/en/posts/structured-output-bitmask-outlines-xgrammar-llguidance/">structured output&lt;/a>.&lt;/p>
&lt;hr>
&lt;h2 id="reference-architecture">Reference architecture&lt;/h2>
&lt;p>On the blog&amp;rsquo;s example cluster, a node of 4×H100 SXM (80 GB, NVLink), a sensible topology for serving reasoning without wrecking the SLO:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>A cheap difficulty classifier&lt;/strong> up front (a small model or rules) that picks the route. Most of the traffic does not need to think.&lt;/li>
&lt;li>&lt;strong>Fast route (non-think):&lt;/strong> the same hybrid model with reasoning off. Low TTFT, predictable cost.&lt;/li>
&lt;li>&lt;strong>Reasoning route (think):&lt;/strong> reasoning on &lt;strong>with &lt;code>thinking_token_budget&lt;/code> by default&lt;/strong> (say 1–2k tokens) and the option to raise it per request for the genuinely hard cases.&lt;/li>
&lt;li>KV in FP8 in the engine on the reasoning route, plus per-request reasoning-length metrics exported to your observability (&lt;a href="https://blog.lo0.es/en/posts/instrumenting-vllm-otel-measuring-optimisations/">instrumenting vLLM with OTel&lt;/a>).&lt;/li>
&lt;/ol>
&lt;p>To prototype this routing outside the cluster, an RTX 5090 (Blackwell, 32 GB) serves a 7–14B reasoning model and lets you validate parsers, budgets and the &lt;code>reasoning_content&lt;/code>/&lt;code>content&lt;/code> separation before touching the H100s. Do not expect to serve a 32B in &lt;em>think&lt;/em> mode at high concurrency on a consumer card: the reasoning KV eats the 32 GB in no time.&lt;/p>
&lt;p>Sizing starts, as always, from an SLO; the difference is that now the &amp;ldquo;answer size&amp;rdquo; in your &lt;a href="https://blog.lo0.es/en/posts/capacity-planning-on-premise-llm-inference/">capacity planning&lt;/a> has to count the scratch paper, not just the visible answer.&lt;/p>
&lt;hr>
&lt;h2 id="operational-pitfalls-and-honest-scepticism">Operational pitfalls (and honest scepticism)&lt;/h2>
&lt;ol>
&lt;li>&lt;strong>Leaking &lt;code>reasoning_content&lt;/code>.&lt;/strong> If the gateway does not separate it, you end up showing or logging the scratch paper, which may contain wrong attempts, sensitive data or language you do not want in your UI. Always separate it at L7.&lt;/li>
&lt;li>&lt;strong>Serving reasoning &amp;ldquo;just in case&amp;rdquo;.&lt;/strong> Overthinking is real and sometimes lowers accuracy. Do not turn &lt;em>think&lt;/em> on by default: turn it on per route, with a budget.&lt;/li>
&lt;li>&lt;strong>Forgetting the KV.&lt;/strong> The most common mistake: sizing concurrency from the length of the visible answer. The KV is dictated by the total sequence, reasoning included. Measure p50/p95 &lt;code>reasoning tokens&lt;/code> per endpoint.&lt;/li>
&lt;li>&lt;strong>Prefix caching as a silver bullet.&lt;/strong> On small models it can make things worse, and in any case it does not touch the decode, which is where the reasoning cost goes.&lt;/li>
&lt;li>&lt;strong>Assuming universal delimiters.&lt;/strong> R1, Qwen3 and gpt-oss do not share a reasoning structure. Use the right &lt;code>--reasoning-parser&lt;/code> per family and test &lt;em>streaming&lt;/em> (the parser has to separate correctly token by token).&lt;/li>
&lt;li>&lt;strong>Believing more compute = more intelligence.&lt;/strong> The state of the art (s1, short-m@k, &amp;ldquo;When More Thinking Hurts&amp;rdquo;) points the other way in many cases: there is a knee, and operating beyond it is burning watts. Test-time compute is a tool with diminishing, and sometimes negative, returns, not a linear lever.&lt;/li>
&lt;/ol>
&lt;p>A note of caution for June 2026: the field of reasoning control (budget forcing, reasoning-specific KV compression, thinking &lt;em>early-exit&lt;/em>) moves fast and almost all of it is very recent. The specific figures, the 113×, the 34.5 %, the 9 GB, depend on model, task and configuration; take them as an &lt;strong>order of magnitude for design&lt;/strong>, not as constants. Measure on your own workload before committing to SLOs.&lt;/p>
&lt;hr>
&lt;h2 id="closing">Closing&lt;/h2>
&lt;p>Serving a reasoning model means serving a model whose cost per request &lt;strong>you decide with the thinking budget&lt;/strong>, not the catalogue. The chain goes: route by difficulty → turn &lt;em>think&lt;/em> off where it adds nothing → set &lt;code>thinking_token_budget&lt;/code> by default on the route that thinks → quantise the KV to FP8 → measure reasoning length as a first-class metric. Do that, and reasoning becomes a capability you pay for only when it buys accuracy. Do not, and your cluster will serve a fifth of the users while the model fills sheets of scratch paper nobody is going to read.&lt;/p>
&lt;h2 id="sources">Sources&lt;/h2>
&lt;ul>
&lt;li>vLLM · Reasoning Outputs — &lt;a href="https://docs.vllm.ai/en/stable/features/reasoning_outputs/">https://docs.vllm.ai/en/stable/features/reasoning_outputs/&lt;/a>&lt;/li>
&lt;li>vLLM PR #37112 · reasoning_budget — &lt;a href="https://github.com/vllm-project/vllm/pull/37112">https://github.com/vllm-project/vllm/pull/37112&lt;/a>&lt;/li>
&lt;li>Adding Reasoning Budget to vLLM — &lt;a href="https://shuyo.wordpress.com/2026/03/26/adding-reasoning-budget-to-vllm-reasoning-token-limit/">https://shuyo.wordpress.com/2026/03/26/adding-reasoning-budget-to-vllm-reasoning-token-limit/&lt;/a>&lt;/li>
&lt;li>s1: Simple Test-Time Scaling — &lt;a href="https://arxiv.org/abs/2501.19393">https://arxiv.org/abs/2501.19393&lt;/a>&lt;/li>
&lt;li>The Art of Scaling Test-Time Compute — &lt;a href="https://arxiv.org/abs/2512.02008">https://arxiv.org/abs/2512.02008&lt;/a>&lt;/li>
&lt;li>Don&amp;rsquo;t Overthink it (short-m@k) — &lt;a href="https://arxiv.org/pdf/2505.17813">https://arxiv.org/pdf/2505.17813&lt;/a>&lt;/li>
&lt;li>Mirage of Test-Time Scaling — &lt;a href="https://arxiv.org/pdf/2506.04210">https://arxiv.org/pdf/2506.04210&lt;/a>&lt;/li>
&lt;li>When More Thinking Hurts — &lt;a href="https://arxiv.org/html/2604.10739v1">https://arxiv.org/html/2604.10739v1&lt;/a>&lt;/li>
&lt;li>Reasoning Language Model Inference Serving Unveiled — &lt;a href="https://arxiv.org/pdf/2510.18672">https://arxiv.org/pdf/2510.18672&lt;/a>&lt;/li>
&lt;li>R-KV: Redundancy-aware KV Cache Compression — &lt;a href="https://arxiv.org/pdf/2505.24133">https://arxiv.org/pdf/2505.24133&lt;/a>&lt;/li>
&lt;li>Spheron · KV Cache Optimization Guide (2026) — &lt;a href="https://www.spheron.network/blog/kv-cache-optimization-guide/">https://www.spheron.network/blog/kv-cache-optimization-guide/&lt;/a>&lt;/li>
&lt;li>Test-Time Compute Quietly Changed the Economics of Inference — &lt;a href="https://medium.com/@Elongated_musk/test-time-compute-quietly-changed-the-economics-of-inference-9d0b8d77641c">https://medium.com/@Elongated_musk/test-time-compute-quietly-changed-the-economics-of-inference-9d0b8d77641c&lt;/a>&lt;/li>
&lt;li>Inference Scaling (Test-Time Compute) · Towards Data Science — &lt;a href="https://towardsdatascience.com/inference-scaling-test-time-compute-why-reasoning-models-raise-your-compute-bill/">https://towardsdatascience.com/inference-scaling-test-time-compute-why-reasoning-models-raise-your-compute-bill/&lt;/a>&lt;/li>
&lt;li>DeepSeek-V3.1 Hybrid Reasoning · InfoQ — &lt;a href="https://www.infoq.com/news/2025/09/deepseek-v31-hybrid/">https://www.infoq.com/news/2025/09/deepseek-v31-hybrid/&lt;/a>&lt;/li>
&lt;/ul></description></item><item><title>Structured output: the form with dropdowns that strikes out invalid answers before the model picks one — Outlines, XGrammar, LLGuidance and the maths of the bitmask</title><link>https://blog.lo0.es/en/posts/structured-output-bitmask-outlines-xgrammar-llguidance/</link><pubDate>Sat, 30 May 2026 16:30:00 +0200</pubDate><guid>https://blog.lo0.es/en/posts/structured-output-bitmask-outlines-xgrammar-llguidance/</guid><description>&lt;blockquote>
&lt;p>This post complements those on &lt;a href="https://blog.lo0.es/en/posts/continuous-batching-orca-vllm-chunked-prefill-goodput/">Continuous batching&lt;/a> (where the scheduler lives) and &lt;a href="https://blog.lo0.es/en/posts/speculative-decoding-fundamentals-maths-state-of-play/">Speculative decoding&lt;/a> (another technique operating on the last mile of the sampler). Structured output is the LLM&amp;rsquo;s output contract towards the code that consumes it; without it, the integration between an LLM and applications is fragile by default.&lt;/p>
&lt;/blockquote>
&lt;h2 id="you-are-here-deploy">You are here: DEPLOY&lt;/h2>
&lt;div class="diagram" style="max-width:780px;margin:1rem auto;">
&lt;svg viewBox="0 0 780 90" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="you are here: Deploy">
&lt;style>.box{stroke:#444;stroke-width:1.4;rx:6}.active{fill:#7ad88f;stroke-width:3}.idle{fill:#f4f4f4}.lbl{font:600 12px sans-serif;fill:#222}.arr{stroke:#666;stroke-width:1.4;fill:none;marker-end:url(#som)}.cyc{stroke:#888;stroke-width:1.2;fill:none;stroke-dasharray:4 2;marker-end:url(#som)}&lt;/style>
&lt;defs>&lt;marker id="som" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="#666"/>&lt;/marker>&lt;/defs>
&lt;text x="390" y="20" text-anchor="middle" class="lbl">You are here: DEPLOY · constraint on the logits, the sampler's last layer&lt;/text>
&lt;rect x="30" y="35" width="110" height="35" class="box idle"/>&lt;text x="85" y="58" text-anchor="middle" class="lbl">1 · Data&lt;/text>
&lt;rect x="155" y="35" width="110" height="35" class="box idle"/>&lt;text x="210" y="58" text-anchor="middle" class="lbl">2 · Tune&lt;/text>
&lt;rect x="280" y="35" width="110" height="35" class="box idle"/>&lt;text x="335" y="58" text-anchor="middle" class="lbl">3 · Eval&lt;/text>
&lt;rect x="405" y="35" width="110" height="35" class="box active"/>&lt;text x="460" y="58" text-anchor="middle" class="lbl">4 · Deploy&lt;/text>
&lt;rect x="530" y="35" width="110" height="35" class="box idle"/>&lt;text x="585" y="58" text-anchor="middle" class="lbl">5 · Observe&lt;/text>
&lt;rect x="655" y="35" width="110" height="35" class="box idle"/>&lt;text x="710" y="58" text-anchor="middle" class="lbl">6 · Retrain&lt;/text>
&lt;path class="arr" d="M140,52 L155,52"/>&lt;path class="arr" d="M265,52 L280,52"/>&lt;path class="arr" d="M390,52 L405,52"/>&lt;path class="arr" d="M515,52 L530,52"/>&lt;path class="arr" d="M640,52 L655,52"/>
&lt;path class="cyc" d="M710,72 L710,82 L85,82 L85,72"/>
&lt;/svg>
&lt;/div>
&lt;h2 id="tldr">TL;DR&lt;/h2>
&lt;p>An LLM produces free text, but many applications (function calling, entity extraction, routing, text-to-SQL, config generation) need to parse it as JSON, as a tool call with typed args, as a valid SQL statement, or as one option from an enum. The naive solutions fail: prompt engineering (&amp;ldquo;answer in JSON&amp;rdquo;) leaves &lt;strong>25 %&lt;/strong> of outputs unparseable in many models; post-hoc validation plus retry costs latency and does not guarantee termination; json-repair libraries are heuristic patches. &lt;strong>Constrained decoding&lt;/strong> guarantees conformance 100 %, by construction: at every generation step, before sampling from the softmax over the &lt;code>V&lt;/code> vocabulary tokens, the tokens that would break the target structure are masked to -∞. The output is valid by mathematical contract, not by luck. The four dominant families in May 2026 are &lt;strong>Outlines&lt;/strong> (Willard &amp;amp; Louf, 2023; FSM + token trie precomputed from regex/JSON Schema/CFG), &lt;strong>XGrammar&lt;/strong> (Dong et al., 2024-25, CMU+MLC; byte-level pushdown automaton with an adaptive cache of &lt;em>context-independent&lt;/em> tokens, the default in vLLM v1, SGLang, TensorRT-LLM, NIM and MLC-LLM), &lt;strong>LLGuidance&lt;/strong> (Microsoft Research; Earley parser + regex derivatives, ~50 µs of CPU per token, underneath OpenAI Structured Outputs) and &lt;strong>LM Format Enforcer&lt;/strong> (noamgat; aimed at JSON Schema, integrated in many engines as a fallback). &lt;strong>XGrammar-2&lt;/strong> (May 2026) introduces Structural Tag and a cross-grammar cache for dynamic agentic tool calling. The real cost when well integrated: &lt;strong>&amp;lt;5 %&lt;/strong> in TPOT and ~40 µs of CPU per token of mask computation, partially overlappable with the model&amp;rsquo;s forward pass. The open operational question: &lt;em>does it degrade reasoning?&lt;/em> The paper &lt;em>Let me Speak Freely?&lt;/em> (Tam et al., EMNLP 2024) reported significant degradation in reasoning under format constraints; the dottxt rebuttal showed that the effect came from prompts that were not equivalent between experiments. The emerging consensus in May 2026: use &lt;strong>two-pass&lt;/strong> (free reasoning with CoT in text plus structured output in a second call) for tasks that require multi-step reasoning; use single-pass constrained for extraction, classification and function calling, where forced structure improves exactness and reduces hallucinations. This post takes apart the mechanism, the maths (bitmask size = V/8 bytes, per-step latency), the comparison table of backends, the pitfalls (compile time, tokenizer-specific FSM, streaming SSE) and the production deployment pattern.&lt;/p>
&lt;h2 id="the-analogy-the-form-with-dropdowns-instead-of-free-text-fields">The analogy: the form with dropdowns instead of free-text fields&lt;/h2>
&lt;p>Imagine two ways of asking someone to fill in a form.&lt;/p>
&lt;p>The &lt;strong>first way&lt;/strong> is to hand them the paper with blank fields and say &amp;ldquo;fill it in with this exact format: the name goes here, then the ID number without spaces, then the date as YYYY-MM-DD, then mark one of these five possible reasons separated by semicolons&amp;rdquo;. You explain the format in exhaustive detail, but the person is still free to write whatever they like in each field. If they are in a hurry they may drop a zero from the ID number, put the date in the American format, tick two reasons when only one was asked for. When you receive the form, you often have to send it back: field X badly formatted, reason Y invalid, date Z impossible. This is exactly what an LLM does when you ask it to &amp;ldquo;answer in JSON with this schema&amp;rdquo;: it works most of the time, it fails a non-negligible percentage, and you have no formal guarantee of anything.&lt;/p>
&lt;p>The &lt;strong>second way&lt;/strong> is to give them an electronic form where the fields &lt;strong>are not free text&lt;/strong>. The name accepts any text, but the ID number has a mask that only lets you type eight digits followed by a letter; the date is a picker that only lets you choose valid dates; the reasons are a dropdown with five closed options. The person can type whatever they want, but the form does not accept invalid characters at any point. The result is parseable by construction: when you receive the completed form, the ID number has exactly the expected format, the date is a real date, the reason is one of the five. This is &lt;strong>constrained decoding&lt;/strong>.&lt;/p>
&lt;p>The analogy holds on four mappings:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>The person filling it in&lt;/strong> = the LLM producing logits over the vocabulary.&lt;/li>
&lt;li>&lt;strong>The characters the form lets you type in each field&lt;/strong> = the bitmask applied to the logits before sampling.&lt;/li>
&lt;li>&lt;strong>How the form knows which characters to allow depending on which field you are in&lt;/strong> = the automaton (FSM or PDA) that holds the current state of the grammar.&lt;/li>
&lt;li>&lt;strong>The fact that the dropdown is precomputed when the page loads rather than recomputed each time&lt;/strong> = the precomputed table of valid tokens per FSM state, which makes the per-step cost amortised O(1).&lt;/li>
&lt;/ul>
&lt;h2 id="the-problem-structured-output-solves">The problem structured output solves&lt;/h2>
&lt;p>The operational problem is the contract between the LLM and the code that consumes its output. There are three naive approaches, all with documented failures:&lt;/p>
&lt;p>&lt;strong>Pure prompt engineering.&lt;/strong> &amp;ldquo;Answer only with valid JSON, no comments or prose&amp;rdquo;. It works most of the time for good models; it fails between 5 % and 25 % of the time depending on the model, the temperature, the complexity of the schema and the length of the output. The model adds a trailing comma, escapes a quote badly, wraps the JSON in a &lt;code>```json&lt;/code> markdown block, hallucinates a field that was not in the schema, ignores a required field. SqueezeBits measures a ≤72 % correct rate without constraining for some models on JSON Schemas of moderate complexity.&lt;/p>
&lt;p>&lt;strong>Post-hoc validation plus retry.&lt;/strong> The server receives the output, tries to parse it, and if that fails returns the error to the model and asks it to try again. Cost: 2-3× latency in the worst case (typically 2-3 retries before giving up), no guarantee of termination, noise in the logs, hard to test deterministically.&lt;/p>
&lt;p>&lt;strong>JSON repair libraries&lt;/strong> (&lt;code>json_repair&lt;/code>, the &lt;code>fast-json-repair&lt;/code> Rust port). Heuristic patches for common errors: trailing commas, missing quotes, prose interleaved with JSON. Useful as a &lt;strong>fallback&lt;/strong> for approach 2; they are not a contract.&lt;/p>
&lt;p>The accumulated operational cost: latency inflated by retries, noise in production, painful debugging of intermittent parse errors, broken contracts with downstream clients that assumed clean parsing.&lt;/p>
&lt;h2 id="constrained-decoding-the-principle">Constrained decoding: the principle&lt;/h2>
&lt;p>At each decode step, the model produces a vector &lt;code>logits ∈ R^V&lt;/code> where &lt;code>V&lt;/code> is the vocabulary size (Llama 3: 128,256, GPT-4o: ~200,000, Qwen 3: 152,064). The conventional sampler applies softmax plus a sampling strategy (greedy, top-k, top-p, temperature) over the &lt;code>V&lt;/code> tokens.&lt;/p>
&lt;p>Constrained decoding interposes one operation before the softmax: it applies a bitmask that sets to -∞ the logits of the tokens that would violate the target grammar at this step. The result: the softmax only assigns probability mass to admissible tokens; sampling, whatever its strategy, can only pick a valid one.&lt;/p>
&lt;p>The two operational questions are always the same:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>How do you know which tokens are valid at each step?&lt;/strong> → hold the current state of an automaton (FSM/PDA) built from the grammar; look up the table &lt;code>(state → set of valid tokens)&lt;/code>.&lt;/li>
&lt;li>&lt;strong>How much does it cost to compute and apply the mask?&lt;/strong> → this is where Outlines, XGrammar, LLGuidance and LM Format Enforcer compete.&lt;/li>
&lt;/ol>
&lt;div class="diagram" style="max-width:780px;margin:1.5rem auto;">
&lt;svg viewBox="0 0 780 320" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Constrained decoding flow">
&lt;style>
.box{fill:#fff;stroke:#444;stroke-width:1.4;rx:6}
.logits{fill:#fff4d6;stroke:#a48000;stroke-width:1.4;rx:6}
.mask{fill:#f6caca;stroke:#a52a2a;stroke-width:1.4;rx:6}
.fsm{fill:#e6d0ff;stroke:#5a2db0;stroke-width:1.4;rx:6}
.smpl{fill:#cdebd0;stroke:#2a7a40;stroke-width:1.4;rx:6}
.tok{fill:#d4ecff;stroke:#1f5fa8;stroke-width:1.4;rx:6}
.lbl{font:600 12px sans-serif;fill:#222}
.sub{font:400 10px sans-serif;fill:#555}
.arr{stroke:#666;stroke-width:1.4;fill:none;marker-end:url(#som1)}
.dotted{stroke:#999;stroke-width:1.2;fill:none;stroke-dasharray:4 2;marker-end:url(#som1)}
&lt;/style>
&lt;defs>&lt;marker id="som1" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="#444"/>&lt;/marker>&lt;/defs>
&lt;text x="20" y="22" class="lbl">1. The model produces logits over the V vocabulary tokens&lt;/text>
&lt;rect x="20" y="30" width="200" height="50" class="logits"/>
&lt;text x="120" y="50" text-anchor="middle" class="lbl">logits ∈ R^V&lt;/text>
&lt;text x="120" y="68" text-anchor="middle" class="sub">[2.1, 5.3, -1.2, 8.7, 0.4, ..., 3.1]&lt;/text>
&lt;text x="260" y="22" class="lbl">2. The automaton knows what state we are in (in this JSON)&lt;/text>
&lt;rect x="260" y="30" width="240" height="50" class="fsm"/>
&lt;text x="380" y="46" text-anchor="middle" class="lbl">FSM / PDA state&lt;/text>
&lt;text x="380" y="62" text-anchor="middle" class="sub">waiting: opening quote of a string&lt;/text>
&lt;text x="380" y="76" text-anchor="middle" class="sub">(after the "name": field)&lt;/text>
&lt;path class="arr" d="M500,55 L540,55"/>
&lt;text x="540" y="22" class="lbl">3. Precomputed table&lt;/text>
&lt;rect x="540" y="30" width="220" height="50" class="box"/>
&lt;text x="650" y="46" text-anchor="middle" class="lbl">cache: state → valid tokens&lt;/text>
&lt;text x="650" y="62" text-anchor="middle" class="sub">{ '"', ' ', '\t', '\n' }&lt;/text>
&lt;text x="650" y="76" text-anchor="middle" class="sub">rest of vocab → -∞&lt;/text>
&lt;path class="arr" d="M650,80 L650,120 L380,120"/>
&lt;text x="260" y="140" class="lbl">4. Resulting bitmask (16 KB for Llama 3, V=128256)&lt;/text>
&lt;rect x="260" y="148" width="240" height="40" class="mask"/>
&lt;text x="380" y="170" text-anchor="middle" class="lbl">bitmask: 0..010..010..0..0&lt;/text>
&lt;text x="380" y="184" text-anchor="middle" class="sub">1 = allowed, 0 = set to -∞&lt;/text>
&lt;path class="arr" d="M120,80 L120,200"/>
&lt;path class="arr" d="M380,188 L380,200"/>
&lt;text x="20" y="222" class="lbl">5. logits + bitmask → constrained logits → softmax → sampling&lt;/text>
&lt;rect x="20" y="230" width="500" height="50" class="smpl"/>
&lt;text x="270" y="252" text-anchor="middle" class="lbl">apply_token_bitmask_inplace(logits, bitmask)&lt;/text>
&lt;text x="270" y="268" text-anchor="middle" class="sub">softmax → top-k / top-p / greedy → sampled token&lt;/text>
&lt;path class="arr" d="M520,255 L560,255"/>
&lt;rect x="560" y="230" width="180" height="50" class="tok"/>
&lt;text x="650" y="252" text-anchor="middle" class="lbl">token = '"'&lt;/text>
&lt;text x="650" y="268" text-anchor="middle" class="sub">(valid by construction)&lt;/text>
&lt;path class="dotted" d="M650,280 L650,300 L380,300 L380,82"/>
&lt;text x="395" y="297" class="sub">6. update FSM/PDA state with the chosen token → next step&lt;/text>
&lt;/svg>
&lt;/div>
&lt;h2 id="the-four-families-of-backends">The four families of backends&lt;/h2>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Backend&lt;/th>
&lt;th>Origin&lt;/th>
&lt;th>Algorithm&lt;/th>
&lt;th>Grammar formats&lt;/th>
&lt;th>Default in&lt;/th>
&lt;th>Notes&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Outlines&lt;/td>
&lt;td>dottxt (2023)&lt;/td>
&lt;td>FSM + precomputed token trie&lt;/td>
&lt;td>regex, JSON Schema, Lark CFG&lt;/td>
&lt;td>HF TGI&lt;/td>
&lt;td>The Rust version (outlines-core) closes part of the gap with XGrammar&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>XGrammar&lt;/td>
&lt;td>CMU + MLC (2024-25)&lt;/td>
&lt;td>Byte-level PDA + adaptive ctx-indep/dep cache&lt;/td>
&lt;td>regex, JSON Schema, EBNF/CFG&lt;/td>
&lt;td>vLLM v1, SGLang, TensorRT-LLM, NIM, MLC-LLM&lt;/td>
&lt;td>Speedup vs naive: up to 100× CFG, 3× JSON; &amp;lt;40 µs/token JSON&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>LLGuidance&lt;/td>
&lt;td>Microsoft Research&lt;/td>
&lt;td>Earley parser + regex derivatives&lt;/td>
&lt;td>regex, JSON Schema, Lark&lt;/td>
&lt;td>OpenAI Structured Outputs (internally), Chromium&lt;/td>
&lt;td>~50 µs CPU/token; underneath Guidance, llama.cpp, mistral.rs&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>LM Format Enforcer&lt;/td>
&lt;td>noamgat&lt;/td>
&lt;td>char-level parser + tokenizer prefix tree&lt;/td>
&lt;td>JSON Schema, regex&lt;/td>
&lt;td>(deprecated default in many engines, fallback in NIM)&lt;/td>
&lt;td>Slower than XGrammar (3.5× worse JSON, 10× worse CFG)&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>Three operational observations:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>XGrammar is the de facto default in May 2026&lt;/strong> across the open-source ecosystem (vLLM v1, SGLang, TensorRT-LLM, NIM, MLC-LLM). Its byte-level PDA with an adaptive cache gives it almost zero overhead when well integrated.&lt;/li>
&lt;li>&lt;strong>LLGuidance is the least known but most used piece on the market&lt;/strong>, because it sits underneath OpenAI Structured Outputs (confirmed in the README of the repo itself). 50 µs of CPU per token for 128k tokenizers.&lt;/li>
&lt;li>&lt;strong>Outlines was the first&lt;/strong>, it still holds the conceptual mindshare (papers, canonical blog posts), but it lost operational ground to XGrammar. The Rust version (outlines-core) closes part of the gap.&lt;/li>
&lt;/ol>
&lt;h2 id="xgrammar-in-detail-what-sits-under-vllm-and-sglang">XGrammar in detail (what sits under vLLM and SGLang)&lt;/h2>
&lt;p>The paper by Dong, Yin, Ruan and Chen (arXiv:2411.15100, November 2024) introduces a partitioning technique that is key to understanding why XGrammar is 3-100× faster than the alternatives.&lt;/p>
&lt;p>&lt;strong>Partitioning the vocabulary at each PDA state&lt;/strong>:&lt;/p>
&lt;ul>
&lt;li>&lt;em>Context-independent&lt;/em> tokens (~99 % of the vocab in a typical JSON Schema): their validity is decided &lt;strong>only&lt;/strong> by the current PDA position, without needing to inspect the full stack. These are precomputable and stored as bitmasks in a cache.&lt;/li>
&lt;li>&lt;em>Context-dependent&lt;/em> tokens (~1 %): they require inspecting the PDA stack at runtime. They are handled case by case at a higher cost.&lt;/li>
&lt;/ul>
&lt;p>That partition is the fundamental reason why XGrammar works in production at low TPOT. 99 % of the lookups go to a precomputed table in O(1); only the residual 1 % pays the real cost.&lt;/p>
&lt;p>&lt;strong>Other combined techniques&lt;/strong>: a pushdown automaton for full CFGs (not just regex), a persistent stack for fast branching/rollback, JIT compilation plus an Earley parser in XGrammar-2.&lt;/p>
&lt;p>&lt;strong>Reported speedups (paper)&lt;/strong>:&lt;/p>
&lt;ul>
&lt;li>Up to &lt;strong>100×&lt;/strong> over previous solutions on CFG.&lt;/li>
&lt;li>&lt;strong>3×&lt;/strong> on JSON Schema versus Outlines.&lt;/li>
&lt;li>Latency &amp;lt;40 µs per token on JSON Schema; &amp;lt;200 µs on XML/Python DSL.&lt;/li>
&lt;li>When well integrated in vLLM/SGLang/TRT-LLM: near-zero end-to-end overhead.&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>XGrammar-2&lt;/strong> (May 2026, arXiv:2601.04426) adds two pieces that matter for agents:&lt;/p>
&lt;ul>
&lt;li>Structural Tag: a composable JSON protocol that unifies OpenAI harmony, tool calling and reasoning channels.&lt;/li>
&lt;li>Cross-Grammar Cache for reuse at sub-structure level → it allows dynamic switching between sub-grammars in agentic loops without recompiling.&lt;/li>
&lt;li>6× faster compile time than XGrammar-1.&lt;/li>
&lt;/ul>
&lt;h2 id="the-maths-of-the-bitmask">The maths of the bitmask&lt;/h2>
&lt;p>Three numbers drive the operational decision.&lt;/p>
&lt;p>&lt;strong>Bitmask size per step.&lt;/strong> If the vocabulary has &lt;code>V&lt;/code> tokens, the bit-packed bitmask takes &lt;code>V/8&lt;/code> bytes:&lt;/p>
$$\text{bitmask size} = \frac{V}{8} \text{ bytes}$$
&lt;ul>
&lt;li>Llama 3 (V=128,256): 16 KB per bitmask per request per step.&lt;/li>
&lt;li>GPT-4o tokenizer o200k (V≈200,000): 25 KB.&lt;/li>
&lt;li>Llama 2 (V=32,000): 4 KB.&lt;/li>
&lt;/ul>
&lt;p>For a batch of 32 requests with structured output active on an H100, we are talking about ~512 KB of bitmasks per step, trivial against the GBs the forward pass moves.&lt;/p>
&lt;p>&lt;strong>Cost of applying the bitmask to the logits.&lt;/strong> A simple CUDA kernel, &lt;code>O(V)&lt;/code> complexity, ~5-10 µs of latency on an H100. Negligible.&lt;/p>
&lt;p>&lt;strong>Cost of computing the bitmask (CPU-side).&lt;/strong> This is where backends differ:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Backend&lt;/th>
&lt;th>CPU latency per token (Llama 3, V=128k)&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>LLGuidance&lt;/td>
&lt;td>~50 µs&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>XGrammar&lt;/td>
&lt;td>~40 µs (JSON Schema), ~200 µs (XML/DSL)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>outlines-core&lt;/td>
&lt;td>comparable to XGrammar after 2024&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Outlines Python (legacy)&lt;/td>
&lt;td>200-1000 µs&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>LM Format Enforcer&lt;/td>
&lt;td>intermediate, degrades with a large vocab&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>With a model forward pass on the order of 10-50 ms per token in decode, a 40-50 µs mask is &lt;strong>&amp;lt;0.5 % overhead&lt;/strong>, invisible. The operational key is that the CPU-side mask computation can be overlapped with the GPU-side forward pass: while the GPU computes the logits for token &lt;em>t&lt;/em>, the CPU precomputes the mask for token &lt;em>t+1&lt;/em> based on the FSM state after token &lt;em>t-1&lt;/em>. SGLang does this explicitly; vLLM v1 improved substantially over v0.&lt;/p>
&lt;p>&lt;strong>Compile-time cost.&lt;/strong> Precomputing the FSM/PDA and the cache:&lt;/p>
&lt;ul>
&lt;li>Simple schemas (1-5 fields): &amp;lt;100 ms.&lt;/li>
&lt;li>Deep JSON Schemas with many &lt;code>$defs&lt;/code>: seconds.&lt;/li>
&lt;li>OpenAI structured outputs: &amp;ldquo;10s typical, up to 1 minute for complex schemas&amp;rdquo;, cached after the first call.&lt;/li>
&lt;li>XGrammar-2: 6× faster than XGrammar-1.&lt;/li>
&lt;li>LLGuidance: ~2 ms startup.&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Operational best practice&lt;/strong>: pre-cache the known schemas when the server starts, to avoid latency spikes on the first request for each new schema.&lt;/p>
&lt;h2 id="does-it-degrade-the-models-reasoning">Does it degrade the model&amp;rsquo;s reasoning?&lt;/h2>
&lt;p>It is the most interesting question in the field and the answer is not obvious.&lt;/p>
&lt;p>&lt;strong>The theoretical argument for degradation&lt;/strong>: forcing the structure changes the model&amp;rsquo;s probability distribution; if the structured path pushes towards low-probability paths, the model gets &amp;ldquo;stuck&amp;rdquo; in a suboptimal branch with no room to explore.&lt;/p>
&lt;p>&lt;strong>The paper &lt;em>Let me Speak Freely?&lt;/em>&lt;/strong> (Tam et al., arXiv:2408.02442, EMNLP 2024 Industry Track) reported significant degradation on reasoning tasks under format constraints (JSON/XML/YAML). The stricter the format, the greater the degradation. The paper itself, however, acknowledged an improvement on classification tasks with forced structure.&lt;/p>
&lt;p>&lt;strong>The dottxt rebuttal, &lt;em>Say What You Mean&lt;/em>&lt;/strong> (official blog post): a methodological critique. The prompts in the original paper were different between structured and unstructured (not apples to apples). The JSON prompts in the original experiment gave less information than the unstructured ones. Re-running with equivalent prompts (Llama-3-8B-Instruct), dottxt does not reproduce the degradation. The conclusion: the paper confused the &lt;em>format constraint&lt;/em> with the &lt;em>prompt engineering&lt;/em> of that constraint.&lt;/p>
&lt;p>&lt;strong>Emerging consensus in May 2026&lt;/strong> (gathered from technical blogs and community empiricism):&lt;/p>
&lt;ul>
&lt;li>For extraction, classification, function calling and routing: constrained decoding improves exactness and reduces hallucinations. It is the right tool.&lt;/li>
&lt;li>For multi-step reasoning (maths, logic, code review): use &lt;strong>two-pass&lt;/strong>:
&lt;ol>
&lt;li>First call: free reasoning with Chain-of-Thought in natural text (generous &lt;code>max_tokens&lt;/code>, no constraint).&lt;/li>
&lt;li>Second call: pass it the reasoning plus the schema, and ask it to produce structured output with constrained decoding.&lt;/li>
&lt;/ol>
&lt;/li>
&lt;/ul>
&lt;p>The &amp;ldquo;reason then structure&amp;rdquo; pattern gives the best of both worlds: reasoning without a straitjacket plus an output guaranteed to be parseable.&lt;/p>
&lt;h2 id="real-implementations-in-may-2026">Real implementations in May 2026&lt;/h2>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Engine&lt;/th>
&lt;th>Default backend&lt;/th>
&lt;th>Others available&lt;/th>
&lt;th>API&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>vLLM v1&lt;/td>
&lt;td>XGrammar (auto)&lt;/td>
&lt;td>Outlines, Guidance (llguidance), LM Format Enforcer&lt;/td>
&lt;td>&lt;code>guided_json&lt;/code>, &lt;code>guided_regex&lt;/code>, &lt;code>guided_choice&lt;/code>, &lt;code>guided_grammar&lt;/code> in the request&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>SGLang&lt;/td>
&lt;td>XGrammar&lt;/td>
&lt;td>Outlines, LLGuidance&lt;/td>
&lt;td>&lt;code>response_format.json_schema&lt;/code>, &lt;code>extra_body.regex&lt;/code>, &lt;code>extra_body.ebnf&lt;/code>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>TensorRT-LLM&lt;/td>
&lt;td>XGrammar&lt;/td>
&lt;td>LLGTRT (Rust llguidance)&lt;/td>
&lt;td>Official integration since Jan 2025&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>NVIDIA NIM&lt;/td>
&lt;td>XGrammar (switched from Outlines in 2025)&lt;/td>
&lt;td>LM Format Enforcer (requires &lt;code>NIM_ENABLE_KV_CACHE_REUSE=0&lt;/code>)&lt;/td>
&lt;td>Pluggable multi-backend&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>llama.cpp&lt;/td>
&lt;td>Native GBNF&lt;/td>
&lt;td>LLGuidance&lt;/td>
&lt;td>Each candidate token is tested against the parse state&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>HF TGI&lt;/td>
&lt;td>Outlines&lt;/td>
&lt;td>XGrammar (experimental)&lt;/td>
&lt;td>&amp;ldquo;Guidance&amp;rdquo; feature with &lt;code>/generate&lt;/code> and &lt;code>/chat/completion&lt;/code> with &lt;code>tools&lt;/code>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>MLC-LLM&lt;/td>
&lt;td>XGrammar (native, same team)&lt;/td>
&lt;td>—&lt;/td>
&lt;td>Its own API&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>vLLM example:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-python" data-lang="python">&lt;span class="line">&lt;span class="cl">&lt;span class="kn">from&lt;/span> &lt;span class="nn">openai&lt;/span> &lt;span class="kn">import&lt;/span> &lt;span class="n">OpenAI&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="n">client&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">OpenAI&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">base_url&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s2">&amp;#34;http://localhost:8000/v1&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">api_key&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s2">&amp;#34;x&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="n">response&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">client&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">chat&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">completions&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">create&lt;/span>&lt;span class="p">(&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">model&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s2">&amp;#34;meta-llama/Llama-3.1-70B-Instruct&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">messages&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="p">[{&lt;/span>&lt;span class="s2">&amp;#34;role&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;user&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s2">&amp;#34;content&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;Extract name and age from: María is 34 years old&amp;#34;&lt;/span>&lt;span class="p">}],&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">extra_body&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;guided_json&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;type&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;object&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;properties&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;name&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="p">{&lt;/span>&lt;span class="s2">&amp;#34;type&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;string&amp;#34;&lt;/span>&lt;span class="p">},&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;age&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="p">{&lt;/span>&lt;span class="s2">&amp;#34;type&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;integer&amp;#34;&lt;/span>&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">},&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;required&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="p">[&lt;/span>&lt;span class="s2">&amp;#34;name&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s2">&amp;#34;age&amp;#34;&lt;/span>&lt;span class="p">]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>SGLang equivalent:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-python" data-lang="python">&lt;span class="line">&lt;span class="cl">&lt;span class="n">response&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">client&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">chat&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">completions&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">create&lt;/span>&lt;span class="p">(&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">model&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s2">&amp;#34;meta-llama/Llama-3.1-70B-Instruct&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">messages&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="o">...&lt;/span>&lt;span class="p">],&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">response_format&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;type&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;json_schema&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;json_schema&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;name&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;person&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;strict&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="kc">True&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;schema&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="p">{&lt;/span>&lt;span class="o">...&lt;/span>&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="usage-patterns-in-production">Usage patterns in production&lt;/h2>
&lt;p>&lt;strong>Function calling / tool use.&lt;/strong> The LLM produces &lt;code>{tool_name: enum, arguments: object}&lt;/code> according to a schema. The dominant case today (OpenAI, Anthropic, open models). The schema guarantees that &lt;code>tool_name&lt;/code> is in the set of available tools and that &lt;code>arguments&lt;/code> has the right types.&lt;/p>
&lt;p>&lt;strong>Entity extraction.&lt;/strong> A schema with &lt;code>{name, address, phone, ...}&lt;/code> from unstructured text. It moves schema adherence from 76% to 98% in vendor benchmarks.&lt;/p>
&lt;p>&lt;strong>Routing / classification.&lt;/strong> The LLM picks between N options (&lt;code>enum&lt;/code> in the schema). The bitmask shrinks to a handful of valid tokens → almost zero overhead, maximum reliability.&lt;/p>
&lt;p>&lt;strong>Constrained SQL.&lt;/strong> An SQL grammar as GBNF or Lark → it avoids injection and syntax errors. Useful in text-to-SQL agents.&lt;/p>
&lt;p>&lt;strong>Code generation with a valid AST.&lt;/strong> A grammar for the target language (Python, Rust, a custom DSL). It guarantees that the output is compilable or parseable code.&lt;/p>
&lt;p>&lt;strong>Agentic loops.&lt;/strong> XGrammar-2 Structural Tag for dynamic switching between formats (tool call → reasoning channel → tool result) without recompiling the grammar.&lt;/p>
&lt;h2 id="operational-pitfalls">Operational pitfalls&lt;/h2>
&lt;p>&lt;strong>Compile time for large schemas.&lt;/strong> JSON Schemas with many &lt;code>$defs&lt;/code> can take seconds to compile. This causes slow startup if they are loaded at boot, or latency spikes on the first request if they are loaded on demand. Mitigation: warm the cache at boot with the fleet&amp;rsquo;s known schemas.&lt;/p>
&lt;p>&lt;strong>Tokenizer-specific FSM/PDA.&lt;/strong> A schema precompiled for Llama 3 (128k tokenizer) does not work for Qwen (152k). The schema cache must be keyed by &lt;code>(tokenizer_hash, schema_hash)&lt;/code>. Changing model = invalidating the cache.&lt;/p>
&lt;p>&lt;strong>Schema changes.&lt;/strong> Version schemas explicitly. Breaking changes → rebuild plus warm cache. Do not silence compile errors in production.&lt;/p>
&lt;p>&lt;strong>Streaming SSE.&lt;/strong> Structured output with streaming requires parsers tolerant of partial output (&lt;code>partial-json-parser&lt;/code>, &lt;code>json-stream&lt;/code>). Strict Pydantic v1 fails; v2 with &lt;code>partial validation&lt;/code> works. Older clients may not handle incremental validation, so test with the real client.&lt;/p>
&lt;p>&lt;strong>Token healing.&lt;/strong> Tokens that cross boundaries (&lt;code>://&lt;/code> as a single token versus &lt;code>:&lt;/code> + &lt;code>//&lt;/code>) can break pure constraints. Outlines and XGrammar mitigate this internally; llama.cpp and others require explicit token healing. If the model sneaks a &amp;ldquo;strange&amp;rdquo; character in after the structure, this is probably why.&lt;/p>
&lt;p>&lt;strong>Real known bugs in vLLM 2025-26&lt;/strong>:&lt;/p>
&lt;ul>
&lt;li>vLLM 0.8.4: XGrammar rejects &lt;code>minItems&lt;/code> in JSON Schema (issue #16880).&lt;/li>
&lt;li>vLLM with Qwen 2.5 VL: Outlines/XGrammar does not respect the schema in some cases (issue #13038).&lt;/li>
&lt;li>The vLLM &lt;code>apply_token_bitmask_inplace&lt;/code> bitmask backend is always &lt;code>auto&lt;/code>, not exposed to the user.&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>OpenAI subset limitations&lt;/strong>: if you are going to port a schema validated on OpenAI structured outputs to another backend, check that you are not using constructs that OpenAI rejects but others allow (deep &lt;code>$ref&lt;/code>, &lt;code>pattern&lt;/code>, &lt;code>default&lt;/code>, depth &amp;gt;5, &lt;code>anyOf&lt;/code> as root).&lt;/p>
&lt;h2 id="implications-on-on-premise-hardware">Implications on on-premise hardware&lt;/h2>
&lt;p>&lt;strong>On an RTX 4090 (24 GB).&lt;/strong> Any model you serve with vLLM or llama.cpp can carry structured output at practically negligible cost. The CPU-side mask latency (~40 µs) is trivial compared with typical TPOT (30-100 ms on consumer hardware). The interesting case: function calling over Llama 3 8B or Qwen 3 14B INT4 → reliable tool use without retries, with no need for a hosted API.&lt;/p>
&lt;p>&lt;strong>On a generic 4×H100 SXM cluster (320 GB, NVLink, native FP8).&lt;/strong> Here XGrammar as the vLLM v1 / SGLang default is the way:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Llama 3 70B FP8 + XGrammar JSON Schema&lt;/strong>: TPOT P95 stable under 60 ms even with structured output active across the whole batch. It supports hundreds of distinct cached schemas.&lt;/li>
&lt;li>&lt;strong>DeepSeek-V3 + XGrammar Structural Tag&lt;/strong>: agentic tool calling with native MTP and constrained decoding combined; the mask cost overlaps with the MoE forward pass.&lt;/li>
&lt;li>&lt;strong>Multi-tenant function calling&lt;/strong>: each client can have its own set of tools (that is, its own schemas); compile time is amortised through caching, runtime is invariant.&lt;/li>
&lt;/ul>
&lt;p>The rule of thumb for May 2026: XGrammar by default, pre-cache the fleet&amp;rsquo;s schemas at boot, two-pass for reasoning tasks.&lt;/p>
&lt;h2 id="what-we-have-not-covered">What we have not covered&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Dynamic tool routing&lt;/strong> with XGrammar-2 Structural Tag: the detail of how TagDispatch picks sub-grammars at runtime.&lt;/li>
&lt;li>&lt;strong>Constrained beam search&lt;/strong> and its interaction with grammar: theoretical quality degradation versus greedy.&lt;/li>
&lt;li>&lt;strong>Grammars for code generation with a full AST&lt;/strong>: production-grade Python/Rust grammars, performance.&lt;/li>
&lt;li>&lt;strong>JSON Schema → Pydantic → grammar pipelines&lt;/strong>: tooling to reduce human error.&lt;/li>
&lt;li>&lt;strong>Inhibition decoding&lt;/strong> (the Inhibition Decoding paper, 2025): a variant that penalises but does not forbid certain tokens, useful for soft safety constraints.&lt;/li>
&lt;/ul>
&lt;h2 id="see-also">See also&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/continuous-batching-orca-vllm-chunked-prefill-goodput/">Continuous batching: the hairdresser with 8 chairs&lt;/a> — the scheduler where structured output is applied request by request; the CPU-side mask computation can overlap with the GPU-side forward pass.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/speculative-decoding-fundamentals-maths-state-of-play/">Speculative decoding&lt;/a> — another technique operating on the sampler; speculative plus structured can be combined but requires care (the acceptance rule has to respect the bitmask).&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/multi-lora-serving-shared-base-concurrent-adapters-sgmv-kernel/">Multi-LoRA serving&lt;/a> — an adapter may be trained specifically for function calling, complementing the structured output guarantee with the model&amp;rsquo;s affinity for the task.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/llm-as-judge-exam-marker-not-oracle/">LLM-as-judge: the exam marker&lt;/a> — the judge produces a structured verdict (&lt;code>{score, reasoning, decision}&lt;/code>) that can be secured with structured output to avoid manual parsing.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/evals-llm-layer-after-tracing/">Evals for LLMs&lt;/a> — evals with LLM-as-judge benefit enormously from guaranteed structured output.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/six-stage-llmops-pipeline-architecture-and-deep-dive/">The six-stage LLMOps pipeline&lt;/a> — the master map where Deploy is stage 4.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/ontologies-knowledge-graphs-llmops-linnaean-nomenclature/">Ontologies and knowledge graphs in LLMOps&lt;/a> — the JSON Schemas imposed on the sampler here usually derive from a SHACL shape of the corporate ontology; structured output is the mechanism by which the LLM populates the KG&amp;rsquo;s ABox in line with the declared TBox.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/function-calling-tool-augmented-retrieval-detective-knows-which-file/">Function calling and tool-augmented retrieval: the detective who knows which file to ask for&lt;/a> — the JSON Schema defining each tool call is structured output applied to the tool interface; the constrained decoding guarantee from this post is what makes the LLM generate calls that parse 100 % of the time.&lt;/li>
&lt;/ul>
&lt;h2 id="references">References&lt;/h2>
&lt;ul>
&lt;li>Willard, B., Louf, R. &lt;em>Efficient Guided Generation for Large Language Models&lt;/em> (Outlines). 2023. &lt;a href="https://arxiv.org/abs/2307.09702">https://arxiv.org/abs/2307.09702&lt;/a>&lt;/li>
&lt;li>Dong, Y., Yin, X., Ruan, F., Chen, T. &lt;em>XGrammar: Flexible and Efficient Structured Generation Engine for Large Language Models&lt;/em>. 2024. &lt;a href="https://arxiv.org/abs/2411.15100">https://arxiv.org/abs/2411.15100&lt;/a>&lt;/li>
&lt;li>&lt;em>XGrammar-2: Dynamic Structured Generation for Agentic LLMs&lt;/em>. 2026. &lt;a href="https://arxiv.org/abs/2601.04426">https://arxiv.org/abs/2601.04426&lt;/a>&lt;/li>
&lt;li>Tam, Z. et al. &lt;em>Let Me Speak Freely? A Study on the Impact of Format Restrictions on Performance of Large Language Models&lt;/em>. EMNLP 2024 Industry. &lt;a href="https://arxiv.org/abs/2408.02442">https://arxiv.org/abs/2408.02442&lt;/a>&lt;/li>
&lt;li>dottxt blog, &lt;em>Say What You Mean&lt;/em>: &lt;a href="https://blog.dottxt.ai/say-what-you-mean.html">https://blog.dottxt.ai/say-what-you-mean.html&lt;/a>&lt;/li>
&lt;li>OpenAI, &lt;em>Introducing Structured Outputs in the API&lt;/em>: &lt;a href="https://openai.com/index/introducing-structured-outputs-in-the-api/">https://openai.com/index/introducing-structured-outputs-in-the-api/&lt;/a>&lt;/li>
&lt;li>Outlines repo: &lt;a href="https://github.com/dottxt-ai/outlines">https://github.com/dottxt-ai/outlines&lt;/a>&lt;/li>
&lt;li>outlines-core (Rust): &lt;a href="https://github.com/dottxt-ai/outlines-core">https://github.com/dottxt-ai/outlines-core&lt;/a>&lt;/li>
&lt;li>XGrammar repo: &lt;a href="https://github.com/mlc-ai/xgrammar">https://github.com/mlc-ai/xgrammar&lt;/a>&lt;/li>
&lt;li>LLGuidance (Microsoft Research) repo: &lt;a href="https://github.com/guidance-ai/llguidance">https://github.com/guidance-ai/llguidance&lt;/a>&lt;/li>
&lt;li>LM Format Enforcer repo: &lt;a href="https://github.com/noamgat/lm-format-enforcer">https://github.com/noamgat/lm-format-enforcer&lt;/a>&lt;/li>
&lt;li>llama.cpp grammars: &lt;a href="https://github.com/ggml-org/llama.cpp/blob/master/grammars/README.md">https://github.com/ggml-org/llama.cpp/blob/master/grammars/README.md&lt;/a>&lt;/li>
&lt;li>vLLM Structured Outputs docs: &lt;a href="https://docs.vllm.ai/en/stable/features/structured_outputs/">https://docs.vllm.ai/en/stable/features/structured_outputs/&lt;/a>&lt;/li>
&lt;li>SGLang Structured Outputs docs: &lt;a href="https://docs.sglang.io/advanced_features/structured_outputs.html">https://docs.sglang.io/advanced_features/structured_outputs.html&lt;/a>&lt;/li>
&lt;li>TensorRT-LLM guided decoding (Triton): &lt;a href="https://docs.nvidia.com/deeplearning/triton-inference-server/user-guide/docs/tensorrtllm_backend/docs/guided_decoding.html">https://docs.nvidia.com/deeplearning/triton-inference-server/user-guide/docs/tensorrtllm_backend/docs/guided_decoding.html&lt;/a>&lt;/li>
&lt;li>NIM Structured Generation: &lt;a href="https://docs.nvidia.com/nim/large-language-models/1.12.0/structured-generation.html">https://docs.nvidia.com/nim/large-language-models/1.12.0/structured-generation.html&lt;/a>&lt;/li>
&lt;li>MLC blog, &lt;em>XGrammar&lt;/em>: &lt;a href="https://blog.mlc.ai/2024/11/22/achieving-efficient-flexible-portable-structured-generation-with-xgrammar">https://blog.mlc.ai/2024/11/22/achieving-efficient-flexible-portable-structured-generation-with-xgrammar&lt;/a>&lt;/li>
&lt;li>MLC blog, &lt;em>XGrammar-2&lt;/em>: &lt;a href="https://blog.mlc.ai/2026/05/04/xgrammar-2-fast-customizable-structured-generation">https://blog.mlc.ai/2026/05/04/xgrammar-2-fast-customizable-structured-generation&lt;/a>&lt;/li>
&lt;li>SqueezeBits, &lt;em>Guided decoding performance: vLLM vs SGLang&lt;/em>: &lt;a href="https://blog.squeezebits.com/guided-decoding-performance-vllm-sglang">https://blog.squeezebits.com/guided-decoding-performance-vllm-sglang&lt;/a>&lt;/li>
&lt;li>Red Hat, &lt;em>Structured outputs in vLLM&lt;/em>: &lt;a href="https://developers.redhat.com/articles/2025/06/03/structured-outputs-vllm-guiding-ai-responses">https://developers.redhat.com/articles/2025/06/03/structured-outputs-vllm-guiding-ai-responses&lt;/a>&lt;/li>
&lt;li>Aidan Cooper, &lt;em>Constrained Decoding&lt;/em> guide: &lt;a href="https://www.aidancooper.co.uk/constrained-decoding/">https://www.aidancooper.co.uk/constrained-decoding/&lt;/a>&lt;/li>
&lt;/ul></description></item><item><title>Continuous batching: the salon with 8 chairs that does not wait for the slow customer — Orca, vLLM, chunked prefill and goodput</title><link>https://blog.lo0.es/en/posts/continuous-batching-orca-vllm-chunked-prefill-goodput/</link><pubDate>Sat, 30 May 2026 16:00:00 +0200</pubDate><guid>https://blog.lo0.es/en/posts/continuous-batching-orca-vllm-chunked-prefill-goodput/</guid><description>&lt;blockquote>
&lt;p>This post complements those on &lt;a href="https://blog.lo0.es/en/posts/kv-cache-working-memory-llm-inference/">KV cache&lt;/a> (the artefact continuous batching manages), &lt;a href="https://blog.lo0.es/en/posts/pagedattention-vllm-block-manager/">PagedAttention&lt;/a> (the memory piece that makes it viable), &lt;a href="https://blog.lo0.es/en/posts/disaggregated-serving-prefill-decode-specialised-pods/">Disaggregated serving&lt;/a> (the next layer of optimisation), &lt;a href="https://blog.lo0.es/en/posts/speculative-decoding-fundamentals-maths-state-of-play/">Speculative decoding&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/multi-lora-serving-shared-base-concurrent-adapters-sgmv-kernel/">Multi-LoRA&lt;/a> and &lt;a href="https://blog.lo0.es/en/posts/moe-inference-fundamentals-expert-parallel-deepseek-economics/">MoE&lt;/a> (the three extensions that coexist with the scheduler in production).&lt;/p>
&lt;/blockquote>
&lt;h2 id="you-are-here-deploy">You are here: DEPLOY&lt;/h2>
&lt;div class="diagram" style="max-width:780px;margin:1rem auto;">
&lt;svg viewBox="0 0 780 90" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="you are here: Deploy">
&lt;style>.box{stroke:#444;stroke-width:1.4;rx:6}.active{fill:#7ad88f;stroke-width:3}.idle{fill:#f4f4f4}.lbl{font:600 12px sans-serif;fill:#222}.arr{stroke:#666;stroke-width:1.4;fill:none;marker-end:url(#cbm)}.cyc{stroke:#888;stroke-width:1.2;fill:none;stroke-dasharray:4 2;marker-end:url(#cbm)}&lt;/style>
&lt;defs>&lt;marker id="cbm" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="#666"/>&lt;/marker>&lt;/defs>
&lt;text x="390" y="20" text-anchor="middle" class="lbl">You are here: DEPLOY · iterative scheduler, one piece below PagedAttention&lt;/text>
&lt;rect x="30" y="35" width="110" height="35" class="box idle"/>&lt;text x="85" y="58" text-anchor="middle" class="lbl">1 · Data&lt;/text>
&lt;rect x="155" y="35" width="110" height="35" class="box idle"/>&lt;text x="210" y="58" text-anchor="middle" class="lbl">2 · Tune&lt;/text>
&lt;rect x="280" y="35" width="110" height="35" class="box idle"/>&lt;text x="335" y="58" text-anchor="middle" class="lbl">3 · Eval&lt;/text>
&lt;rect x="405" y="35" width="110" height="35" class="box active"/>&lt;text x="460" y="58" text-anchor="middle" class="lbl">4 · Deploy&lt;/text>
&lt;rect x="530" y="35" width="110" height="35" class="box idle"/>&lt;text x="585" y="58" text-anchor="middle" class="lbl">5 · Observe&lt;/text>
&lt;rect x="655" y="35" width="110" height="35" class="box idle"/>&lt;text x="710" y="58" text-anchor="middle" class="lbl">6 · Retrain&lt;/text>
&lt;path class="arr" d="M140,52 L155,52"/>&lt;path class="arr" d="M265,52 L280,52"/>&lt;path class="arr" d="M390,52 L405,52"/>&lt;path class="arr" d="M515,52 L530,52"/>&lt;path class="arr" d="M640,52 L655,52"/>
&lt;path class="cyc" d="M710,72 L710,82 L85,82 L85,72"/>
&lt;/svg>
&lt;/div>
&lt;h2 id="tldr">TL;DR&lt;/h2>
&lt;p>The static batching of the original HuggingFace Transformers (the pre-2022 era) systematically under-used the GPU for two structural reasons. First: the scheduling unit was the complete request; the longest one in the batch blocked all the others until it finished (severe head-of-line blocking, P95 TTFT five to ten times worse than reasonable). Second: each batch slot reserved memory for &lt;code>max_seq_len&lt;/code> even though the real output was much shorter; documented padding waste sat between 60 % and 80 % and sustained GPU SM utilisation on real workloads fell to 20-40 %. &lt;strong>Orca&lt;/strong> (Yu et al., OSDI 2022, FriendliAI + Seoul National University) introduced the idea that unjammed everything: the scheduling unit stops being the request and becomes &lt;strong>one decoder iteration&lt;/strong>, a single token. After each iteration the scheduler can add new requests to the batch and remove the finished ones. &lt;strong>vLLM&lt;/strong> (Kwon et al., SOSP 2023, UC Berkeley) materialised it open-source and production-grade thanks to &lt;strong>PagedAttention&lt;/strong>, which solves the KV cache fragmentation that theoretical continuous batching would cause with dynamic allocation. &lt;strong>SARATHI / Sarathi-Serve&lt;/strong> (Microsoft Research India, OSDI 2024) closed the last gap: the prefill &lt;em>stalls&lt;/em> that paused active decodes when a new request arrived, via &lt;strong>chunked prefill&lt;/strong> (splitting a long prefill into small chunks and mixing them with decodes in the same step) and &lt;em>stall-free batching&lt;/em>. &lt;strong>DistServe&lt;/strong> (Zhong et al., OSDI 2024) reformulated the key metric: what matters is &lt;strong>goodput&lt;/strong> (requests/s &lt;strong>meeting the TTFT and TPOT SLOs&lt;/strong>), not raw throughput. In May 2026, vLLM v1 brings a unified scheduler with chunked prefill always-on; SGLang adds RadixAttention, which gives cross-request prefix-cache hits; TensorRT-LLM calls it &lt;em>in-flight batching&lt;/em>; llama.cpp supports it natively. The three operational tensions are speculative decoding (nested raggedness), multi-LoRA (each request with its adapter) and MoE (each expert sees very few tokens per step at a typical batch size). This post takes apart the mechanism, the maths (GPU utilisation, goodput vs throughput), the three variants (Orca → vLLM → Sarathi-Serve), the pitfalls (preempt-on-OOM, starvation, inverse HoL) and the real numbers with production configurations.&lt;/p>
&lt;h2 id="the-analogy-the-salon-with-8-chairs">The analogy: the salon with 8 chairs&lt;/h2>
&lt;p>A hair salon with 8 chairs and a single brilliant stylist who moves between them. Customers arrive with very different needs: some want a 15-minute cut, others a 2-hour colour with a base, others a 90-minute straightening. The question is how to organise the flow.&lt;/p>
&lt;p>The &lt;strong>traditional strategy&lt;/strong> (what HuggingFace Transformers did in its original &lt;code>generate()&lt;/code>) is to seat 8 customers at once, all at the same time, and accept nobody new until the last one finishes. If one of those 8 is a 2-hour job, the 7 who wanted the 15-minute cut sit there doing nothing for 1 hour and 45 minutes. The stylist finishes with the quick ones and is left staring at empty chairs until the colour is done. When everyone is ready, another 8 come in. That is &lt;strong>static batching&lt;/strong>, and the only thing that stops it from being worse is that the GPU does not complain like a human customer.&lt;/p>
&lt;p>The &lt;strong>continuous strategy&lt;/strong> (Orca, vLLM) changes the scheduling unit. The stylist does not think &amp;ldquo;I am going to do one whole customer and then the next&amp;rdquo;; he thinks &amp;ldquo;on each &lt;strong>tick&lt;/strong> I take one step of work at every occupied chair and, every time a chair frees up, I call the next customer in the queue without waiting for the others to finish&amp;rdquo;. The quick-cut customer leaves after 15 minutes, his chair is filled immediately with the next one, and the slow jobs proceed at their own pace without delaying anyone. The stylist is never idle.&lt;/p>
&lt;p>The &lt;strong>continuous strategy with chunked prefill&lt;/strong> (SARATHI / Sarathi-Serve) adds a subtler distinction. Some customers need a long initial phase (a 10-minute hair analysis before the cut; in LLM terms, the &lt;em>prefill&lt;/em> of the prompt). Without chunked prefill, the stylist had to stop all the other chairs to do the new customer&amp;rsquo;s analysis in one go, and that was a &lt;em>stall&lt;/em> visible in the TPOT of the active ones. With chunked prefill, the analysis is split into 2-minute pieces interleaved between the other customers&amp;rsquo; active cuts. The customers already under way no longer notice pauses; the new customer takes slightly longer to start his cut proper, but the whole salon does not freeze.&lt;/p>
&lt;p>And the metric that matters: the owner does not want to maximise &amp;ldquo;customers served per hour&amp;rdquo; at the cost of some leaving furious. He wants to maximise &amp;ldquo;customers served per hour within the time SLA&amp;rdquo;, and that is &lt;strong>goodput&lt;/strong>, DistServe&amp;rsquo;s contribution.&lt;/p>
&lt;h2 id="the-problem-continuous-batching-solves">The problem continuous batching solves&lt;/h2>
&lt;p>There are two structural pathologies of static batching that deserve to be explained with concrete numbers.&lt;/p>
&lt;p>&lt;strong>Padding waste.&lt;/strong> Each batch slot reserved memory for &lt;code>max_seq_len&lt;/code> (prompt + max output), even though the real output ended in far fewer tokens. For a batch of 32 with heterogeneously distributed output lengths (half of them ≤50 tokens, a long tail up to 4,000), the typical memory waste was 60-80 %. That translated directly into wasted concurrency: with the same VRAM, instead of serving 32 requests with smart allocation, you served 8.&lt;/p>
&lt;p>&lt;strong>HoL blocking (Head-of-Line).&lt;/strong> The scheduling unit was the complete request. A batch containing one request of 500 tokens and 31 of ≤50 tokens ran 450 extra &amp;ldquo;empty&amp;rdquo; iterations (the GPU executed forward passes for all 32 slots, even though 31 had already finished). Wasted compute cost: ~84 % of the &lt;em>tail&lt;/em> time in the example.&lt;/p>
&lt;p>&lt;strong>Measurable result.&lt;/strong> Sustained GPU SM utilisation on real workloads under static batching: 20-40 %. That is, ~70 % of the datacenter&amp;rsquo;s compute went unused. When the first Orca and vLLM benchmarks came out showing 10-24× throughput improvement, it was not marketing exaggeration; it was recovering all that wasted compute.&lt;/p>
&lt;h2 id="orca-osdi-22-the-idea-that-changed-everything">Orca (OSDI &amp;lsquo;22): the idea that changed everything&lt;/h2>
&lt;p>The paper by Yu, Jeong, Kim, Kim and Chun at OSDI 2022 (&amp;ldquo;Orca: A Distributed Serving System for Transformer-Based Generative Models&amp;rdquo;, from Seoul National University + FriendliAI) introduced two contributions that have remained the basis of everything that followed.&lt;/p>
&lt;p>&lt;strong>Iteration-level scheduling.&lt;/strong> Instead of scheduling at the level of the complete request, it schedules at the level of &lt;strong>one decoder iteration&lt;/strong>: the step that generates ONE token. After each iteration the scheduler can (a) add new requests to the batch, (b) remove requests that have generated EOS or reached &lt;code>max_tokens&lt;/code>, (c) reorder priorities. The compute engine executes exactly one iteration over the current batch.&lt;/p>
&lt;p>&lt;strong>Selective batching.&lt;/strong> Here is the non-obvious subtlety. The technical problem with batching requests of different lengths and different KV cache states is that some operations (the GEMMs of the Q, K, V projections and the FFN) are insensitive to position and can be batched by concatenating tokens, whereas attention is sensitive to per-request state (each request has its own KV cache of a different length). Orca&amp;rsquo;s solution: batch the GEMMs (concatenate all the step&amp;rsquo;s tokens into a &lt;code>[total_tokens, hidden]&lt;/code> tensor) and run attention sequentially per request.&lt;/p>
&lt;p>Paper result: up to &lt;strong>36.9× throughput&lt;/strong> vs FasterTransformer on GPT-3 175B at the same latency level. Orca is not open-source, it is only documented in the paper. FriendliAI commercialises it as the Friendli Engine. But the idea was published and everyone adopted it.&lt;/p>
&lt;h2 id="vllm-sosp-23-the-open-source-materialisation">vLLM (SOSP &amp;lsquo;23): the open-source materialisation&lt;/h2>
&lt;p>What Orca described as a concept, vLLM materialised in production. The paper by Kwon, Li, Zhuang, Sheng et al. (UC Berkeley Sky Computing Lab, SOSP 2023) introduces &lt;strong>PagedAttention&lt;/strong>, covered in detail in the &lt;a href="https://blog.lo0.es/en/posts/pagedattention-vllm-block-manager/">PagedAttention deep dive&lt;/a>, but it also consolidates continuous batching as universal practice.&lt;/p>
&lt;p>The reason PagedAttention is a prerequisite for practical continuous batching is fragmentation. If you are going to insert and remove requests from the batch dynamically, and each request has a KV cache that grows on every iteration, traditional contiguous allocation fragments the HBM until it is unusable. PagedAttention splits the KV cache into fixed-size blocks (16 tokens by default) allocated on demand from a global pool. Memory waste falls from ~60-80 % to &lt;strong>less than 4 %&lt;/strong> (only the last partially filled block per sequence).&lt;/p>
&lt;p>vLLM paper metrics (2023):&lt;/p>
&lt;ul>
&lt;li>vs HuggingFace Transformers (static, no continuous batching): up to 24× throughput.&lt;/li>
&lt;li>vs HuggingFace TGI (which already had primitive continuous batching): ~3.5×.&lt;/li>
&lt;li>vs FasterTransformer: 2-4× at the same latency.&lt;/li>
&lt;/ul>
&lt;p>What operationally distinguishes vLLM from Orca: vLLM runs attention in a single fused CUDA kernel (&lt;code>paged_attention_kernel&lt;/code>) over non-contiguous blocks; Orca described attention as sequential, request by request. And vLLM exposes OpenAI-compatible APIs that let you drop the engine into existing stacks without touching the client.&lt;/p>
&lt;h2 id="chunked-prefill-sarathi--sarathi-serve-osdi-24">Chunked prefill (SARATHI / Sarathi-Serve, OSDI &amp;lsquo;24)&lt;/h2>
&lt;p>There is a detail the original Orca/vLLM continuous batching did not solve: when a new request enters the batch, its prefill (processing the whole prompt at once) can take hundreds of milliseconds. During that time, the active decodes of the other requests are essentially paused, the GPU being dedicated to the new prefill. This showed up as &lt;strong>spikes in TPOT&lt;/strong> (&amp;ldquo;inter-token latency&amp;rdquo;) every time a long request came in, which broke strict SLAs.&lt;/p>
&lt;p>SARATHI (Agrawal et al., arXiv 2308.16369, August 2023) and later Sarathi-Serve (same group at Microsoft Research India, OSDI 2024, arXiv 2403.02310) introduce two combined ideas:&lt;/p>
&lt;p>&lt;strong>Chunked prefill.&lt;/strong> A long prefill (8,192 tokens, say) is split into chunks (2,048 tokens, say) processed one per iteration. Instead of one 200 ms step processing 8K tokens, four 50 ms steps processing 2K each.&lt;/p>
&lt;p>&lt;strong>Decode-maximal batching (&amp;ldquo;stall-free&amp;rdquo;).&lt;/strong> On each iteration, the scheduler first fills the batch with the active decodes (each costing 1 token), and only the leftover space goes to new prefill chunks. The result: active decodes keep advancing 1 token per iteration without pausing, while the new request completes its prefill in small bites.&lt;/p>
&lt;p>The observation that justifies it: prefill is &lt;strong>compute-bound&lt;/strong> (it processes N tokens at once and saturates FLOPs) while decode is &lt;strong>memory-bound&lt;/strong> (1 token per step, under-using compute, with the GPU waiting on HBM). Mixing prefill chunks with decodes in the same step exploits the arithmetic-intensity slack: the decodes piggyback on the free compute of the prefill chunk.&lt;/p>
&lt;p>Numbers:&lt;/p>
&lt;ul>
&lt;li>Original SARATHI (LLaMA-13B on an A6000): decode throughput +10×, end-to-end +1.33×.&lt;/li>
&lt;li>Sarathi-Serve (Mistral-7B on an A100): 2.6× serving capacity vs plain vLLM. Yi-34B on 2×A100: 3.7×. Falcon-180B with pipeline parallel: 5.6×.&lt;/li>
&lt;/ul>
&lt;p>Adoption in May 2026: &lt;strong>always-on&lt;/strong> in vLLM v1 (default since v0.8.0, January 2025), SGLang, TensorRT-LLM. The key setting in vLLM is &lt;code>--max-num-batched-tokens&lt;/code> (the token budget per step; default 2048). Raising it prioritises throughput, lowering it prioritises low TPOT.&lt;/p>
&lt;h2 id="goodput-the-metric-that-matters-distserve-osdi-24">Goodput: the metric that matters (DistServe, OSDI &amp;lsquo;24)&lt;/h2>
&lt;p>The classic &amp;ldquo;throughput&amp;rdquo; metric (requests/s or tokens/s) has a problem when there are SLOs. A server can report 1,000 req/s while P99 TTFT is 30 seconds and the SLO is 1 second, so only about 200 req/s actually meet the contract.&lt;/p>
&lt;p>&lt;strong>DistServe&lt;/strong> (Zhong et al., OSDI 2024) formalises &lt;strong>goodput&lt;/strong> as the right metric: &lt;code>goodput = max sustained request rate meeting the SLOs (TTFT bound AND TPOT bound)&lt;/code>. The practical definition is usually: maximum rate with ≥90 % of requests within both SLOs.&lt;/p>
&lt;p>Why it matters for the scheduler:&lt;/p>
&lt;ul>
&lt;li>Optimising raw throughput leads to maximising batch size, which inflates P99 TPOT.&lt;/li>
&lt;li>Optimising goodput limits the batch size when TPOT starts violating the SLO, prefers small requests if the batch already has a tail, and leaves resources available for new requests.&lt;/li>
&lt;/ul>
&lt;p>DistServe result: up to &lt;strong>7.4× more requests served&lt;/strong> or a &lt;strong>12.6× tighter SLO&lt;/strong> vs vLLM at the same SLO attainment. The gain comes from &lt;strong>disaggregating prefill and decode onto different GPUs&lt;/strong> (removing the interference between phases), but the idea of optimising for goodput is independent and applicable to any scheduler.&lt;/p>
&lt;p>Operationally this translates into monitoring:&lt;/p>
&lt;pre tabindex="0">&lt;code>goodput_proxy = histogram_quantile(0.95, vllm:time_to_first_token_seconds_bucket) &amp;lt; SLO_TTFT
AND histogram_quantile(0.95, vllm:time_per_output_token_seconds_bucket) &amp;lt; SLO_TPOT
&lt;/code>&lt;/pre>&lt;h2 id="the-iterative-scheduler-in-action">The iterative scheduler in action&lt;/h2>
&lt;div class="diagram" style="max-width:780px;margin:1.5rem auto;">
&lt;svg viewBox="0 0 780 320" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Continuous batching scheduler timeline">
&lt;style>
.req1{fill:#cdebd0;stroke:#2a7a40;stroke-width:1.2;rx:3}
.req2{fill:#d4ecff;stroke:#1f5fa8;stroke-width:1.2;rx:3}
.req3{fill:#fff4d6;stroke:#a48000;stroke-width:1.2;rx:3}
.req4{fill:#f6caca;stroke:#a52a2a;stroke-width:1.2;rx:3}
.req5{fill:#e6d0ff;stroke:#5a2db0;stroke-width:1.2;rx:3}
.req6{fill:#f6e0c8;stroke:#a76b1f;stroke-width:1.2;rx:3}
.empty{fill:#f0f0f0;stroke:#999;stroke-width:1;stroke-dasharray:3 2;rx:3}
.pre{fill:#ffd76b;stroke:#a48000;stroke-width:1.2;rx:3}
.lbl{font:600 11px sans-serif;fill:#222}
.sub{font:400 9px sans-serif;fill:#555}
.tick{stroke:#444;stroke-width:1}
&lt;/style>
&lt;text x="20" y="20" class="lbl">Static batching — 4 slots, padding to max_len, new req arrives → waits&lt;/text>
&lt;text x="20" y="38" class="sub">slot 1&lt;/text>
&lt;rect x="60" y="30" width="200" height="14" class="req1"/>
&lt;rect x="260" y="30" width="200" height="14" class="empty"/>
&lt;rect x="460" y="30" width="80" height="14" class="req5"/>
&lt;rect x="540" y="30" width="200" height="14" class="empty"/>
&lt;text x="20" y="58" class="sub">slot 2&lt;/text>
&lt;rect x="60" y="50" width="80" height="14" class="req2"/>
&lt;rect x="140" y="50" width="320" height="14" class="empty"/>
&lt;rect x="460" y="50" width="200" height="14" class="req6"/>
&lt;rect x="660" y="50" width="80" height="14" class="empty"/>
&lt;text x="20" y="78" class="sub">slot 3&lt;/text>
&lt;rect x="60" y="70" width="400" height="14" class="req3"/>
&lt;rect x="460" y="70" width="280" height="14" class="empty"/>
&lt;text x="20" y="98" class="sub">slot 4&lt;/text>
&lt;rect x="60" y="90" width="120" height="14" class="req4"/>
&lt;rect x="180" y="90" width="280" height="14" class="empty"/>
&lt;rect x="460" y="90" width="100" height="14" class="req5"/>
&lt;rect x="560" y="90" width="180" height="14" class="empty"/>
&lt;line x1="460" y1="20" x2="460" y2="115" class="tick" stroke-dasharray="2 2"/>
&lt;text x="465" y="115" class="sub">batch recycled only when ALL finish ↑&lt;/text>
&lt;text x="20" y="155" class="lbl">Continuous batching — a free slot is refilled IMMEDIATELY on each tick&lt;/text>
&lt;text x="20" y="173" class="sub">slot 1&lt;/text>
&lt;rect x="60" y="165" width="200" height="14" class="req1"/>
&lt;rect x="260" y="165" width="200" height="14" class="req5"/>
&lt;rect x="460" y="165" width="160" height="14" class="req6"/>
&lt;rect x="620" y="165" width="120" height="14" class="empty"/>
&lt;text x="20" y="193" class="sub">slot 2&lt;/text>
&lt;rect x="60" y="185" width="80" height="14" class="req2"/>
&lt;rect x="140" y="185" width="150" height="14" class="req5"/>
&lt;rect x="290" y="185" width="200" height="14" class="req6"/>
&lt;rect x="490" y="185" width="250" height="14" class="req4"/>
&lt;text x="20" y="213" class="sub">slot 3&lt;/text>
&lt;rect x="60" y="205" width="400" height="14" class="req3"/>
&lt;rect x="460" y="205" width="160" height="14" class="req6"/>
&lt;rect x="620" y="205" width="120" height="14" class="req4"/>
&lt;text x="20" y="233" class="sub">slot 4&lt;/text>
&lt;rect x="60" y="225" width="120" height="14" class="req4"/>
&lt;rect x="180" y="225" width="180" height="14" class="req5"/>
&lt;rect x="360" y="225" width="200" height="14" class="req6"/>
&lt;rect x="560" y="225" width="180" height="14" class="req3"/>
&lt;text x="60" y="252" class="sub">each coloured bar = 1 decoder iteration (1 token) of a request&lt;/text>
&lt;text x="20" y="280" class="lbl">Chunked prefill — new prefill interleaved with active decodes (no stall)&lt;/text>
&lt;text x="60" y="300" class="sub">prefill chunk 1&lt;/text>
&lt;rect x="150" y="290" width="60" height="14" class="pre"/>
&lt;text x="220" y="300" class="sub">decode tick, active reqs&lt;/text>
&lt;rect x="340" y="290" width="60" height="14" class="req1"/>
&lt;rect x="400" y="290" width="60" height="14" class="req2"/>
&lt;rect x="460" y="290" width="60" height="14" class="req3"/>
&lt;rect x="520" y="290" width="60" height="14" class="pre"/>
&lt;text x="585" y="300" class="sub">prefill chunk 2 (same step as the decodes)&lt;/text>
&lt;/svg>
&lt;/div>
&lt;h2 id="the-maths-that-matter">The maths that matter&lt;/h2>
&lt;p>Three formulas explain much of the operational behaviour.&lt;/p>
&lt;p>&lt;strong>GPU utilisation under static batching.&lt;/strong> With a batch of size &lt;code>B&lt;/code> whose &lt;code>seq_len_i&lt;/code> are the real lengths and &lt;code>max(seq_len_i)&lt;/code> is the length that defines the padding:&lt;/p>
$$U_{\text{static}} = \frac{\sum_i \text{seq len}_i}{B \cdot \max_i \text{seq len}_i}$$
&lt;p>For &lt;code>B=32&lt;/code>, 30 sequences of 50 tokens and 2 of 500: &lt;code>U = (30·50 + 2·500) / (32·500) = 2500/16000 = 15.6 %&lt;/code>. Four out of every five GPU cycles wasted.&lt;/p>
&lt;p>&lt;strong>GPU utilisation under continuous batching (idealised).&lt;/strong>&lt;/p>
$$U_{\text{continuous}} \approx 1 - \frac{T_{\text{scheduler}}}{T_{\text{iteration}}}$$
&lt;p>With scheduler overhead of ~50-200 µs and an iteration time of ~10-30 ms: &lt;code>U &amp;gt; 95 %&lt;/code>. The unit of loss is no longer padding, it is scheduling overhead, and that is negligible compared with the forward pass.&lt;/p>
&lt;p>&lt;strong>Goodput vs throughput.&lt;/strong>&lt;/p>
$$\text{Goodput}(R) = R \cdot P(\text{latency} &lt; \text{SLO})$$
&lt;p>where &lt;code>R&lt;/code> is the offered request rate. Typical curve: goodput grows linearly with &lt;code>R&lt;/code> up to the saturation knee, then falls because &lt;code>P(SLO)&lt;/code> collapses when the system congests. The optimal point is just before the knee, not at peak throughput.&lt;/p>
&lt;p>Example: at &lt;code>R=100 req/s&lt;/code> with &lt;code>P(SLO)=0.99&lt;/code>, goodput = 99. At &lt;code>R=200 req/s&lt;/code> with &lt;code>P(SLO)=0.4&lt;/code>, goodput = 80. &lt;strong>More offered load, less useful goodput&lt;/strong>.&lt;/p>
&lt;p>&lt;strong>Chunked prefill token budget.&lt;/strong> On each vLLM step with chunked prefill active:&lt;/p>
$$\text{prefill tokens this step} = \text{max num batched tokens} - \text{num decodes active}$$
&lt;p>Each active decode costs 1 token of the budget; the rest is filled with new prefill chunks. If &lt;code>max_num_batched_tokens = 2048&lt;/code> and &lt;code>num_decodes_active = 200&lt;/code>, there are 1,848 tokens for prefill (one chunk of 1,848 or several small chunks).&lt;/p>
&lt;h2 id="real-implementations-in-may-2026">Real implementations in May 2026&lt;/h2>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Engine&lt;/th>
&lt;th>Current scheduler V&lt;/th>
&lt;th>Chunked prefill default&lt;/th>
&lt;th>Relevant notes&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;strong>vLLM v1&lt;/strong> (default ≥0.8.0)&lt;/td>
&lt;td>unified V1&lt;/td>
&lt;td>always-on&lt;/td>
&lt;td>EngineCore isolated in a separate process; prefix caching with O(1) eviction; preempt-mode &lt;code>recompute&lt;/code> by default; xgrammar/outlines backends.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>SGLang&lt;/strong>&lt;/td>
&lt;td>own (PyTorch ecosystem)&lt;/td>
&lt;td>yes&lt;/td>
&lt;td>&lt;strong>RadixAttention&lt;/strong> gives cross-request prefix-cache hits; non-blocking CPU scheduler; leader in stable latency at high concurrency.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>TensorRT-LLM&lt;/strong>&lt;/td>
&lt;td>proprietary &amp;ldquo;in-flight batching&amp;rdquo;&lt;/td>
&lt;td>yes&lt;/td>
&lt;td>Policies &lt;code>GUARANTEED_NO_EVICT&lt;/code> (conservative, default) and &lt;code>MAX_UTILIZATION&lt;/code> (aggressive, risk of a pause when the KV is full). Compile-time vs runtime.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Triton + tensorrtllm_backend&lt;/strong>&lt;/td>
&lt;td>&lt;code>gpt_model_type: inflight_fused_batching&lt;/code>&lt;/td>
&lt;td>yes&lt;/td>
&lt;td>&lt;code>max_queue_delay_microseconds&lt;/code> to group newly arrived requests. Decoupled mode for SSE streaming.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>llama.cpp&lt;/strong> (llama-server)&lt;/td>
&lt;td>own&lt;/td>
&lt;td>&lt;code>--cont-batching&lt;/code> ON since 2024&lt;/td>
&lt;td>&lt;code>-np N&lt;/code> parallel slots; no PagedAttention (contiguous KV per slot), so less flexible but simpler. Endpoint &lt;code>:8080/metrics&lt;/code>.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>A typical production-ready vLLM v1 configuration:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">vllm serve meta-llama/Llama-3.1-70B-Instruct &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --tensor-parallel-size &lt;span class="m">4&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --max-num-batched-tokens &lt;span class="m">4096&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --max-num-seqs &lt;span class="m">256&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --enable-chunked-prefill &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --enable-prefix-caching &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --preemption-mode recompute &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --scheduling-policy fcfs &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --gpu-memory-utilization 0.92
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>SGLang equivalent:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">python -m sglang.launch_server &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --model meta-llama/Llama-3.1-70B-Instruct &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --tp &lt;span class="m">4&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --chunked-prefill-size &lt;span class="m">4096&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --max-running-requests &lt;span class="m">256&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --enable-radix-cache
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="the-three-operational-tensions">The three operational tensions&lt;/h2>
&lt;p>&lt;strong>Continuous batching + speculative decoding.&lt;/strong> Speculative decoding produces 1 to &lt;code>γ+1&lt;/code> tokens per step depending on the acceptance rate. The batch stops being uniform in tokens produced per iteration: &lt;em>nested raggedness&lt;/em>. PagedAttention absorbs it (the KV cache can grow at different rates per request in the same step), but the scheduler loses symmetry. At low QPS (a conversational assistant) the combination is excellent: vLLM reports up to &lt;strong>2.8× speedup&lt;/strong>. At high QPS, the draft consumes slots from the decode pool and can &lt;em>reduce&lt;/em> aggregate goodput. Rule of thumb: disable speculative decoding when &lt;code>gpu_cache_usage &amp;gt; 0.85&lt;/code>. Full detail in &lt;a href="https://blog.lo0.es/en/posts/speculative-decoding-fundamentals-maths-state-of-play/">Speculative decoding&lt;/a>.&lt;/p>
&lt;p>&lt;strong>Continuous batching + multi-LoRA.&lt;/strong> Each request in the batch can use a different adapter (via SGMV, see &lt;a href="https://blog.lo0.es/en/posts/multi-lora-serving-shared-base-concurrent-adapters-sgmv-kernel/">Multi-LoRA serving&lt;/a>). Worst case: every request in the batch with a different adapter and a different rank, and throughput falls by up to 50 % vs the base with no LoRA. Best case: all requests on the same adapter, equivalent to the base with no LoRA. Practical mitigation: group adapters by rank in the routing ahead of the engine; set &lt;code>--max-lora-rank&lt;/code> to the maximum actually served, not generously above it.&lt;/p>
&lt;p>&lt;strong>Continuous batching + MoE.&lt;/strong> Each expert sees &lt;code>batch · k / N&lt;/code> tokens per step. With DeepSeek-V3 (256 experts, k=8) and batch=32 in decode, each expert processes only 1 token on average: total compute starvation. To match the per-GPU throughput of a dense model, MoE needs batches &lt;strong>&amp;raquo;10× larger&lt;/strong>, which puts pressure on the KV cache. &lt;strong>Wide-EP&lt;/strong> (see &lt;a href="https://blog.lo0.es/en/posts/moe-inference-fundamentals-expert-parallel-deepseek-economics/">MoE inference&lt;/a>) distributes the experts across many GPUs and allows larger effective batches per expert, at the cost of all-to-all comms that add milliseconds per step.&lt;/p>
&lt;h2 id="metrics-to-monitor">Metrics to monitor&lt;/h2>
&lt;p>The Prometheus metrics exposed by vLLM (prefix &lt;code>vllm:&lt;/code>, &lt;code>vllm_&lt;/code> when scraped):&lt;/p>
&lt;ul>
&lt;li>&lt;code>vllm:time_to_first_token_seconds&lt;/code> (Histogram) — TTFT including queue time.&lt;/li>
&lt;li>&lt;code>vllm:time_per_output_token_seconds&lt;/code> (Histogram) — TPOT.&lt;/li>
&lt;li>&lt;code>vllm:e2e_request_latency_seconds&lt;/code> (Histogram) — end-to-end.&lt;/li>
&lt;li>&lt;code>vllm:num_requests_running&lt;/code> (Gauge) — active batch.&lt;/li>
&lt;li>&lt;code>vllm:num_requests_waiting&lt;/code> (Gauge) — queue depth.&lt;/li>
&lt;li>&lt;code>vllm:num_requests_swapped&lt;/code> (Gauge) — preempted to CPU.&lt;/li>
&lt;li>&lt;code>vllm:gpu_cache_usage_perc&lt;/code> (Gauge) — fraction of KV cache occupied.&lt;/li>
&lt;li>&lt;code>vllm:gpu_prefix_cache_hit_rate&lt;/code> (Gauge) — prefix cache hits.&lt;/li>
&lt;li>&lt;code>vllm:num_preemptions_total&lt;/code> (Counter) — preemptions. Any sustained value is a red flag.&lt;/li>
&lt;/ul>
&lt;p>Practical operational rules:&lt;/p>
&lt;ul>
&lt;li>Stable zone under sustained load: &lt;code>gpu_cache_usage_perc ∈ [0.7, 0.9]&lt;/code>.&lt;/li>
&lt;li>Warning at &lt;code>&amp;gt;0.95&lt;/code> (preemption imminent).&lt;/li>
&lt;li>Critical if &lt;code>num_requests_waiting&lt;/code> grows faster than &lt;code>num_requests_running&lt;/code>: the server is not absorbing the load; scale out.&lt;/li>
&lt;/ul>
&lt;h2 id="operational-pitfalls">Operational pitfalls&lt;/h2>
&lt;p>&lt;strong>Preempt-on-OOM.&lt;/strong> When &lt;code>gpu_cache_usage&lt;/code> reaches ~1.0 with pending requests that need to grow their KV, vLLM preempts. V1 does &lt;code>RECOMPUTE&lt;/code> by default (discards the KV, regenerates it on return); V0 did &lt;code>SWAP&lt;/code> (moves it to CPU). &lt;code>RECOMPUTE&lt;/code> is better for short sequences (cheap to regenerate); &lt;code>SWAP&lt;/code> is better for long ones. The &lt;code>vllm:num_preemptions_total&lt;/code> metric should be zero or near zero in steady state.&lt;/p>
&lt;p>&lt;strong>Inverse HoL blocking (memory monopoly).&lt;/strong> A very long request occupies many KV blocks, so small requests do not fit in the batch even though compute is free. Chunked prefill mitigates the compute blocking during a new prefill, but it does not solve the memory monopoly. Partial solution: per-request limit policies (an aggressive &lt;code>max_tokens&lt;/code>) or priorities.&lt;/p>
&lt;p>&lt;strong>Starvation.&lt;/strong> FCFS can leave requests pending for a long time if the active ones do not finish. vLLM supports &lt;code>--scheduling-policy priority&lt;/code> with an &lt;code>x-priority&lt;/code> header. Recent work (NeurIPS 2024 &lt;em>Efficient LLM Scheduling by Learning to Rank&lt;/em>, arXiv:2501.14312 &lt;em>Locality-aware Fair Scheduling&lt;/em>) proposes schedulers with quantum-based starvation prevention; not yet integrated into vLLM mainline.&lt;/p>
&lt;p>&lt;strong>Badly calibrated chunk size.&lt;/strong> A small chunk (512) gives low TPOT, high TTFT and memory overhead from more KV accesses. A large chunk (8192+) gives low TTFT and TPOT spikes during the chunk. Rule: start at 2,048, measure P95 TPOT, adjust.&lt;/p>
&lt;p>&lt;strong>Batch size cap.&lt;/strong> A high &lt;code>--max-num-seqs&lt;/code> gives more concurrency but P99 TPOT explodes. A low one wastes throughput. Rule of thumb: &lt;code>max_num_seqs ≈ HBM_for_KV / (avg_seq_len × bytes_per_token_KV)&lt;/code>.&lt;/p>
&lt;h2 id="implications-for-on-premise-hardware">Implications for on-premise hardware&lt;/h2>
&lt;p>&lt;strong>On an RTX 4090 (24 GB).&lt;/strong> llama.cpp with &lt;code>--cont-batching -np 4-8&lt;/code> is the natural pattern. Typical models: Llama 3 8B Q4_K_M with ~8 parallel slots, aggregate throughput on the order of hundreds of tok/s. vLLM also works if the weights fit (Llama 3 8B BF16 does; the 70B does not fit whole), although PagedAttention on consumer hardware gives less return than in the datacenter.&lt;/p>
&lt;p>&lt;strong>On a generic 4×H100 SXM cluster (320 GB, NVLink).&lt;/strong> Here vLLM v1 / SGLang are the de facto standard. Typical configurations:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Llama 3 70B FP8 + TP=4&lt;/strong>: dozens of concurrent sessions with P95 TPOT under 50 ms, tens of thousands of aggregate tok/s at a moderate batch size.&lt;/li>
&lt;li>&lt;strong>Llama 3 70B AWQ-INT4 + TP=2&lt;/strong> plus the rest of the cluster for additional concurrency or multi-LoRA with SGMV.&lt;/li>
&lt;li>&lt;strong>DeepSeek-V3&lt;/strong> needs larger setups (8-16 H100) to fit whole in FP8; with Wide-EP, continuous batching starts operating on much larger batches and the economics change (see MoE).&lt;/li>
&lt;/ul>
&lt;p>The rule of thumb for May 2026: &lt;strong>vLLM v1 with chunked prefill always-on and prefix caching enabled is the sensible default configuration for any dense model that fits comfortably; SGLang offers better stable latency at high concurrency thanks to the overlap between the CPU scheduler and the GPU step; TensorRT-LLM gives peak throughput at high concurrency with the rigidity of compile-time&lt;/strong>.&lt;/p>
&lt;h2 id="what-we-have-not-covered">What we have not covered&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Locality-aware fair scheduling&lt;/strong> (arXiv:2501.14312) and learning-to-rank schedulers (NeurIPS 2024): the next generation of algorithms closing the fairness vs prefix-cache locality trade-off.&lt;/li>
&lt;li>&lt;strong>Smooth goodput&lt;/strong> (arXiv:2410.14257): a refinement of the DistServe metric using max slowdown instead of a binary SLO.&lt;/li>
&lt;li>&lt;strong>Triton tensorrtllm_backend in production&lt;/strong>: decoupled mode for streaming, ensembles with pre/post-processing, autoscaling with KServe.&lt;/li>
&lt;li>&lt;strong>vLLM speculators v0.3.0&lt;/strong> and the vLLM-compatible drafter training framework.&lt;/li>
&lt;/ul>
&lt;h2 id="see-also">See also&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/vllm-scheduler-step-maitre-d-each-round/">The pass: the vLLM scheduler step&lt;/a> — the concrete algorithm implementing this batching: the &lt;code>{request: number of tokens}&lt;/code> dictionary assembled on each iteration, the &lt;code>max-num-batched-tokens&lt;/code> budget and preemption by RECOMPUTE.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/kv-cache-working-memory-llm-inference/">KV cache: the working memory&lt;/a> — the artefact continuous batching manages; without understanding it you cannot see why the minimum unit is the decoder iteration.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/pagedattention-vllm-block-manager/">PagedAttention deep dive&lt;/a> — the memory piece without which dynamic continuous batching would fragment the HBM; a deep dive into the block manager.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/disaggregated-serving-prefill-decode-specialised-pods/">Disaggregated serving: prefill and decode in specialised pods&lt;/a> — the next layer: when continuous batching is already squeezed dry, separating prefill and decode gives another round of improvements (origin of the DistServe paper that contributes the concept of goodput).&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/speculative-decoding-fundamentals-maths-state-of-play/">Speculative decoding&lt;/a> — the scheduler&amp;rsquo;s first operational tension: each request in the batch can produce 1 to γ+1 tokens per step.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/multi-lora-serving-shared-base-concurrent-adapters-sgmv-kernel/">Multi-LoRA serving&lt;/a> — the second tension: heterogeneous batching with SGMV lets each request use its own adapter, but the scheduler has to group by rank to keep throughput up.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/moe-inference-fundamentals-expert-parallel-deepseek-economics/">MoE inference&lt;/a> — the third tension: each expert sees very few tokens per step at a typical batch size, forcing much larger batches than in dense models.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/six-stage-llmops-pipeline-architecture-and-deep-dive/">The six-stage LLMOps pipeline&lt;/a> — the master map in which Deploy is stage 4.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/capacity-planning-on-premise-llm-inference/">Capacity planning for on-premise LLM inference&lt;/a> — the DistServe goodput that appears here is exactly the metric that closes the crossing of VRAM budget × time budget in sizing.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/gpu-observability-llm-inference-twelve-dcgm-vllm-metrics/">GPU observability for LLM inference&lt;/a> — the &lt;code>vllm:num_requests_running&lt;/code>, &lt;code>num_requests_waiting&lt;/code> and &lt;code>gpu_cache_usage_perc&lt;/code> metrics that come from the iterative scheduler are the operational cockpit of the engine in production.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/optimising-prefill-vllm-knobs-ttft-will-not-forgive/">Optimising prefill in vLLM&lt;/a> — chunked prefill translates iterative scheduling into concrete parameters: &lt;code>--max-num-batched-tokens&lt;/code> is the budget the scheduler splits between prefill chunks and decode tokens per step.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/optimising-decode-vllm-squeezing-every-token-small-hardware/">Optimising decode in vLLM&lt;/a> — &lt;code>--max-num-seqs&lt;/code> and &lt;code>--gpu-memory-utilization&lt;/code> are the two dials that determine how many decode slots the scheduler can keep before queueing.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/llm-inference-autoscaling-kubernetes-hpa-keda/">LLM autoscaling on Kubernetes&lt;/a> — the scheduler queue (&lt;code>num_requests_waiting&lt;/code>) is the primary metric for HPA with KEDA on an on-premise cluster.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/sms-cuda-streams-cuda-graphs-inference/">SMs, CUDA streams and CUDA graphs&lt;/a> — batching is precisely what amortises the memory bottleneck of decode and exposes the launch bottleneck; that is why batching and CUDA graphs reinforce each other.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/llm-serving-engines-pareto-frontier-comparison/">Serving engine comparison (vLLM/SGLang/TRT-LLM/Dynamo)&lt;/a> — where the implementation differences in continuous batching between engines land: the real goodput of vLLM vs SGLang vs TRT-LLM measured with the same harness.&lt;/li>
&lt;/ul>
&lt;h2 id="references">References&lt;/h2>
&lt;ul>
&lt;li>Yu, G.-I., Jeong, J., Kim, G.-W., Kim, S., Chun, B.-G. &lt;em>Orca: A Distributed Serving System for Transformer-Based Generative Models&lt;/em>. OSDI 2022. &lt;a href="https://www.usenix.org/system/files/osdi22-yu.pdf">https://www.usenix.org/system/files/osdi22-yu.pdf&lt;/a>&lt;/li>
&lt;li>Kwon, W. et al. &lt;em>Efficient Memory Management for Large Language Model Serving with PagedAttention&lt;/em>. SOSP 2023. &lt;a href="https://arxiv.org/abs/2309.06180">https://arxiv.org/abs/2309.06180&lt;/a>&lt;/li>
&lt;li>Agrawal, A. et al. &lt;em>SARATHI: Efficient LLM Inference by Piggybacking Decodes with Chunked Prefills&lt;/em>. 2023. &lt;a href="https://arxiv.org/abs/2308.16369">https://arxiv.org/abs/2308.16369&lt;/a>&lt;/li>
&lt;li>Agrawal, A. et al. &lt;em>Taming Throughput-Latency Tradeoff in LLM Inference with Sarathi-Serve&lt;/em>. OSDI 2024. &lt;a href="https://arxiv.org/abs/2403.02310">https://arxiv.org/abs/2403.02310&lt;/a>&lt;/li>
&lt;li>Zhong, Y. et al. &lt;em>DistServe: Disaggregating Prefill and Decoding for Goodput-optimized Large Language Model Serving&lt;/em>. OSDI 2024. &lt;a href="https://arxiv.org/abs/2401.09670">https://arxiv.org/abs/2401.09670&lt;/a>&lt;/li>
&lt;li>Sheng, Y. et al. &lt;em>S-LoRA: Serving Thousands of Concurrent LoRA Adapters&lt;/em>. MLSys 2024. &lt;a href="https://arxiv.org/abs/2311.03285">https://arxiv.org/abs/2311.03285&lt;/a>&lt;/li>
&lt;li>&lt;em>Efficient LLM Scheduling by Learning to Rank&lt;/em>. NeurIPS 2024.&lt;/li>
&lt;li>&lt;em>Locality-aware Fair Scheduling&lt;/em>. 2025. &lt;a href="https://arxiv.org/abs/2501.14312">https://arxiv.org/abs/2501.14312&lt;/a>&lt;/li>
&lt;li>vLLM V1 alpha release (Jan 2025): &lt;a href="https://blog.vllm.ai/2025/01/27/v1-alpha-release.html">https://blog.vllm.ai/2025/01/27/v1-alpha-release.html&lt;/a>&lt;/li>
&lt;li>vLLM Anatomy (Sep 2025): &lt;a href="https://blog.vllm.ai/2025/09/05/anatomy-of-vllm.html">https://blog.vllm.ai/2025/09/05/anatomy-of-vllm.html&lt;/a>&lt;/li>
&lt;li>vLLM Large-Scale Serving (Dec 2025): &lt;a href="https://blog.vllm.ai/2025/12/17/large-scale-serving.html">https://blog.vllm.ai/2025/12/17/large-scale-serving.html&lt;/a>&lt;/li>
&lt;li>vLLM speculators v0.3.0 (Dec 2025): &lt;a href="https://blog.vllm.ai/2025/12/13/speculators-v030.html">https://blog.vllm.ai/2025/12/13/speculators-v030.html&lt;/a>&lt;/li>
&lt;li>Anyscale, &lt;em>Continuous Batching for LLM Inference&lt;/em> (2023): &lt;a href="https://www.anyscale.com/blog/continuous-batching-llm-inference">https://www.anyscale.com/blog/continuous-batching-llm-inference&lt;/a>&lt;/li>
&lt;li>vLLM metrics docs: &lt;a href="https://docs.vllm.ai/en/latest/design/metrics/">https://docs.vllm.ai/en/latest/design/metrics/&lt;/a>&lt;/li>
&lt;li>vLLM optimization: &lt;a href="https://docs.vllm.ai/en/stable/configuration/optimization/">https://docs.vllm.ai/en/stable/configuration/optimization/&lt;/a>&lt;/li>
&lt;li>SGLang: &lt;a href="https://github.com/sgl-project/sglang">https://github.com/sgl-project/sglang&lt;/a>&lt;/li>
&lt;li>TensorRT-LLM performance tuning: &lt;a href="https://nvidia.github.io/TensorRT-LLM/performance/performance-tuning-guide/tuning-max-batch-size-and-max-num-tokens.html">https://nvidia.github.io/TensorRT-LLM/performance/performance-tuning-guide/tuning-max-batch-size-and-max-num-tokens.html&lt;/a>&lt;/li>
&lt;li>Red Hat, &lt;em>5 steps to triage vLLM performance&lt;/em> (Mar 2026): &lt;a href="https://developers.redhat.com/articles/2026/03/09/5-steps-triage-vllm-performance">https://developers.redhat.com/articles/2026/03/09/5-steps-triage-vllm-performance&lt;/a>&lt;/li>
&lt;li>NVIDIA blog, &lt;em>Chunked Prefill with TensorRT-LLM&lt;/em>: &lt;a href="https://developer.nvidia.com/blog/streamlining-ai-inference-performance-and-deployment-with-nvidia-tensorrt-llm-chunked-prefill/">https://developer.nvidia.com/blog/streamlining-ai-inference-performance-and-deployment-with-nvidia-tensorrt-llm-chunked-prefill/&lt;/a>&lt;/li>
&lt;/ul></description></item><item><title>MoE inference: the call centre with 256 specialists and 8 taking each call — fundamentals, expert parallel and the economics of DeepSeek-V3</title><link>https://blog.lo0.es/en/posts/moe-inference-fundamentals-expert-parallel-deepseek-economics/</link><pubDate>Sat, 30 May 2026 08:00:00 +0200</pubDate><guid>https://blog.lo0.es/en/posts/moe-inference-fundamentals-expert-parallel-deepseek-economics/</guid><description>&lt;blockquote>
&lt;p>This post goes into an architectural decision in the Deploy stage of the &lt;a href="https://blog.lo0.es/en/posts/six-stage-llmops-pipeline-architecture-and-deep-dive/">six-stage LLMOps pipeline&lt;/a>. It complements those on &lt;a href="https://blog.lo0.es/en/posts/kv-cache-working-memory-llm-inference/">KV cache&lt;/a> (which does not change with MoE), &lt;a href="https://blog.lo0.es/en/posts/flashattention-librarian-io-awareness-async-blackwell-asymmetry/">FlashAttention&lt;/a> (still the attention kernel, also dense in every current MoE), &lt;a href="https://blog.lo0.es/en/posts/quantization-llm-inference-fp8-int4-gguf/">Quantization&lt;/a> (FP8/NVFP4 over expert weights is what lets DeepSeek-V3 fit into a modest cluster) and &lt;a href="https://blog.lo0.es/en/posts/speculative-decoding-fundamentals-maths-state-of-play/">Speculative decoding&lt;/a> (MTP in DeepSeek-V3 is native speculative decoding).&lt;/p>
&lt;/blockquote>
&lt;h2 id="you-are-here-deploy">You are here: DEPLOY&lt;/h2>
&lt;div class="diagram" style="max-width:780px;margin:1rem auto;">
&lt;svg viewBox="0 0 780 90" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="you are here: Deploy">
&lt;style>.box{stroke:#444;stroke-width:1.4;rx:6}.active{fill:#7ad88f;stroke-width:3}.idle{fill:#f4f4f4}.lbl{font:600 12px sans-serif;fill:#222}.arr{stroke:#666;stroke-width:1.4;fill:none;marker-end:url(#moem)}.cyc{stroke:#888;stroke-width:1.2;fill:none;stroke-dasharray:4 2;marker-end:url(#moem)}&lt;/style>
&lt;defs>&lt;marker id="moem" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="#666"/>&lt;/marker>&lt;/defs>
&lt;text x="390" y="20" text-anchor="middle" class="lbl">You are here: DEPLOY · compute sparsity without memory sparsity&lt;/text>
&lt;rect x="30" y="35" width="110" height="35" class="box idle"/>&lt;text x="85" y="58" text-anchor="middle" class="lbl">1 · Data&lt;/text>
&lt;rect x="155" y="35" width="110" height="35" class="box idle"/>&lt;text x="210" y="58" text-anchor="middle" class="lbl">2 · Tune&lt;/text>
&lt;rect x="280" y="35" width="110" height="35" class="box idle"/>&lt;text x="335" y="58" text-anchor="middle" class="lbl">3 · Eval&lt;/text>
&lt;rect x="405" y="35" width="110" height="35" class="box active"/>&lt;text x="460" y="58" text-anchor="middle" class="lbl">4 · Deploy&lt;/text>
&lt;rect x="530" y="35" width="110" height="35" class="box idle"/>&lt;text x="585" y="58" text-anchor="middle" class="lbl">5 · Observe&lt;/text>
&lt;rect x="655" y="35" width="110" height="35" class="box idle"/>&lt;text x="710" y="58" text-anchor="middle" class="lbl">6 · Retrain&lt;/text>
&lt;path class="arr" d="M140,52 L155,52"/>&lt;path class="arr" d="M265,52 L280,52"/>&lt;path class="arr" d="M390,52 L405,52"/>&lt;path class="arr" d="M515,52 L530,52"/>&lt;path class="arr" d="M640,52 L655,52"/>
&lt;path class="cyc" d="M710,72 L710,82 L85,82 L85,72"/>
&lt;/svg>
&lt;/div>
&lt;h2 id="tldr">TL;DR&lt;/h2>
&lt;p>A Mixture of Experts (MoE) replaces the transformer&amp;rsquo;s dense FFN layer with &lt;strong>N parallel experts plus a router&lt;/strong> that picks the &lt;code>k&lt;/code> experts relevant to each token. The operational consequence is that the model&amp;rsquo;s &lt;strong>total&lt;/strong> parameters (how many were trained and how many must be loaded into VRAM) decouple from the &lt;strong>active parameters per token&lt;/strong> (how many take part in each forward). DeepSeek-V3 has 671 B total but only 37 B active per token; Qwen3-235B-A22B is 235 B total and 22 B active; Mixtral 8x22B is 141 B and 39 B; Llama 4 Maverick is 400 B and 17 B. Compute per token falls to &lt;code>2·N_active&lt;/code> FLOPs, half that of a dense Llama-3-70B in DeepSeek-V3&amp;rsquo;s case, but memory stays proportional to &lt;code>N_total&lt;/code>: MoE &lt;em>sparsity&lt;/em> is &lt;strong>compute sparsity, not memory sparsity&lt;/strong>. Since each expert sees only &lt;code>batch·k/N&lt;/code> tokens per step, the memory-bound regime persists at a much higher batch than in dense. Serving DeepSeek-V3 671 B FP8 at low latency requires &lt;strong>expert parallel&lt;/strong> (EP) at scale, EP=32 in prefill and EP=144 in decode in DeepSeek&amp;rsquo;s production deployment, where the dominant bottleneck stops being HBM and becomes the &lt;strong>all-to-all of dispatch and combine&lt;/strong> between GPUs. As of May 2026, the pieces that make this viable are &lt;strong>DeepEP&lt;/strong> (FP8-native all-to-all CUDA kernels, intra-node NVLink plus inter-node RDMA), &lt;strong>EPLB&lt;/strong> (balancing by replicating &lt;em>hot&lt;/em> experts) and &lt;strong>Wide-EP&lt;/strong> on NVL72 (72 GPUs in one coherent NVLink domain). This post takes apart the mechanism, the maths (FLOPs/token, all-to-all bytes), the updated table of MoE models as of May 2026, the parallelisms (TP / EP / DP+EP / Wide-EP), the operational pitfalls (memory wall, cold experts, imbalance) and the real reproducible numbers on H100, B200 and GB200 NVL72.&lt;/p>
&lt;h2 id="the-analogy-the-call-centre-with-256-specialists">The analogy: the call centre with 256 specialists&lt;/h2>
&lt;p>A serious call centre handling complex technical queries runs on &lt;strong>specialists&lt;/strong>, not generalists. You have 256 operators on the payroll, each an expert in their sub-domain: employment law, mortgages, income tax, probate, and so on. But each incoming call only needs the attention of &lt;strong>eight&lt;/strong> specific specialists (top-8 routing): a client&amp;rsquo;s query about tax relief on a mortgage for an inherited second home involves the income tax person, the mortgage person, the capital gains person, and so on. The receptionist (the router) listens to the first second of the call, decides which eight specialists are relevant, conferences them in and combines their answers with weights.&lt;/p>
&lt;p>Three immediate consequences, identical to those of MoE in production:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>You pay 256 salaries&lt;/strong> (every expert is loaded in VRAM) but you only &lt;strong>spend the time of 8&lt;/strong> (only k experts take part in the forward of each token). Your payroll cost scales with &lt;code>N_total&lt;/code>; your cost per minute of call scales with &lt;code>N_active&lt;/code>.&lt;/li>
&lt;li>&lt;strong>If all the operators fit in one office&lt;/strong> (a single GPU), fine: paper just moves between desks. But &lt;strong>if they do not fit&lt;/strong>, you have to open branches: the conference call between operators in different branches goes over a telephone line between buildings (intra-node NVLink, inter-node InfiniBand) and that line &lt;strong>becomes the dominant bottleneck&lt;/strong> once dozens of branches are coordinating.&lt;/li>
&lt;li>&lt;strong>If one week every client asks about income tax&lt;/strong>, the three income tax operators saturate while the probate ones sit idle. You need &lt;strong>a system that replicates the hot operators&lt;/strong> across several branches to absorb peaks, and that &lt;strong>pairs hot with cold&lt;/strong> so that no branch goes idle.&lt;/li>
&lt;/ol>
&lt;p>The receptionist is the &lt;strong>router&lt;/strong>. The branches are the GPUs. The conference call between branches is the &lt;strong>all-to-all&lt;/strong> (dispatch plus combine). The system for replicating hot operators is &lt;strong>EPLB&lt;/strong>. The good telephone line is &lt;strong>DeepEP&lt;/strong>. And when someone designs a building where all 72 branches fit together with very fast internal cabling, that is &lt;strong>NVL72&lt;/strong>.&lt;/p>
&lt;h2 id="the-bare-mechanism">The bare mechanism&lt;/h2>
&lt;p>A classic MoE layer replaces the dense FFN (&lt;code>y = FFN(x) = down(act(up(x) · gate(x)))&lt;/code> in SwiGLU) with:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>Router&lt;/strong>: a linear projection &lt;code>g(x) = W_router · x&lt;/code> produces &lt;code>N&lt;/code> scores. A softmax over those scores gives affinity probabilities.&lt;/li>
&lt;li>&lt;strong>Top-k selection&lt;/strong>: the &lt;code>k&lt;/code> experts with the highest score are chosen. Their &lt;code>softmax_topk&lt;/code> weights are normalised to sum to 1.&lt;/li>
&lt;li>&lt;strong>Parallel compute&lt;/strong>: each of the &lt;code>k&lt;/code> selected experts runs its own FFN over &lt;code>x&lt;/code>. The &lt;code>N - k&lt;/code> not selected sit idle for this token.&lt;/li>
&lt;li>&lt;strong>Weighted combination&lt;/strong>: the output is &lt;code>y = Σ_{i ∈ topk} w_i · Expert_i(x)&lt;/code>.&lt;/li>
&lt;/ol>
&lt;p>Variants the market consolidated in 2025-2026:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Shared experts&lt;/strong>: on top of the &lt;code>k&lt;/code> routed ones, there are &lt;code>s&lt;/code> experts that always run (1 or 2). They capture general knowledge every token needs. DeepSeek-V3 uses 1 shared + 8 routed; Mixtral uses 0 shared.&lt;/li>
&lt;li>&lt;strong>Fine-grained experts&lt;/strong>: more small experts instead of a few large ones (DeepSeek: 256 vs Mixtral: 8). This allows better specialisation because the top-k combination covers more sub-domains.&lt;/li>
&lt;li>&lt;strong>Auxiliary-loss-free routing&lt;/strong> (DeepSeek-V3): instead of adding a balancing loss during training, it dynamically adjusts a bias in the routing. It keeps balance without polluting the main loss.&lt;/li>
&lt;/ul>
&lt;p>Attention is still &lt;strong>dense&lt;/strong> in every current MoE model (Mixtral, DeepSeek, Qwen3-MoE, Llama 4, Kimi K2). Only the FFN is replaced. That is why FlashAttention v3/v4 is still used as-is; DeepSeek&amp;rsquo;s MLA is an optimisation orthogonal to MoE.&lt;/p>
&lt;h2 id="the-relevant-moe-models-in-may-2026">The relevant MoE models in May 2026&lt;/h2>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Model&lt;/th>
&lt;th>Date&lt;/th>
&lt;th>Total&lt;/th>
&lt;th>Active&lt;/th>
&lt;th>Experts&lt;/th>
&lt;th>Top-k&lt;/th>
&lt;th>Shared&lt;/th>
&lt;th>Notes&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Mixtral 8x7B&lt;/td>
&lt;td>Dec 2023&lt;/td>
&lt;td>47 B&lt;/td>
&lt;td>13 B&lt;/td>
&lt;td>8&lt;/td>
&lt;td>2&lt;/td>
&lt;td>0&lt;/td>
&lt;td>The one that normalised MoE in open weights&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Mixtral 8x22B&lt;/td>
&lt;td>Apr 2024&lt;/td>
&lt;td>141 B&lt;/td>
&lt;td>39 B&lt;/td>
&lt;td>8&lt;/td>
&lt;td>2&lt;/td>
&lt;td>0&lt;/td>
&lt;td>—&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Grok-1 (open)&lt;/td>
&lt;td>Mar 2024&lt;/td>
&lt;td>314 B&lt;/td>
&lt;td>~86 B&lt;/td>
&lt;td>8&lt;/td>
&lt;td>2&lt;/td>
&lt;td>0&lt;/td>
&lt;td>Weights opened by xAI&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>DeepSeekMoE 16B&lt;/td>
&lt;td>Jan 2024&lt;/td>
&lt;td>16 B&lt;/td>
&lt;td>2.8 B&lt;/td>
&lt;td>64+2&lt;/td>
&lt;td>6&lt;/td>
&lt;td>2&lt;/td>
&lt;td>Introduces fine-grained + shared&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>DeepSeek-V2&lt;/td>
&lt;td>May 2024&lt;/td>
&lt;td>236 B&lt;/td>
&lt;td>21 B&lt;/td>
&lt;td>160+2&lt;/td>
&lt;td>6&lt;/td>
&lt;td>2&lt;/td>
&lt;td>+ MLA&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Snowflake Arctic&lt;/td>
&lt;td>Apr 2024&lt;/td>
&lt;td>480 B&lt;/td>
&lt;td>17 B&lt;/td>
&lt;td>128&lt;/td>
&lt;td>2&lt;/td>
&lt;td>10 B dense residual&lt;/td>
&lt;td>Dense-MoE hybrid&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Hunyuan-Large&lt;/td>
&lt;td>Nov 2024&lt;/td>
&lt;td>389 B&lt;/td>
&lt;td>52 B&lt;/td>
&lt;td>16+1&lt;/td>
&lt;td>1+shared&lt;/td>
&lt;td>1&lt;/td>
&lt;td>Cross-layer KV cache&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>DeepSeek-V3&lt;/strong>&lt;/td>
&lt;td>Dec 2024&lt;/td>
&lt;td>671 B&lt;/td>
&lt;td>37 B&lt;/td>
&lt;td>256+1&lt;/td>
&lt;td>8&lt;/td>
&lt;td>1&lt;/td>
&lt;td>MLA + MTP, aux-loss-free, FP8 training&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Llama 4 Scout&lt;/td>
&lt;td>Apr 2025&lt;/td>
&lt;td>109 B&lt;/td>
&lt;td>17 B&lt;/td>
&lt;td>16&lt;/td>
&lt;td>1+shared&lt;/td>
&lt;td>1&lt;/td>
&lt;td>Designed for 1 H100 node&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Llama 4 Maverick&lt;/td>
&lt;td>Apr 2025&lt;/td>
&lt;td>400 B&lt;/td>
&lt;td>17 B&lt;/td>
&lt;td>128&lt;/td>
&lt;td>1+shared&lt;/td>
&lt;td>1&lt;/td>
&lt;td>—&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Qwen3-235B-A22B&lt;/td>
&lt;td>Apr 2025&lt;/td>
&lt;td>235 B&lt;/td>
&lt;td>22 B&lt;/td>
&lt;td>128&lt;/td>
&lt;td>8&lt;/td>
&lt;td>0&lt;/td>
&lt;td>—&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Kimi K2 (Moonshot)&lt;/td>
&lt;td>2025&lt;/td>
&lt;td>1 T&lt;/td>
&lt;td>32 B&lt;/td>
&lt;td>384&lt;/td>
&lt;td>8&lt;/td>
&lt;td>(MLA)&lt;/td>
&lt;td>Trained with MuonClip&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>DeepSeek-V3.2-Exp&lt;/td>
&lt;td>Sep 2025&lt;/td>
&lt;td>671 B&lt;/td>
&lt;td>37 B&lt;/td>
&lt;td>256+1&lt;/td>
&lt;td>8&lt;/td>
&lt;td>1&lt;/td>
&lt;td>+ DeepSeek Sparse Attention&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>Three operational observations:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>The active/total ratio falls with every generation&lt;/strong>: Mixtral 8x7B was 28 %, DeepSeek-V3 is 5.5 %, Llama 4 Maverick is 4.3 %. What the industry discovered is that &lt;strong>sparsity can be very aggressive without losing quality&lt;/strong>, provided &lt;code>N&lt;/code> is large enough and the routing is well learned. Fine specialisation is worth more than per-expert capacity.&lt;/li>
&lt;li>&lt;strong>The flagships of the large providers (OpenAI, Anthropic, Google) are almost certainly MoE&lt;/strong>, but the architectures are not published. The only semi-credible leak (Hotz, Jul 2023) claimed GPT-4 was an 8×~220 B MoE; no official confirmation.&lt;/li>
&lt;li>&lt;strong>DeepSeek-V3 marks the inflection point&lt;/strong>: open weights, frontier-class, MoE with aggressive sparsity and compatible with FP8 quantisation. It is the model that forced the ecosystem (vLLM, SGLang, TensorRT-LLM) to optimise wide-EP in 2025.&lt;/li>
&lt;/ol>
&lt;h2 id="the-maths-that-matters">The maths that matters&lt;/h2>
&lt;p>Three numbers drive the whole architectural decision with MoE.&lt;/p>
&lt;p>&lt;strong>Compute per token.&lt;/strong> A dense transformer spends roughly &lt;code>2N&lt;/code> FLOPs per token in the forward pass (with &lt;code>N&lt;/code> = total parameters). A MoE spends &lt;code>2·N_active&lt;/code> FLOPs per token (the &lt;code>N_total - N_active&lt;/code> experts do not take part). For DeepSeek-V3: 2 × 37 B = &lt;strong>74 GFLOPs/token&lt;/strong>. For dense Llama-3-70B: 2 × 70 B = &lt;strong>140 GFLOPs/token&lt;/strong>. &lt;strong>DeepSeek does half the compute per token&lt;/strong> of Llama-3-70B while offering capacity equivalent to a model almost 10 × larger.&lt;/p>
&lt;p>&lt;strong>Total memory.&lt;/strong> But &lt;strong>all&lt;/strong> the experts must be loaded in VRAM at some point in the forward pass. The sparsity is in compute, not memory. Weight memory:&lt;/p>
$$\text{Memory}_{\text{weights}} \approx N_{\text{total}} \cdot \text{bytes per param}$$
&lt;p>For DeepSeek-V3 FP8 (1 byte): 685 GB. It does not fit in 8×H100 SXM (640 GB). You need either extra quantisation or 16+ GPUs. For Mixtral 8x22B FP8: 141 GB, comfortably inside 2×H100. For Qwen3-235B-A22B FP8: 235 GB, fits in 4×H100.&lt;/p>
&lt;p>&lt;strong>All-to-all bytes per MoE layer.&lt;/strong> When experts are spread across GPUs (EP), each token has to travel to the GPUs where its &lt;code>k&lt;/code> experts live. The volume per MoE layer is roughly:&lt;/p>
$$\text{bytes a2a/layer} \approx 2 \cdot \text{batch} \cdot \text{seq len} \cdot d_{\text{model}} \cdot k \cdot \text{bytes}$$
&lt;p>(the factor 2 is dispatch plus combine). For DeepSeek-V3 with &lt;code>d_model = 7168&lt;/code>, &lt;code>k = 8&lt;/code>, &lt;code>batch = 4096&lt;/code>, FP8 (1 byte): each MoE layer moves ~470 MB; multiplied by 61 MoE layers in DeepSeek-V3, the complete step adds &lt;strong>~29 GB of inter-GPU traffic&lt;/strong> in MoE comms alone. That is of the order of a GPU&amp;rsquo;s HBM bandwidth in a single step. This is why bandwidth and NVLink/InfiniBand topology determine how large EP can be before comms saturate.&lt;/p>
&lt;p>&lt;strong>Persistent memory-bound regime.&lt;/strong> Here is the least intuitive consequence. In dense, raising the batch moves the operation from memory-bound to compute-bound: with enough tokens per batch, the weights are amortised over more operations. In MoE, each expert sees only &lt;code>batch · k / N&lt;/code> tokens. For Qwen3-235B (k=8, N=128) with batch=128, each expert processes &lt;strong>8 tokens per step&lt;/strong>. To reach the compute-bound regime of the tensor cores (arithmetic intensity ~100-200 FLOPs/byte) you need batches in the &lt;strong>thousands&lt;/strong>, around 1,600 according to recent estimates for Qwen3 (Memory-Bound MoE Serving, arXiv:2512.09277). The operational consequence: &lt;strong>MoE scales throughput with batch more linearly than dense&lt;/strong>, but it also needs far larger batches to get close to its compute ceiling.&lt;/p>
&lt;h2 id="expert-parallel-and-the-all-to-all-bottleneck">Expert parallel and the all-to-all bottleneck&lt;/h2>
&lt;p>There are three main ways to parallelise a MoE across GPUs:&lt;/p>
&lt;p>&lt;strong>Tensor Parallel (TP, Megatron-style).&lt;/strong> Splits each weight matrix across GPUs by width or height. Every GPU processes all tokens and all layers. Comms per layer: 2 all-reduces. It works well for dense; for MoE it leaves the routing sparsity unexploited (each GPU holds fragments of every expert).&lt;/p>
&lt;p>&lt;strong>Expert Parallel (EP).&lt;/strong> Splits &lt;strong>whole experts&lt;/strong> across GPUs: 256 experts / 32 GPUs = 8 experts per GPU. Each token, after routing, travels to the GPUs where its top-k &lt;code>k&lt;/code> experts live. Comms per MoE layer: an &lt;strong>all-to-all dispatch&lt;/strong> (tokens towards experts) plus an &lt;strong>all-to-all combine&lt;/strong> (outputs back). The cost grows with EP size and becomes the bottleneck when EP &amp;gt; 8.&lt;/p>
&lt;p>&lt;strong>DP + EP / Wide-EP.&lt;/strong> Replicates the model across DP groups; inside each group, EP shards the experts. &lt;strong>Wide-EP&lt;/strong> takes EP to the full dimension of a rack (NVL72, 72 GPUs in a coherent NVLink domain). Each expert receives more tokens per step, so arithmetic intensity in each expert&amp;rsquo;s GEMMs improves and per-GPU throughput rises. vLLM reports &lt;strong>1.8× throughput per GPU with wide-EP&lt;/strong> against smaller setups on DeepSeek-V3 (vLLM blog, Dec 2025).&lt;/p>
&lt;div class="diagram" style="max-width:780px;margin:1.5rem auto;">
&lt;svg viewBox="0 0 780 380" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Expert Parallel with all-to-all dispatch and combine">
&lt;style>
.gpu{fill:#eaf3ff;stroke:#1f5fa8;stroke-width:1.4;rx:8}
.exp{fill:#fff4d6;stroke:#a48000;stroke-width:1.2;rx:4}
.tok{fill:#cdebd0;stroke:#2a7a40;stroke-width:1.2;rx:4}
.router{fill:#e6d0ff;stroke:#5a2db0;stroke-width:1.4;rx:6}
.lbl{font:600 12px sans-serif;fill:#222}
.sub{font:400 10px sans-serif;fill:#555}
.disp{stroke:#cc6622;stroke-width:1.5;fill:none;marker-end:url(#mma)}
.comb{stroke:#226699;stroke-width:1.5;fill:none;stroke-dasharray:4 2;marker-end:url(#mma)}
&lt;/style>
&lt;defs>&lt;marker id="mma" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="#444"/>&lt;/marker>&lt;/defs>
&lt;text x="20" y="22" class="lbl">MoE layer with Expert Parallel: EP=4 (4 GPUs, 8 experts/GPU)&lt;/text>
&lt;rect x="20" y="40" width="170" height="60" class="router"/>
&lt;text x="105" y="62" text-anchor="middle" class="lbl">Router (W_router)&lt;/text>
&lt;text x="105" y="78" text-anchor="middle" class="sub">softmax → top-k=2&lt;/text>
&lt;text x="105" y="92" text-anchor="middle" class="sub">per token&lt;/text>
&lt;rect x="20" y="115" width="80" height="35" class="tok"/>&lt;text x="60" y="138" text-anchor="middle" class="lbl">tokens&lt;/text>
&lt;text x="220" y="60" class="sub">all-to-all dispatch (FP8)&lt;/text>
&lt;path class="disp" d="M195,75 L300,160"/>
&lt;path class="disp" d="M195,80 L450,160"/>
&lt;path class="disp" d="M195,85 L600,160"/>
&lt;path class="disp" d="M195,90 L720,160"/>
&lt;rect x="240" y="160" width="120" height="120" class="gpu"/>
&lt;text x="300" y="178" text-anchor="middle" class="lbl">GPU 0&lt;/text>
&lt;rect x="252" y="190" width="42" height="20" class="exp"/>&lt;text x="273" y="204" text-anchor="middle" class="sub">E0&lt;/text>
&lt;rect x="296" y="190" width="42" height="20" class="exp"/>&lt;text x="317" y="204" text-anchor="middle" class="sub">E1&lt;/text>
&lt;rect x="252" y="215" width="42" height="20" class="exp"/>&lt;text x="273" y="229" text-anchor="middle" class="sub">E2&lt;/text>
&lt;rect x="296" y="215" width="42" height="20" class="exp"/>&lt;text x="317" y="229" text-anchor="middle" class="sub">E3&lt;/text>
&lt;text x="300" y="255" text-anchor="middle" class="sub">experts 0-7&lt;/text>
&lt;text x="300" y="270" text-anchor="middle" class="sub">(8 experts)&lt;/text>
&lt;rect x="390" y="160" width="120" height="120" class="gpu"/>
&lt;text x="450" y="178" text-anchor="middle" class="lbl">GPU 1&lt;/text>
&lt;rect x="402" y="190" width="42" height="20" class="exp"/>&lt;text x="423" y="204" text-anchor="middle" class="sub">E8&lt;/text>
&lt;rect x="446" y="190" width="42" height="20" class="exp"/>&lt;text x="467" y="204" text-anchor="middle" class="sub">E9&lt;/text>
&lt;text x="450" y="255" text-anchor="middle" class="sub">experts 8-15&lt;/text>
&lt;rect x="540" y="160" width="120" height="120" class="gpu"/>
&lt;text x="600" y="178" text-anchor="middle" class="lbl">GPU 2&lt;/text>
&lt;rect x="552" y="190" width="42" height="20" class="exp"/>&lt;text x="573" y="204" text-anchor="middle" class="sub">E16&lt;/text>
&lt;rect x="596" y="190" width="42" height="20" class="exp"/>&lt;text x="617" y="204" text-anchor="middle" class="sub">E17&lt;/text>
&lt;text x="600" y="255" text-anchor="middle" class="sub">experts 16-23&lt;/text>
&lt;rect x="660" y="160" width="100" height="120" class="gpu"/>
&lt;text x="710" y="178" text-anchor="middle" class="lbl">GPU 3&lt;/text>
&lt;rect x="668" y="190" width="42" height="20" class="exp"/>&lt;text x="689" y="204" text-anchor="middle" class="sub">E24&lt;/text>
&lt;rect x="712" y="190" width="42" height="20" class="exp"/>&lt;text x="733" y="204" text-anchor="middle" class="sub">E25&lt;/text>
&lt;text x="710" y="255" text-anchor="middle" class="sub">experts 24-31&lt;/text>
&lt;text x="220" y="310" class="sub">all-to-all combine (weighted sum returns to the origin)&lt;/text>
&lt;path class="comb" d="M300,280 L195,330"/>
&lt;path class="comb" d="M450,280 L195,330"/>
&lt;path class="comb" d="M600,280 L195,330"/>
&lt;path class="comb" d="M710,280 L195,330"/>
&lt;rect x="100" y="325" width="200" height="35" class="tok"/>
&lt;text x="200" y="346" text-anchor="middle" class="lbl">y = Σ w_i · Expert_i(x)&lt;/text>
&lt;/svg>
&lt;/div>
&lt;p>Quick decision table:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Case&lt;/th>
&lt;th>Recommendation&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Small MoE that fits in 1 node (Mixtral 8x7B, Llama 4 Scout)&lt;/td>
&lt;td>TP only or EP=2 intra-node&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Medium MoE (Mixtral 8x22B, Qwen3-235B) on 1-2 H100 nodes&lt;/td>
&lt;td>EP=8 intra-node, optionally TP=2&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Large MoE (DeepSeek-V3) on a multi-node cluster&lt;/td>
&lt;td>TP × EP cross-node (e.g. TP=4 × EP=8 on 32 GPUs)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Large MoE with NVL72 available&lt;/td>
&lt;td>Wide-EP=72 (decode), EP=32 (prefill)&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>DeepSeek&amp;rsquo;s production deployment combines &lt;strong>Prefill EP=32&lt;/strong> (4 nodes × 8 GPUs) with &lt;strong>Decode EP=144&lt;/strong> (18 nodes × 8 GPUs). The prefill/decode split fits conceptually with &lt;a href="https://blog.lo0.es/en/posts/disaggregated-serving-prefill-decode-specialised-pods/">Disaggregated serving&lt;/a>: prefill is compute-bound and benefits from moderate EP; decode is memory-bound and benefits from Wide-EP, which raises the tokens per expert per step.&lt;/p>
&lt;h2 id="deepep-eplb-and-wide-ep-the-pieces-that-unblocked-2025">DeepEP, EPLB and Wide-EP: the pieces that unblocked 2025&lt;/h2>
&lt;p>&lt;strong>DeepEP&lt;/strong> (DeepSeek, opened in February 2025) is a library of all-to-all CUDA kernels optimised specifically for MoE EP. Four important properties:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Native FP8 dispatch&lt;/strong>: tokens travel in FP8, halving the bandwidth consumed.&lt;/li>
&lt;li>&lt;strong>Mixing intra-node NVLink with inter-node RDMA&lt;/strong>: the kernel picks the optimal route according to topology.&lt;/li>
&lt;li>&lt;strong>CPU bypass&lt;/strong>: the GPU→GPU dispatch goes over RDMA without touching the host.&lt;/li>
&lt;li>&lt;strong>Aligned with DeepSeek-V3&amp;rsquo;s group-limited gating&lt;/strong>: the routing prefers experts in the same node group where possible, minimising inter-node traffic.&lt;/li>
&lt;/ul>
&lt;p>In 2025 Tencent contributed optimisations that added +30 % on the normal kernels. There is a ROCm port for AMD.&lt;/p>
&lt;p>&lt;strong>EPLB (Expert Parallelism Load Balancer)&lt;/strong> solves the runtime imbalance problem: even when the model is well balanced in global distribution, &lt;strong>a specific batch can heavily activate certain experts&lt;/strong> (prompts in a single language, a single domain). EPLB &lt;strong>replicates the hot experts&lt;/strong> across several GPUs (redundant experts) and packs them heuristically with cold experts to minimise load variance. It has two modes: hierarchical (for prefill with medium EP) and global (for decode with Wide-EP). It is integrated into SGLang and vLLM.&lt;/p>
&lt;p>&lt;strong>Wide-EP on NVL72&lt;/strong> is the peak setup of 2026: 72 Blackwell GPUs in a coherent NVLink domain (1.8 TB/s bidirectional per GPU, intra-rack). Each expert receives many more tokens per step, so arithmetic intensity improves and so does throughput per GPU. Combined with NVFP4 over expert weights and FP8 over attention, SGLang reported on GB200 NVL72 &lt;strong>26,156 tok/s/GPU in prefill and 13,386 tok/s/GPU in decode&lt;/strong> for DeepSeek-V3 (LMSYS, Sep 2025), a &lt;strong>3.8× prefill and 4.8× decode versus H100&lt;/strong>.&lt;/p>
&lt;h2 id="operational-pitfalls">Operational pitfalls&lt;/h2>
&lt;p>&lt;strong>HBM fragmentation from expert weights.&lt;/strong> With EP=8 in 1 node, each GPU holds N/8 experts, each a tuple of matrices (&lt;code>gate&lt;/code>, &lt;code>up&lt;/code>, &lt;code>down&lt;/code>). If N=256, that is 32 FFNs per GPU. The allocator can fragment; in some cases you need a more conservative &lt;code>--gpu-memory-utilization&lt;/code> than usual.&lt;/p>
&lt;p>&lt;strong>Cold experts.&lt;/strong> In real distributions some experts are activated by &amp;lt;1 % of tokens. EPLB compensates by replicating hot ones, but the cold ones sit occupying HBM without taking part, &amp;ldquo;dead&amp;rdquo; memory. When real demand diverges a lot from the training distribution, this shows.&lt;/p>
&lt;p>&lt;strong>Continuous batching.&lt;/strong> It works with MoE, but the effective batch size per expert is &lt;code>batch_total · k / N&lt;/code>. With large N and a moderate batch, each expert sees very few tokens per step. You need a &lt;code>batch_total&lt;/code> far larger than in dense to match per-GPU throughput.&lt;/p>
&lt;p>&lt;strong>Speculative decoding + MoE.&lt;/strong> They interact &lt;strong>well&lt;/strong>. MoE sparsity keeps the memory-bound regime at high batch, which is exactly the regime where speculative decoding wins most. DeepSeek-V3 integrates &lt;strong>MTP&lt;/strong> (Multi-Token Prediction), speculative decoding native to the model, with no external draft, with acceptance around 85-90 % on the second token (see &lt;a href="https://blog.lo0.es/en/posts/speculative-decoding-fundamentals-maths-state-of-play/">Speculative decoding&lt;/a> for the mechanism).&lt;/p>
&lt;p>&lt;strong>MLA and FlashMLA are not MoE.&lt;/strong> DeepSeek-V3 combines MoE with &lt;strong>Multi-head Latent Attention&lt;/strong> (MLA), an attention variant that reduces the KV cache ~10× against standard MHA. MLA and MoE are orthogonal: MLA optimises attention, MoE optimises the FFN. For serving DeepSeek you use the specific &lt;strong>FlashMLA&lt;/strong> kernel (not FA3 directly).&lt;/p>
&lt;p>&lt;strong>DSA (DeepSeek Sparse Attention)&lt;/strong> in DeepSeek-V3.2-Exp (Sep 2025) introduces sparsity in attention too. The first time at the frontier that sparsity is applied in both attention and FFN.&lt;/p>
&lt;h2 id="implications-for-on-premise-hardware">Implications for on-premise hardware&lt;/h2>
&lt;p>&lt;strong>On an RTX 4090 (24 GB).&lt;/strong> Large MoEs are out of reach. What does fit: Mixtral 8x7B AWQ-INT4 (~24 GB of weights, no headroom for KV cache, so it really requires TP=2 across two 4090s); DeepSeekMoE 16B BF16 (~33 GB, does not fit whole; INT4 ~8 GB, fits with room to spare). The interesting case is &lt;strong>llama.cpp with &lt;code>--n-cpu-moe&lt;/code>&lt;/strong>: expert weights offloaded to RAM (CPU), attention and shared experts on the GPU. It lets you run DeepSeek-V3 IQ4 (~400 GB) on a workstation with 1-2 GPUs plus 512 GB of RAM at modest throughput, but it opens the door to a low-budget setup.&lt;/p>
&lt;p>&lt;strong>On a generic 4×H100 SXM cluster (320 GB, NVLink, native FP8).&lt;/strong> These fit comfortably:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Mixtral 8x22B FP8&lt;/strong> (~141 GB) with TP=2 or EP=4. Low latency, excellent throughput.&lt;/li>
&lt;li>&lt;strong>Qwen3-235B-A22B FP8&lt;/strong> (~235 GB) with TP=4 or EP=4. Plenty of room.&lt;/li>
&lt;li>&lt;strong>Llama 4 Scout 109B FP8&lt;/strong> (~110 GB) with TP=2 or TP=4. Designed by Meta to serve well on one H100 node.&lt;/li>
&lt;/ul>
&lt;p>What does &lt;strong>not&lt;/strong> fit in 4×H100: DeepSeek-V3 FP8 (~685 GB) without aggressive quantisation. Options: (1) scale to 8-16 H100; (2) use AWQ INT4 over routed experts plus FP16 over activated ones (~400 GB), which fits in 8×H100; (3) wait for Blackwell or use AMD MI300X (192 GB/GPU, so DeepSeek-V3 FP8 on 4×MI300X).&lt;/p>
&lt;p>The rule of thumb as of May 2026: &lt;strong>one 4×H100 node comfortably serves MoEs up to ~200 B total in FP8; for DeepSeek-V3 you have to scale to 2 nodes or wait for B200 NVL72&lt;/strong> (where the whole model fits with room for enormous batches).&lt;/p>
&lt;h2 id="what-we-have-not-covered">What we have not covered&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>MLA and FlashMLA in detail&lt;/strong>: DeepSeek&amp;rsquo;s KV cache optimisation, orthogonal to MoE.&lt;/li>
&lt;li>&lt;strong>DeepSeek Sparse Attention (DSA)&lt;/strong> introduced in V3.2-Exp: the first production implementation of attention sparsity for frontier models.&lt;/li>
&lt;li>&lt;strong>MoE during training&lt;/strong>: load balancing losses, drop policies, auxiliary terms vs aux-loss-free, Kimi K2&amp;rsquo;s MuonClip.&lt;/li>
&lt;li>&lt;strong>MoE + LoRA&lt;/strong>: how adapter fine-tuning is done on a MoE, and what happens to the routing.&lt;/li>
&lt;li>&lt;strong>LLM-d&lt;/strong> and other open-source platforms that materialise Wide-EP on Kubernetes.&lt;/li>
&lt;/ul>
&lt;h2 id="see-also">See also&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/kv-cache-working-memory-llm-inference/">KV cache: working memory&lt;/a> — structurally the KV cache is the same as in dense (attention is dense in every current MoE); MLA is the specific optimisation DeepSeek adds on top.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/pagedattention-vllm-block-manager/">PagedAttention deep dive&lt;/a> — handling the KV cache in physical blocks stays identical under MoE; only the FFN changes.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/flashattention-librarian-io-awareness-async-blackwell-asymmetry/">FlashAttention v1/v2/v3/v4&lt;/a> — the attention kernel is reused as-is; FlashMLA is the variant specific to DeepSeek&amp;rsquo;s MLA, adding a latent compression step to the FA pattern.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/quantization-llm-inference-fp8-int4-gguf/">Quantization for LLM inference&lt;/a> — FP8/NVFP4 over expert weights is what makes DeepSeek-V3 fit into a modest cluster and what lets NVL72 reach its peak numbers.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/speculative-decoding-fundamentals-maths-state-of-play/">Speculative decoding&lt;/a> — MTP in DeepSeek-V3 is native speculative decoding; MoE&amp;rsquo;s persistent memory-bound regime means speculative wins more in MoE than in dense at medium batch.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/disaggregated-serving-prefill-decode-specialised-pods/">Disaggregated serving: prefill and decode&lt;/a> — DeepSeek&amp;rsquo;s real deployment separates prefill (EP=32) and decode (EP=144) pools; disaggregation is a prerequisite for Wide-EP.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/continuous-batching-orca-vllm-chunked-prefill-goodput/">Continuous batching&lt;/a> — the other side of the coin. MoE needs far larger batches than dense for the same per-GPU throughput because each expert sees &lt;code>batch · k / N&lt;/code> tokens per step; the iterative scheduler is what makes it viable at scale.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/six-stage-llmops-pipeline-architecture-and-deep-dive/">The six-stage LLMOps pipeline&lt;/a> — the master map where Deploy is stage 4.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/capacity-planning-on-premise-llm-inference/">Capacity planning for on-premise LLM inference&lt;/a> — MoE sizing differs from dense: the &amp;ldquo;MoE case&amp;rdquo; section there quantifies the VRAM cost dominated by total weights and the TPOT dominated by active weights per token.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/device-native-architectures-fine-grained-moe-pre-attention-router/">Device-native architectures: fine-grained MoE and pre-attention router&lt;/a> — MoE taken to the fine-grained extreme and designed from scratch for device: the pre-attention router prefetches experts from SSD in parallel with attention, hiding the storage I/O.&lt;/li>
&lt;/ul>
&lt;h2 id="references">References&lt;/h2>
&lt;ul>
&lt;li>Shazeer, N. et al. &lt;em>Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layer&lt;/em>. ICLR 2017. &lt;a href="https://arxiv.org/abs/1701.06538">https://arxiv.org/abs/1701.06538&lt;/a>&lt;/li>
&lt;li>Lepikhin, D. et al. &lt;em>GShard: Scaling Giant Models with Conditional Computation&lt;/em>. ICLR 2021. &lt;a href="https://arxiv.org/abs/2006.16668">https://arxiv.org/abs/2006.16668&lt;/a>&lt;/li>
&lt;li>Fedus, W., Zoph, B., Shazeer, N. &lt;em>Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsity&lt;/em>. JMLR 2022. &lt;a href="https://arxiv.org/abs/2101.03961">https://arxiv.org/abs/2101.03961&lt;/a>&lt;/li>
&lt;li>Gale, T., Narayanan, D., Young, C., Zaharia, M. &lt;em>MegaBlocks: Efficient Sparse Training with Mixture-of-Experts&lt;/em>. MLSys 2023. &lt;a href="https://arxiv.org/abs/2211.15841">https://arxiv.org/abs/2211.15841&lt;/a>&lt;/li>
&lt;li>Mistral AI. &lt;em>Mixtral of Experts&lt;/em>. 2024. &lt;a href="https://arxiv.org/abs/2401.04088">https://arxiv.org/abs/2401.04088&lt;/a>&lt;/li>
&lt;li>DeepSeek-AI. &lt;em>DeepSeekMoE: Towards Ultimate Expert Specialization in Mixture-of-Experts Language Models&lt;/em>. 2024. &lt;a href="https://arxiv.org/abs/2401.06066">https://arxiv.org/abs/2401.06066&lt;/a>&lt;/li>
&lt;li>DeepSeek-AI. &lt;em>DeepSeek-V2&lt;/em>. 2024. &lt;a href="https://arxiv.org/abs/2405.04434">https://arxiv.org/abs/2405.04434&lt;/a>&lt;/li>
&lt;li>DeepSeek-AI. &lt;em>DeepSeek-V3 Technical Report&lt;/em>. 2024. &lt;a href="https://arxiv.org/abs/2412.19437">https://arxiv.org/abs/2412.19437&lt;/a>&lt;/li>
&lt;li>Tencent. &lt;em>Hunyuan-Large&lt;/em>. 2024. &lt;a href="https://arxiv.org/abs/2411.02265">https://arxiv.org/abs/2411.02265&lt;/a>&lt;/li>
&lt;li>DeepEP repo: &lt;a href="https://github.com/deepseek-ai/DeepEP">https://github.com/deepseek-ai/DeepEP&lt;/a>&lt;/li>
&lt;li>EPLB repo: &lt;a href="https://github.com/deepseek-ai/EPLB">https://github.com/deepseek-ai/EPLB&lt;/a>&lt;/li>
&lt;li>DeepSeek open-infra-index, &lt;em>V3/R1 Inference System Overview&lt;/em>: &lt;a href="https://github.com/deepseek-ai/open-infra-index">https://github.com/deepseek-ai/open-infra-index&lt;/a>&lt;/li>
&lt;li>vLLM blog, &lt;em>Large-Scale Serving DeepSeek&lt;/em> (Dec 2025): &lt;a href="https://blog.vllm.ai/2025/12/17/large-scale-serving.html">https://blog.vllm.ai/2025/12/17/large-scale-serving.html&lt;/a>&lt;/li>
&lt;li>vLLM blog, &lt;em>WideEP en GB200&lt;/em> (Feb 2026): &lt;a href="https://blog.vllm.ai/2026/02/03/dsr1-gb200-part1.html">https://blog.vllm.ai/2026/02/03/dsr1-gb200-part1.html&lt;/a>&lt;/li>
&lt;li>LMSYS blog, &lt;em>DeepSeek 96 H100 PD+EP&lt;/em> (May 2025): &lt;a href="https://www.lmsys.org/blog/2025-05-05-large-scale-ep/">https://www.lmsys.org/blog/2025-05-05-large-scale-ep/&lt;/a>&lt;/li>
&lt;li>LMSYS blog, &lt;em>DeepSeek GB200 NVL72 part II&lt;/em> (Sep 2025): &lt;a href="https://www.lmsys.org/blog/2025-09-25-gb200-part-2/">https://www.lmsys.org/blog/2025-09-25-gb200-part-2/&lt;/a>&lt;/li>
&lt;li>NVIDIA Dynamo + GB200 NVL72 for MoE: &lt;a href="https://developer.nvidia.com/blog/how-nvidia-gb200-nvl72-and-nvidia-dynamo-boost-inference-performance-for-moe-models/">https://developer.nvidia.com/blog/how-nvidia-gb200-nvl72-and-nvidia-dynamo-boost-inference-performance-for-moe-models/&lt;/a>&lt;/li>
&lt;li>Tensor Economics, &lt;em>MoE Inference Economics from First Principles&lt;/em>: &lt;a href="https://www.tensoreconomics.com/p/moe-inference-economics-from-first">https://www.tensoreconomics.com/p/moe-inference-economics-from-first&lt;/a>&lt;/li>
&lt;li>Cohere, &lt;em>Why MoE models get more from speculative decoding&lt;/em>: &lt;a href="https://cohere.com/blog/mixture-of-experts-models-get-more-from-speculative-decoding">https://cohere.com/blog/mixture-of-experts-models-get-more-from-speculative-decoding&lt;/a>&lt;/li>
&lt;/ul></description></item><item><title>Speculative decoding: the secretary who types ahead of the boss — fundamentals, maths and state of play in May 2026</title><link>https://blog.lo0.es/en/posts/speculative-decoding-fundamentals-maths-state-of-play/</link><pubDate>Fri, 29 May 2026 11:00:00 +0200</pubDate><guid>https://blog.lo0.es/en/posts/speculative-decoding-fundamentals-maths-state-of-play/</guid><description>&lt;blockquote>
&lt;p>This post complements &lt;a href="https://blog.lo0.es/en/posts/kv-cache-working-memory-llm-inference/">KV cache: the working memory&lt;/a> and &lt;a href="https://blog.lo0.es/en/posts/quantization-llm-inference-fp8-int4-gguf/">Quantisation for LLM inference&lt;/a>. Both are acceleration levers &lt;strong>inside a single forward pass&lt;/strong>. Speculative decoding is the complementary lever: instead of making each forward pass cheaper, it tries to &lt;strong>produce more tokens per forward pass&lt;/strong>. It is orthogonal to quantisation and to the KV cache, and it stacks multiplicatively with both.&lt;/p>
&lt;/blockquote>
&lt;h2 id="you-are-here-deploy">You are here: DEPLOY&lt;/h2>
&lt;div class="diagram" style="max-width:780px;margin:1rem auto;">
&lt;svg viewBox="0 0 780 90" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="you are here: Deploy">
&lt;style>.box{stroke:#444;stroke-width:1.4;rx:6}.active{fill:#7ad88f;stroke-width:3}.idle{fill:#f4f4f4}.lbl{font:600 12px sans-serif;fill:#222}.arr{stroke:#666;stroke-width:1.4;fill:none;marker-end:url(#spm)}.cyc{stroke:#888;stroke-width:1.2;fill:none;stroke-dasharray:4 2;marker-end:url(#spm)}&lt;/style>
&lt;defs>&lt;marker id="spm" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="#666"/>&lt;/marker>&lt;/defs>
&lt;text x="390" y="20" text-anchor="middle" class="lbl">You are here: DEPLOY · more tokens per forward pass without touching quality&lt;/text>
&lt;rect x="30" y="35" width="110" height="35" class="box idle"/>&lt;text x="85" y="58" text-anchor="middle" class="lbl">1 · Data&lt;/text>
&lt;rect x="155" y="35" width="110" height="35" class="box idle"/>&lt;text x="210" y="58" text-anchor="middle" class="lbl">2 · Tune&lt;/text>
&lt;rect x="280" y="35" width="110" height="35" class="box idle"/>&lt;text x="335" y="58" text-anchor="middle" class="lbl">3 · Eval&lt;/text>
&lt;rect x="405" y="35" width="110" height="35" class="box active"/>&lt;text x="460" y="58" text-anchor="middle" class="lbl">4 · Deploy&lt;/text>
&lt;rect x="530" y="35" width="110" height="35" class="box idle"/>&lt;text x="585" y="58" text-anchor="middle" class="lbl">5 · Observe&lt;/text>
&lt;rect x="655" y="35" width="110" height="35" class="box idle"/>&lt;text x="710" y="58" text-anchor="middle" class="lbl">6 · Retrain&lt;/text>
&lt;path class="arr" d="M140,52 L155,52"/>&lt;path class="arr" d="M265,52 L280,52"/>&lt;path class="arr" d="M390,52 L405,52"/>&lt;path class="arr" d="M515,52 L530,52"/>&lt;path class="arr" d="M640,52 L655,52"/>
&lt;path class="cyc" d="M710,72 L710,82 L85,82 L85,72"/>
&lt;/svg>
&lt;/div>
&lt;h2 id="tldr">TL;DR&lt;/h2>
&lt;p>Autoregressive LLM inference has a structural problem: every new token needs a complete forward pass of the model, and decode forward passes are memory-bandwidth-bound, not compute-bound (the detail is in &lt;a href="https://blog.lo0.es/en/posts/kv-cache-working-memory-llm-inference/">KV cache&lt;/a>). The GPU spends most of its time waiting for the next weight to arrive from HBM. &lt;strong>Speculative decoding&lt;/strong> uses that dead time by doing two things in parallel: a small, cheap model (&lt;em>draft&lt;/em>) generates γ tokens autoregressively, fast but imprecise, and the large model (&lt;em>target&lt;/em>) verifies those γ tokens &lt;strong>in a single parallel forward pass&lt;/strong>, at almost the same cost as a single-token forward pass. An acceptance rule based on rejection sampling decides how many draft tokens are accepted, and the maths proves, it does not approximate, it proves, that the output distribution matches sampling directly from the target exactly. The technique has a ceiling: you never generate more than &lt;code>1/(1-α)&lt;/code> tokens per step, with α the acceptance rate. The five dominant families in May 2026 are &lt;strong>vanilla SD&lt;/strong> (Leviathan 2023), &lt;strong>Medusa&lt;/strong> (extra parallel heads), &lt;strong>EAGLE-1/2/3&lt;/strong> (a draft that operates at the level of hidden states), &lt;strong>MTP&lt;/strong> (multi-token prediction native to DeepSeek-V3) and &lt;strong>P-EAGLE&lt;/strong> (a draft that produces the γ tokens in a single forward pass, integrated in vLLM 0.16+). On low-concurrency workloads with short prompts and long outputs, the typical case of the on-premise conversational assistant, the real speedup sits between 2× and 4× on modern hardware.&lt;/p>
&lt;h2 id="the-analogy-the-secretary-who-types-ahead-and-the-boss-who-validates">The analogy: the secretary who types ahead and the boss who validates&lt;/h2>
&lt;p>Picture a crowded press conference with a real-time transcription setup. Two people are working:&lt;/p>
&lt;p>The &lt;strong>secretary&lt;/strong> sits at the keyboard. They know the subject, they have read the briefings and they know the boss&amp;rsquo;s verbal tics. As soon as the boss opens their mouth, the secretary starts typing what they think is coming. They are fast, three or four words ahead of the boss, but they sometimes get it wrong, especially when the boss takes an unexpected turn.&lt;/p>
&lt;p>The &lt;strong>boss&lt;/strong> periodically reads the secretary&amp;rsquo;s screen. They read a whole block at once, three or four words, and mentally compare what is written with what they would have said. If it matches their intent, they leave the text and carry on. If the secretary drifted at some point, they correct right there, and whatever the secretary typed after the divergence is discarded (it could be wrong because of the earlier error). If the whole block was fine, the boss takes the chance to add one more word while correcting.&lt;/p>
&lt;p>The result: the final text is identical to what the boss would have dictated alone, but it comes out faster because the secretary works ahead.&lt;/p>
&lt;p>The analogy holds on four details:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>The secretary is the draft model&lt;/strong>. Small, cheap, fast, approximate.&lt;/li>
&lt;li>&lt;strong>The boss is the target model&lt;/strong>. Slow, expensive, but the only authority on output quality.&lt;/li>
&lt;li>&lt;strong>The block the boss reads at once is the target&amp;rsquo;s parallel forward pass&lt;/strong> over &lt;code>prompt + γ draft tokens&lt;/code>. Verifying γ tokens costs almost the same as generating one, because the bottleneck is loading the weights from HBM, not the operations.&lt;/li>
&lt;li>&lt;strong>The &amp;ldquo;correct right where it diverged&amp;rdquo; rule is the rejection sampling&lt;/strong> that preserves the target distribution.&lt;/li>
&lt;/ul>
&lt;p>From here we go into the mechanism and into why quality is preserved exactly, not approximately.&lt;/p>
&lt;h2 id="the-bare-mechanism">The bare mechanism&lt;/h2>
&lt;p>Call &lt;code>p&lt;/code> the target distribution (what it would produce if it were the only one speaking) and &lt;code>q&lt;/code> the draft&amp;rsquo;s. The speculative decoding iteration has three steps:&lt;/p>
&lt;p>&lt;strong>Step 1 — Draft.&lt;/strong> The draft generates γ tokens autoregressively: &lt;code>x_1, x_2, ..., x_γ&lt;/code>. Each one through its own forward pass. Since the draft is small, the γ steps cost little. Typically γ ∈ [4, 8].&lt;/p>
&lt;p>&lt;strong>Step 2 — Verify.&lt;/strong> The target runs a single forward pass over the complete sequence &lt;code>prompt + x_1 ... x_γ&lt;/code>. Because attention is causal, that forward pass simultaneously produces the distributions &lt;code>p(·|prompt, x_&amp;lt;i)&lt;/code> for each position &lt;em>i&lt;/em>. In other words, in a single step it obtains the verification of the γ tokens and, on top of that, an extra distribution &lt;code>p(·|prompt, x_1...x_γ)&lt;/code> for the next token.&lt;/p>
&lt;p>&lt;strong>Step 3 — Accept/reject token by token.&lt;/strong> For each &lt;code>x_i&lt;/code> from left to right it applies:&lt;/p>
&lt;ul>
&lt;li>If &lt;code>p(x_i) ≥ q(x_i)&lt;/code>: always accept.&lt;/li>
&lt;li>If &lt;code>p(x_i) &amp;lt; q(x_i)&lt;/code>: accept with probability &lt;code>p(x_i)/q(x_i)&lt;/code>.&lt;/li>
&lt;li>If it rejects: stop, sample a replacement token from the normalised residual distribution &lt;code>norm(max(0, p − q))&lt;/code>, and discard the rest.&lt;/li>
&lt;li>If it reaches the end having accepted the γ tokens: append a &lt;strong>bonus token&lt;/strong> sampled directly from &lt;code>p(·|prompt, x_1...x_γ)&lt;/code>, which is already in the logits of the target&amp;rsquo;s forward pass.&lt;/li>
&lt;/ul>
&lt;p>Result per iteration: between 1 and γ+1 new tokens. In the best case (all accepted + bonus) γ+1 tokens are generated at the cost of &lt;strong>a single target forward pass plus γ draft forward passes&lt;/strong>, against γ+1 target forward passes in the version without speculative.&lt;/p>
&lt;div class="diagram" style="max-width:780px;margin:1.5rem auto;">
&lt;svg viewBox="0 0 780 340" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Speculative decoding mechanism">
&lt;style>
.dbox{fill:#fff4d6;stroke:#a48000;stroke-width:1.4;rx:6}
.tbox{fill:#d4ecff;stroke:#1f5fa8;stroke-width:1.4;rx:6}
.acc{fill:#cdebd0;stroke:#2a7a40;stroke-width:1.4;rx:6}
.rej{fill:#f6caca;stroke:#a52a2a;stroke-width:1.4;rx:6}
.bon{fill:#e6d0ff;stroke:#5a2db0;stroke-width:1.4;rx:6}
.lbl{font:600 12px sans-serif;fill:#222}
.sub{font:400 11px sans-serif;fill:#555}
.arr{stroke:#666;stroke-width:1.4;fill:none;marker-end:url(#spec1)}
&lt;/style>
&lt;defs>&lt;marker id="spec1" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="#666"/>&lt;/marker>&lt;/defs>
&lt;text x="20" y="25" class="lbl">1. Draft model (q) generates γ=4 tokens autoregressively&lt;/text>
&lt;rect x="20" y="35" width="80" height="35" class="dbox"/>&lt;text x="60" y="58" text-anchor="middle" class="lbl">x₁&lt;/text>
&lt;rect x="120" y="35" width="80" height="35" class="dbox"/>&lt;text x="160" y="58" text-anchor="middle" class="lbl">x₂&lt;/text>
&lt;rect x="220" y="35" width="80" height="35" class="dbox"/>&lt;text x="260" y="58" text-anchor="middle" class="lbl">x₃&lt;/text>
&lt;rect x="320" y="35" width="80" height="35" class="dbox"/>&lt;text x="360" y="58" text-anchor="middle" class="lbl">x₄&lt;/text>
&lt;text x="420" y="58" class="sub">4 cheap forward passes&lt;/text>
&lt;text x="20" y="105" class="lbl">2. Target model (p) verifies the 4 tokens in ONE parallel forward pass&lt;/text>
&lt;rect x="20" y="115" width="380" height="40" class="tbox"/>&lt;text x="210" y="140" text-anchor="middle" class="lbl">single forward pass over [prompt, x₁, x₂, x₃, x₄]&lt;/text>
&lt;text x="420" y="140" class="sub">obtains p(·|prompt, x&amp;lt;i) for i=1..5&lt;/text>
&lt;text x="20" y="180" class="lbl">3. Left-to-right rejection sampling&lt;/text>
&lt;rect x="20" y="190" width="80" height="35" class="acc"/>&lt;text x="60" y="208" text-anchor="middle" class="lbl">x₁ ✓&lt;/text>&lt;text x="60" y="221" text-anchor="middle" class="sub">p≥q&lt;/text>
&lt;rect x="120" y="190" width="80" height="35" class="acc"/>&lt;text x="160" y="208" text-anchor="middle" class="lbl">x₂ ✓&lt;/text>&lt;text x="160" y="221" text-anchor="middle" class="sub">accepted&lt;/text>
&lt;rect x="220" y="190" width="80" height="35" class="acc"/>&lt;text x="260" y="208" text-anchor="middle" class="lbl">x₃ ✓&lt;/text>&lt;text x="260" y="221" text-anchor="middle" class="sub">accepted&lt;/text>
&lt;rect x="320" y="190" width="80" height="35" class="rej"/>&lt;text x="360" y="208" text-anchor="middle" class="lbl">x₄ ✗&lt;/text>&lt;text x="360" y="221" text-anchor="middle" class="sub">rejected&lt;/text>
&lt;text x="20" y="255" class="lbl">4. Result of this iteration&lt;/text>
&lt;rect x="20" y="265" width="80" height="35" class="acc"/>&lt;text x="60" y="288" text-anchor="middle" class="lbl">x₁&lt;/text>
&lt;rect x="120" y="265" width="80" height="35" class="acc"/>&lt;text x="160" y="288" text-anchor="middle" class="lbl">x₂&lt;/text>
&lt;rect x="220" y="265" width="80" height="35" class="acc"/>&lt;text x="260" y="288" text-anchor="middle" class="lbl">x₃&lt;/text>
&lt;rect x="320" y="265" width="80" height="35" class="rej"/>&lt;text x="360" y="288" text-anchor="middle" class="lbl">x'₄&lt;/text>
&lt;text x="420" y="280" class="sub">x'₄ = sample from norm(max(0, p−q)) at pos 4&lt;/text>
&lt;text x="420" y="295" class="sub">bonus dropped (only if all accepted)&lt;/text>
&lt;text x="20" y="325" class="sub">→ 4 new tokens in a single target iteration. Without speculative it would be 4 iterations.&lt;/text>
&lt;/svg>
&lt;/div>
&lt;h2 id="why-quality-does-not-degrade-the-proof">Why quality does not degrade (the proof)&lt;/h2>
&lt;p>This is the part of the technique that confuses people most the first time. It looks like magic: how can sampling from an arbitrary draft and then &amp;ldquo;validating&amp;rdquo; produce exactly the same distribution as sampling from the original target?&lt;/p>
&lt;p>The proof fits in two lines. For any token &lt;code>x&lt;/code>, the final probability of emitting it is the sum of two disjoint events: the draft proposes it and it is accepted, or the draft proposes something else, it is rejected, and sampling from the residual yields &lt;code>x&lt;/code>. Formally:&lt;/p>
$$P(\text{emit } x) = q(x) \cdot \min\!\left(1, \frac{p(x)}{q(x)}\right) + P(\text{reject}) \cdot \frac{\max(0, p(x)-q(x))}{\sum_y \max(0, p(y)-q(y))}$$
&lt;p>The first term is &lt;code>min(p(x), q(x))&lt;/code>. The second is &lt;code>max(0, p(x) − q(x))&lt;/code> (the total rejected mass &lt;code>Σ max(0, p−q)&lt;/code> cancels the denominator exactly). Adding them: &lt;code>min(p(x), q(x)) + max(0, p(x) − q(x)) = p(x)&lt;/code>. The output is statistically indistinguishable from sampling directly from the target, down to floating-point numerical differences.&lt;/p>
&lt;p>This matters operationally: it means speculative decoding is not perceptual compression, it is not a quality-speed trade-off, it does not require extra validation with evals. If the target would have passed a given eval, the system with speculative passes it too.&lt;/p>
&lt;h2 id="the-maths-that-matters-ceiling-and-speedup">The maths that matters: ceiling and speedup&lt;/h2>
&lt;p>Call α the &lt;strong>acceptance rate&lt;/strong>: the expected probability that an individual draft token is accepted. Assuming that acceptances of consecutive tokens are independent (a reasonable approximation in practice), the expected number of tokens generated per iteration is:&lt;/p>
$$E[\text{tokens per step}] = \sum_{k=0}^{\gamma} \alpha^k + \alpha^{\gamma+1} = \frac{1 - \alpha^{\gamma+1}}{1 - \alpha}$$
&lt;p>And the &lt;strong>theoretical speedup&lt;/strong> relative to generating one token per target iteration, with &lt;code>c = T_draft / T_target&lt;/code> the relative cost of the draft, is:&lt;/p>
$$\text{Speedup} = \frac{1 - \alpha^{\gamma+1}}{(1 - \alpha)(\gamma c + 1)}$$
&lt;p>There is a ceiling that many implementations try to beat and cannot: as &lt;code>γ → ∞&lt;/code>, the speedup converges to:&lt;/p>
$$\lim_{\gamma \to \infty} E[\text{tokens per step}] = \frac{1}{1 - \alpha}$$
&lt;p>It is an algorithmic ceiling, not a hardware one. With α = 0.7 you never generate more than 3.33 tokens per iteration no matter how much the hardware improves. With α = 0.8 → 5. With α = 0.9 → 10. That is why EAGLE-3, which targets α &amp;gt; 0.8 on many benchmarks, is not an incremental improvement over vanilla SD (α ≈ 0.5-0.6): it is a change of regime, because it raises the ceiling instead of merely getting closer to it.&lt;/p>
&lt;p>A concrete numerical example, Llama 3 70B as target with a draft giving α = 0.75, γ = 5, c = 0.1:&lt;/p>
&lt;ul>
&lt;li>Expected tokens per step: &lt;code>(1 − 0.75⁶) / (1 − 0.75) = (1 − 0.178) / 0.25 = 3.29&lt;/code>&lt;/li>
&lt;li>Speedup: &lt;code>3.29 / (5 × 0.1 + 1) = 3.29 / 1.5 = 2.19×&lt;/code>&lt;/li>
&lt;/ul>
&lt;p>If we raise α to 0.85 with the same configuration: tokens per step = &lt;code>(1 − 0.85⁶) / 0.15 = (1 − 0.377) / 0.15 = 4.16&lt;/code>, speedup = &lt;code>4.16 / 1.5 = 2.77×&lt;/code>. A change of α = 0.75 → 0.85 (10 absolute points) raises the speedup by 27 %. That is why the research of the last two years focuses on pushing α: that is where the prize is.&lt;/p>
&lt;h2 id="the-five-modern-families-may-2026">The five modern families (May 2026)&lt;/h2>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Family&lt;/th>
&lt;th>Year&lt;/th>
&lt;th>Core idea&lt;/th>
&lt;th>Draft size&lt;/th>
&lt;th>Typical α / τ&lt;/th>
&lt;th>Speedup&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;strong>Vanilla SD&lt;/strong>&lt;/td>
&lt;td>2023&lt;/td>
&lt;td>Same-family target + draft pair, rejection sampling&lt;/td>
&lt;td>1/10 – 1/100 of target&lt;/td>
&lt;td>0.5 – 0.8&lt;/td>
&lt;td>2-3×&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Medusa&lt;/strong>&lt;/td>
&lt;td>2024&lt;/td>
&lt;td>N extra heads in parallel predict t+1, t+2, &amp;hellip;; tree attention verifies several candidates&lt;/td>
&lt;td>no draft, +1-2 % params&lt;/td>
&lt;td>top-5 &amp;gt; 0.8&lt;/td>
&lt;td>2.18-2.83×&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>EAGLE-1/2/3&lt;/strong>&lt;/td>
&lt;td>2024-25&lt;/td>
&lt;td>Autoregressive draft at the level of &lt;strong>features (hidden states)&lt;/strong>, not tokens. Reuses the target&amp;rsquo;s embedding&lt;/td>
&lt;td>1 transformer block (~0.5-2 % params)&lt;/td>
&lt;td>EAGLE-3: α &amp;gt; 0.8, τ up to 7.5&lt;/td>
&lt;td>up to 6.5× peak&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>MTP&lt;/strong> (DeepSeek-V3)&lt;/td>
&lt;td>2024&lt;/td>
&lt;td>Multi-token heads trained from scratch as part of the model; at inference they act as a &amp;ldquo;free&amp;rdquo; draft&lt;/td>
&lt;td>14B params in V3 671B&lt;/td>
&lt;td>α &amp;gt; 0.8 (MTP1)&lt;/td>
&lt;td>1.5-1.8×&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>P-EAGLE&lt;/strong>&lt;/td>
&lt;td>2026&lt;/td>
&lt;td>EAGLE but producing the γ drafts in &lt;strong>a single forward pass&lt;/strong> (parallel, not autoregressive)&lt;/td>
&lt;td>same as EAGLE&lt;/td>
&lt;td>+30 % over EAGLE-3&lt;/td>
&lt;td>4-5× vs AR&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>Three operational observations:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>EAGLE dominates in production&lt;/strong> because its overhead is minimal (one transformer block, ~1 % of the target in parameters) and its α is high. The draft does not need its own &amp;ldquo;complete&amp;rdquo; KV cache because it shares features with the target.&lt;/li>
&lt;li>&lt;strong>Medusa mattered historically&lt;/strong>, it showed that speculative was possible without a separate draft, but EAGLE beat it on every published benchmark through 2024-2025.&lt;/li>
&lt;li>&lt;strong>MTP is special&lt;/strong>: it is not something you add to an existing model. It is something the model trained natively. If you buy DeepSeek-V3, MTP comes free and gives around 1.8× without touching anything. If you buy Llama 3, there is no MTP to be had; use EAGLE-3.&lt;/li>
&lt;/ol>
&lt;p>There are also two related techniques that deserve a brief mention, both without a draft model: &lt;strong>Lookahead decoding&lt;/strong> (Fu et al. 2024), which formulates decoding as Jacobi iteration and extracts n-grams from the trajectory; and &lt;strong>REST&lt;/strong> (He et al. 2024), which keeps an n-gram datastore and proposes drafts by longest-prefix match against the last generated tokens. Both give 1.5-2× with no extra VRAM. Useful when you have no trained draft model and do not want to maintain one.&lt;/p>
&lt;h2 id="real-implementations-in-may-2026">Real implementations in May 2026&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>vLLM v0.16+&lt;/strong>: unified support for EAGLE-1/2/3, P-EAGLE, Medusa, native MTP (DeepSeek-V3 and variants), n-gram/suffix decoding without a draft, an arbitrary draft model and MLP speculators. The canonical flag is &lt;code>--speculative-config '{&amp;quot;method&amp;quot;:&amp;quot;eagle3&amp;quot;, &amp;quot;model&amp;quot;:&amp;quot;...&amp;quot;, &amp;quot;num_speculative_tokens&amp;quot;: 5}'&lt;/code>.&lt;/li>
&lt;li>&lt;strong>SGLang&lt;/strong>: native EAGLE-3 support with &lt;code>--speculative-algorithm EAGLE3&lt;/code>. For DeepSeek-V3 it uses MTP through an EAGLE adapter. It has its own draft training framework (SpecForge).&lt;/li>
&lt;li>&lt;strong>TensorRT-LLM&lt;/strong>: Medusa, EAGLE (a simplified variant without a tree), ReDrafter, Lookahead. They report around 2.2× with EAGLE.&lt;/li>
&lt;li>&lt;strong>llama.cpp&lt;/strong>: basic speculative only with a draft model (&lt;code>--model-draft&lt;/code>). No native EAGLE/Medusa/MTP as far as I have verified. Typical speedup 1.5-2.5× single-user.&lt;/li>
&lt;/ul>
&lt;h2 id="when-speculative-does-not-help">When speculative does NOT help&lt;/h2>
&lt;p>The technique has three important blind spots:&lt;/p>
&lt;p>&lt;strong>Large batch.&lt;/strong> The GPU moves from memory-bound (decode at low concurrency) to compute-bound (decode at high concurrency). In the compute-bound regime the &amp;ldquo;almost free&amp;rdquo; target forward passes stop being free: γ tokens start costing γ times more instead of nearly 1. The typical crossover is at &lt;strong>batch 16-32 for dense models&lt;/strong>; for MoE with few active parameters per token the crossover happens later. At load peaks, speculative can worsen aggregate throughput per GPU.&lt;/p>
&lt;p>&lt;strong>Prefill / TTFT.&lt;/strong> Speculative decoding does not touch prefill. The phase that processes the whole prompt stays identical. TTFT does not improve and can get marginally worse because of the draft setup. If the SLA is TTFT-bound (assistants with short outputs, search, RAG with brief answers), this is not the right tool.&lt;/p>
&lt;p>&lt;strong>Short outputs.&lt;/strong> If the model generates 10-20 tokens and the answer is over, the fixed setup overhead is not amortised. Speculative shines with long outputs (300+ tokens): generative assistants, extended code completion, drafting.&lt;/p>
&lt;h2 id="operational-pitfalls">Operational pitfalls&lt;/h2>
&lt;p>&lt;strong>Extra VRAM for the draft.&lt;/strong> In vanilla SD, loading a complete draft plus its KV cache is expensive. Llama 3 8B in BF16 as the draft for a 70B is about 16 GB of weights plus KV cache. On an H100 80 GB with the target already nearly filling it, that can force you to shrink the target&amp;rsquo;s KV cache and lower maximum concurrency. EAGLE solves this: the draft is one transformer block (~1 GB for a 70B) and reuses the target&amp;rsquo;s features.&lt;/p>
&lt;p>&lt;strong>Draft quantisation.&lt;/strong> Quantising the draft to INT4 with GPTQ degrades α substantially (errors in the logits accumulate in the comparison against &lt;code>p&lt;/code>). AWQ holds up better but also lowers α. &lt;strong>Common practice in 2026: target in FP8 or INT4, draft in FP16/BF16&lt;/strong>. The draft is small enough that the VRAM saved by quantising it does not compensate for the drop in α and therefore in speedup. The detail of each format is in &lt;a href="https://blog.lo0.es/en/posts/quantization-llm-inference-fp8-int4-gguf/">Quantisation&lt;/a>.&lt;/p>
&lt;p>&lt;strong>Interaction with continuous batching.&lt;/strong> It does not break it, but it creates &lt;em>nested raggedness&lt;/em>: each request in the batch can accept a different number of tokens on each iteration. vLLM&amp;rsquo;s PagedAttention absorbs it, but the scheduler loses efficiency. At low QPS (conversational assistant, low simultaneous concurrency) the combination is excellent. At high QPS there is real tension, and work such as &lt;em>Goodput-optimized speculative decoding&lt;/em> (Liu et al., 2024) optimises γ dynamically according to the state of the batch.&lt;/p>
&lt;p>&lt;strong>Sampling temperature.&lt;/strong> α falls with high temperatures. At T = 1.0 with creative outputs (free-form writing), α can drop 10-15 points relative to T = 0 with the same model-draft pair. The speedup scales accordingly.&lt;/p>
&lt;h2 id="implications-on-on-premise-hardware">Implications on on-premise hardware&lt;/h2>
&lt;h3 id="on-an-rtx-4090-24-gb-ada-lovelace">On an RTX 4090 (24 GB, Ada Lovelace)&lt;/h3>
&lt;p>The classic use is &lt;strong>vanilla SD with two quantised models&lt;/strong>: for instance, Llama 3 70B AWQ-INT4 as target (~35 GB → needs TP=2 across two 4090s) and Llama 3 8B AWQ-INT4 as draft. In practice, the most realistic single-card case is &lt;strong>Llama 3 8B target + a 1B model as draft&lt;/strong> or &lt;strong>Qwen 3 14B target + Qwen 3 0.5B as draft&lt;/strong>: they fit comfortably and give 1.8-2.5× on conversational tasks. For EAGLE on consumer cards, the official drafts for popular families (Llama 3, Qwen 3) are published on Hugging Face and take up 0.5-2 GB extra.&lt;/p>
&lt;h3 id="on-a-generic-4h100-sxm-cluster-320-gb-nvlink-native-fp8">On a generic 4×H100 SXM cluster (320 GB, NVLink, native FP8)&lt;/h3>
&lt;p>Here EAGLE-3 shines:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Llama 3 70B FP8 + EAGLE-3 draft in FP16&lt;/strong>: the draft takes about 0.7 GB; the target about 70 GB with TP=2 (35 GB per GPU). The speedup observed in reproducible benchmarks is between 2.5× and 4× at batch 1-4, falling to almost break-even at batch 32.&lt;/li>
&lt;li>&lt;strong>DeepSeek-V3 671B FP8 + native MTP&lt;/strong>: the model ships with MTP trained in; there is nothing to add. The speedup is 1.5-1.8× with zero extra VRAM. It is the most efficient option operationally: zero additional pieces.&lt;/li>
&lt;li>&lt;strong>Combining with disaggregated serving&lt;/strong>: as &lt;a href="https://blog.lo0.es/en/posts/disaggregated-serving-prefill-decode-specialised-pods/">Disaggregated serving&lt;/a> explains, prefill and decode can live in separate pods. Speculative applies only in the decode pods, which fits the separation perfectly (prefill is compute-bound and would not benefit).&lt;/li>
&lt;/ul>
&lt;p>The rule of thumb on an H100 cluster in May 2026: &lt;strong>if the model is DeepSeek-V3 / V4 → native MTP, nothing else; if it is Llama 3 / Qwen 3 → EAGLE-3 with the official draft; if it is exotic → vanilla SD with a draft from the same family&lt;/strong>.&lt;/p>
&lt;h2 id="what-we-have-not-covered">What we have not covered&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Training custom EAGLE drafts&lt;/strong> with SpecForge: how to collect target trajectories and train the draft on-policy.&lt;/li>
&lt;li>&lt;strong>Speculative Prefill&lt;/strong> (arXiv:2502.02789): a variant for accelerating TTFT, a different mechanism from the decode one described here.&lt;/li>
&lt;li>&lt;strong>Tree attention in detail&lt;/strong>: how Medusa and EAGLE-2 verify several candidates at once with specific attention masks.&lt;/li>
&lt;li>&lt;strong>MoE + speculative&lt;/strong>: the combination has non-trivial interactions with the expert router. Low activated params keep the memory-bound regime in place even at high batch, which changes the rules.&lt;/li>
&lt;/ul>
&lt;h2 id="see-also">See also&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/kv-cache-working-memory-llm-inference/">KV cache: the working memory that holds up LLM inference&lt;/a> — speculative would not exist without the memory-bound nature of decode, which is a direct consequence of the KV cache; that post gives the framework.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/pagedattention-vllm-block-manager/">PagedAttention deep dive&lt;/a> — vLLM&amp;rsquo;s scheduler has to manage the nested raggedness of the γ tokens accepted per request; PagedAttention is what makes that possible without reserving fixed blocks per session.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/quantization-llm-inference-fp8-int4-gguf/">Quantisation for LLM inference&lt;/a> — a lever orthogonal to and multiplicative with speculative; that post explains why the draft is usually left in BF16 even when the target is in FP8/INT4.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/disaggregated-serving-prefill-decode-specialised-pods/">Disaggregated serving: prefill and decode in specialised pods&lt;/a> — speculative applies only in decode; disaggregation makes that specialisation easy without touching prefill.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/moe-inference-fundamentals-expert-parallel-deepseek-economics/">MoE inference: the call centre with 256 specialists&lt;/a> — the persistent memory-bound regime of MoE means speculative gains more on MoE than on dense at medium batch. MTP in DeepSeek-V3 is speculative decoding native to the model (no external draft) with acceptance around 85-90 % on the second token.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/continuous-batching-orca-vllm-chunked-prefill-goodput/">Continuous batching&lt;/a> — the scheduler where speculative lives. Speculative breaks the symmetry of the batch (each request accepts between 1 and γ+1 tokens per iteration); at high QPS it can reduce goodput if the draft consumes slots from the decode pool.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/six-stage-llmops-pipeline-architecture-and-deep-dive/">The six-stage LLMOps pipeline&lt;/a> — the master map where Deploy is stage 4.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/mixed-nvidia-intel-environments-llm-inference/">Mixed NVIDIA + Intel environments&lt;/a> — the &amp;ldquo;drafter near edge on an Intel NUC + target on a central H100&amp;rdquo; pattern as the canonical case of speculative decoding deployed heterogeneously.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/optimising-decode-vllm-squeezing-every-token-small-hardware/">Optimising decode in vLLM&lt;/a> — the concrete vLLM parameters for turning on speculative decoding in production (&lt;code>--speculative-model&lt;/code>, &lt;code>--num-speculative-tokens&lt;/code>) with reference configs for RTX 4090 and L40.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/knowledge-distillation-teaching-small-model-think-like-big-one/">Knowledge distillation&lt;/a> — the best drafters are not small versions of the base model: they are students distilled specifically to predict the verifier&amp;rsquo;s distribution; distillation explains why EAGLE beats a plain generic 0.5B.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/llm-pruning-cutting-without-amputating/">Pruning LLM models&lt;/a> — an alternative to the distilled drafter: a pruned draft model (layer dropping from the base) as a cheap approximation of the verifier; it works worse than EAGLE but needs no extra training.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/self-speculative-decoding-model-gets-ahead-of-itself/">Self-speculative decoding: the model that gets ahead of itself&lt;/a> — the variant without a separate draft: the model itself run in early-exit acts as the draft and is verified with the full forward pass, zero extra VRAM. It is the form of speculative that fits small models and on-device deployment.&lt;/li>
&lt;/ul>
&lt;h2 id="references">References&lt;/h2>
&lt;ul>
&lt;li>Leviathan, Y., Kalman, M., Matias, Y. &lt;em>Fast Inference from Transformers via Speculative Decoding&lt;/em>. ICML 2023. &lt;a href="https://arxiv.org/abs/2211.17192">https://arxiv.org/abs/2211.17192&lt;/a>&lt;/li>
&lt;li>Chen, C., Borgeaud, S., Irving, G., Lespiau, J.B., Sifre, L., Jumper, J. &lt;em>Accelerating Large Language Model Decoding with Speculative Sampling&lt;/em>. DeepMind 2023. &lt;a href="https://arxiv.org/abs/2302.01318">https://arxiv.org/abs/2302.01318&lt;/a>&lt;/li>
&lt;li>Cai, T., Li, Y., Geng, Z., Peng, H., Lee, J.D., Chen, D., Dao, T. &lt;em>Medusa: Simple LLM Inference Acceleration with Multiple Decoding Heads&lt;/em>. ICML 2024. &lt;a href="https://arxiv.org/abs/2401.10774">https://arxiv.org/abs/2401.10774&lt;/a>&lt;/li>
&lt;li>Li, Y., Wei, F., Zhang, C., Zhang, H. &lt;em>EAGLE: Speculative Sampling Requires Rethinking Feature Uncertainty&lt;/em>. ICML 2024. &lt;a href="https://arxiv.org/abs/2401.15077">https://arxiv.org/abs/2401.15077&lt;/a>&lt;/li>
&lt;li>Li, Y., Wei, F., Zhang, C., Zhang, H. &lt;em>EAGLE-2: Faster Inference of Language Models with Dynamic Draft Trees&lt;/em>. EMNLP 2024. &lt;a href="https://arxiv.org/abs/2406.16858">https://arxiv.org/abs/2406.16858&lt;/a>&lt;/li>
&lt;li>Li, Y., Wei, F., Zhang, C., Zhang, H. &lt;em>EAGLE-3: Scaling up Inference Acceleration of Large Language Models via Training-Time Test&lt;/em>. NeurIPS 2025. &lt;a href="https://arxiv.org/abs/2503.01840">https://arxiv.org/abs/2503.01840&lt;/a>&lt;/li>
&lt;li>DeepSeek-AI. &lt;em>DeepSeek-V3 Technical Report&lt;/em> — Multi-Token Prediction. &lt;a href="https://arxiv.org/abs/2412.19437">https://arxiv.org/abs/2412.19437&lt;/a>&lt;/li>
&lt;li>Fu, Y., Bailis, P., Stoica, I., Zhang, H. &lt;em>Break the Sequential Dependency of LLM Inference Using Lookahead Decoding&lt;/em>. ICML 2024. &lt;a href="https://arxiv.org/abs/2402.02057">https://arxiv.org/abs/2402.02057&lt;/a>&lt;/li>
&lt;li>He, Z., Zhong, Z., Cai, T., Lee, J.D., He, D. &lt;em>REST: Retrieval-Based Speculative Decoding&lt;/em>. NAACL 2024. &lt;a href="https://arxiv.org/abs/2311.08252">https://arxiv.org/abs/2311.08252&lt;/a>&lt;/li>
&lt;li>vLLM speculative decoding docs: &lt;a href="https://docs.vllm.ai/en/latest/features/speculative_decoding/">https://docs.vllm.ai/en/latest/features/speculative_decoding/&lt;/a>&lt;/li>
&lt;li>SGLang speculative decoding docs: &lt;a href="https://docs.sglang.ai/advanced_features/speculative_decoding.html">https://docs.sglang.ai/advanced_features/speculative_decoding.html&lt;/a>&lt;/li>
&lt;li>TensorRT-LLM speculative sampling: &lt;a href="https://nvidia.github.io/TensorRT-LLM/advanced/speculative-decoding.html">https://nvidia.github.io/TensorRT-LLM/advanced/speculative-decoding.html&lt;/a>&lt;/li>
&lt;li>vLLM blog &lt;em>Speculative Decoding in vLLM&lt;/em> (oct 2024): &lt;a href="https://blog.vllm.ai/2024/10/17/spec-decode.html">https://blog.vllm.ai/2024/10/17/spec-decode.html&lt;/a>&lt;/li>
&lt;li>vLLM blog &lt;em>P-EAGLE: Parallel Speculative Decoding in vLLM&lt;/em> (mar 2026): &lt;a href="https://vllm.ai/blog/2026-03-13-p-eagle">https://vllm.ai/blog/2026-03-13-p-eagle&lt;/a>&lt;/li>
&lt;li>Official EAGLE repo: &lt;a href="https://github.com/SafeAILab/EAGLE">https://github.com/SafeAILab/EAGLE&lt;/a>&lt;/li>
&lt;li>Official Medusa repo: &lt;a href="https://github.com/FasterDecoding/Medusa">https://github.com/FasterDecoding/Medusa&lt;/a>&lt;/li>
&lt;/ul></description></item><item><title>LLM inference operators on Kubernetes: OME, vLLM Production Stack, NVIDIA Dynamo and llm-d</title><link>https://blog.lo0.es/en/posts/llm-inference-operators-kubernetes/</link><pubDate>Mon, 18 May 2026 17:00:00 +0200</pubDate><guid>https://blog.lo0.es/en/posts/llm-inference-operators-kubernetes/</guid><description>&lt;h2 id="tldr">TL;DR&lt;/h2>
&lt;p>Serving an LLM in production is not running a binary: it is coordinating a model (tens of gigabytes that take minutes to load), a runtime (vLLM, SGLang, TensorRT-LLM with a hundred flags), heterogeneous GPUs (NVLink, MIG, PCIe), prefill and decode that live better apart, a KV cache that wants offloading to colder tiers, intelligent routing that exploits prefix caching, and autoscaling that reacts to metrics other than CPU%. A flat Kubernetes &lt;code>Deployment&lt;/code> only covers the first 20% of that. The other 80% is covered by LLM inference operators, of which four matter in 2026: &lt;strong>OME&lt;/strong> (LMSYS, July 2025, multi-engine with a focus on SGLang), &lt;strong>vLLM Production Stack&lt;/strong> (a curated Helm chart from vLLM itself with LMCache for tiered KV), &lt;strong>NVIDIA Dynamo&lt;/strong> (the official successor to Triton, multi-engine, with its own Grove scheduler) and &lt;strong>llm-d&lt;/strong> (a CNCF donation of March 2026 by Red Hat + Google + IBM + CoreWeave + NVIDIA, built on vLLM, focused on distributed scale). Behind all four sits &lt;strong>KServe&lt;/strong>, the CNCF parent operator that normalised the &lt;code>InferenceService&lt;/code> concept and that several of them lean on. This article walks through the full hierarchy, gives a decision map and teaches you not to get lost when someone drops seven acronyms in the first meeting.&lt;/p>
&lt;blockquote>
&lt;p>This article closes the LLM inference series. The previous ones were &lt;a href="https://blog.lo0.es/en/posts/kv-cache-working-memory-llm-inference/">KV cache: the working memory that holds up LLM inference&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/vllm-kubernetes-llm-inference-that-scales/">vLLM on Kubernetes: the LLM inference piece that actually scales&lt;/a> and &lt;a href="https://blog.lo0.es/en/posts/pagedattention-vllm-block-manager/">PagedAttention from the inside and the state of the art of the KV cache in 2026&lt;/a>. There we explained what happens inside one inference process. Here we explain how many inference processes are coordinated through Kubernetes.&lt;/p>
&lt;/blockquote>
&lt;h2 id="the-analogy-from-initd-to-systemd-to-operators">The analogy: from &lt;code>init.d&lt;/code> to systemd to operators&lt;/h2>
&lt;p>Anyone with 20 years of sysadmin behind them will recognise the pattern. Decades ago, starting a service on Linux was a shell script in &lt;code>/etc/init.d/&lt;/code>: start, stop, status, reloaded by hand. When services got more complex, with dependencies between them, monitoring, restart on failure, per-user slots, it became obvious that a script was not enough. Along came systemd, which turned &amp;ldquo;a service&amp;rdquo; into a declarative unit with dependencies, resources, restart policy, sockets and timers. The script did not disappear; it moved up one level of abstraction.&lt;/p>
&lt;p>Kubernetes made the same move for distributed services. A &lt;code>Deployment&lt;/code> declares &amp;ldquo;I want N replicas of this container&amp;rdquo;; a &lt;code>Service&lt;/code> declares &amp;ldquo;these replicas are exposed like this&amp;rdquo;; an &lt;code>Ingress&lt;/code> declares &amp;ldquo;this HTTP traffic comes in here&amp;rdquo;. The controller translates the declaration into real state and keeps the system converged.&lt;/p>
&lt;p>Serving LLMs in 2024 was the equivalent of &lt;code>/etc/init.d/&lt;/code>: every team wrote its own &lt;code>Deployment&lt;/code>/&lt;code>Service&lt;/code>/&lt;code>HPA&lt;/code> with custom scripts for model loading, session draining and GPU handling. We covered it in the &lt;a href="https://blog.lo0.es/en/posts/vllm-kubernetes-llm-inference-that-scales/">vLLM on Kubernetes article&lt;/a>: it can be done, and it does work, but it is repetitive, fragile and nobody is extracting the right abstractions. Serving LLMs in 2026 has gone through the same transition as services: the equivalent of systemd has appeared, the inference operators, which normalise the abstractions and let the engineer declare what matters: &amp;ldquo;this model, with this runtime, this scalable, with this routing policy&amp;rdquo;.&lt;/p>
&lt;p>There are four relevant operators in 2026 and a fifth common ancestor. Let us take them in order.&lt;/p>
&lt;h2 id="why-an-operator-and-not-just-a-deployment">Why an operator, and not just a Deployment&lt;/h2>
&lt;p>Listing what an inference operator adds over a flat Deployment is the best way to understand what problem it solves:&lt;/p>
&lt;p>&lt;strong>The model as a first-class citizen.&lt;/strong> In a Deployment, the model is &amp;ldquo;the thing you download in an initContainer and mount as a volume&amp;rdquo;. In an operator, the model is a &lt;code>CustomResource&lt;/code> with metadata (origin, fingerprint, licence, GPU requirements). It can be shared between InferenceServices, versioned, replicated to multiple nodes. It is the difference between &amp;ldquo;a file&amp;rdquo; and &amp;ldquo;a managed artifact&amp;rdquo;.&lt;/p>
&lt;p>&lt;strong>The runtime as a first-class citizen.&lt;/strong> The same goes for the runtime (vLLM/SGLang/TRT-LLM): it is not &amp;ldquo;a Docker image with flags&amp;rdquo;; it is a &lt;code>ServingRuntime&lt;/code> that declares which args it accepts, which metrics it exports, which deployment types it supports (single-node, multi-node TP, PD-disag). Changing runtime is changing a reference, not rewriting every manifest.&lt;/p>
&lt;p>&lt;strong>Declarative composition.&lt;/strong> An &lt;code>InferenceService&lt;/code> (the core CRD of KServe and its descendants) references a model and a runtime, declares the scaling policy, wires up observability and configures routing. The controller composes all the pieces: Deployment(s), Service, HPA, possibly a LeaderWorkerSet, a KEDA ScaledObject, a Gateway API HTTPRoute. You declare intent; the operator emits the 8 derived resources.&lt;/p>
&lt;p>&lt;strong>Operational prefill–decode disaggregation.&lt;/strong> As we saw in the PagedAttention article, separating prefill and decode into distinct pools can give 7× goodput. Modelling that with flat Deployments is feasible, but it requires coordinating two sets of pods, a transport to move the KV cache and conditional routing. An operator models it as a single &lt;code>InferenceService&lt;/code> with two sub-pools.&lt;/p>
&lt;p>&lt;strong>Autoscaling on LLM metrics.&lt;/strong> The standard HPA does not understand &lt;code>vllm:num_requests_waiting&lt;/code>. An operator integrates KEDA or Prometheus Adapter automatically and exposes the right metrics as knobs on the CRD.&lt;/p>
&lt;p>&lt;strong>Multi-tenancy.&lt;/strong> Multiple models on the same cluster, with quotas, priorities and fairness. One Deployment per model scaling independently is fine up to the fifth model; beyond that, coordinating GPUs between tenants becomes operationally hostile.&lt;/p>
&lt;p>&lt;strong>Model lifecycle.&lt;/strong> Weights on a shared PVC, warm-up of the first pod, rolling updates with &lt;code>maxUnavailable: 0&lt;/code>, draining of active sessions, integrated observability. Things that with a flat Deployment have to be reinvented by every team.&lt;/p>
&lt;p>If your workload is one model, one node, up to three replicas, a flat Deployment is enough and an operator is overkill. If your workload is two or more models, serious scaling, disaggregation or multi-tenancy, an operator stops being optional.&lt;/p>
&lt;h2 id="kserve-the-common-ancestor">KServe: the common ancestor&lt;/h2>
&lt;p>Before the four new ones, we have to mention &lt;a href="https://kserve.github.io/website/">KServe&lt;/a>, the parent operator from which all the rest conceptually descend. It was born as KFServing inside the Kubeflow project in 2019, was renamed KServe when it became independent in 2021, and in 2025 was &lt;a href="https://thenewstack.io/kserve-joins-cncf-to-standardize-ai-model-serving-on-kubernetes/">accepted into the CNCF&lt;/a> as a project incubating towards graduation.&lt;/p>
&lt;p>KServe&amp;rsquo;s conceptual contribution is the &lt;code>InferenceService&lt;/code> CRD, which has become the field&amp;rsquo;s common vocabulary: a declarative K8s object that joins a &lt;code>model&lt;/code> (origin + metadata) with a &lt;code>predictor&lt;/code> (runtime + resources) and produces a ready HTTP service. Under the hood, the controller emits Deployments, Services, HorizontalPodAutoscalers, Knative Services if you go serverless, Istio VirtualServices if you do traffic splitting.&lt;/p>
&lt;p>KServe was designed in a pre-LLM era: its first use cases were traditional scikit-learn, TensorFlow and PyTorch models served as simple REST APIs. That gives it strengths (it is mature, with 6 years in production at Bloomberg, JPMorgan and others) and weaknesses (it was not designed to manage multi-node tensor parallel, prefill–decode disaggregation, or the patterns specific to LLMs).&lt;/p>
&lt;p>The way the ecosystem has reacted is elegant: the new LLM operators inherit from or take inspiration from &lt;code>InferenceService&lt;/code> but extend the API with LLM-specific primitives. OME is the clearest example: it uses the name &lt;code>InferenceService&lt;/code> and the idea of &amp;ldquo;model + runtime → service&amp;rdquo;, but adds &lt;code>BaseModel&lt;/code>, a &lt;code>ServingRuntime&lt;/code> with LLM-aware flags, and deployment modes (PD-disag, multi-node) that KServe does not cover natively.&lt;/p>
&lt;h2 id="ome-open-model-engine">OME (Open Model Engine)&lt;/h2>
&lt;p>&lt;a href="https://github.com/ome-projects/ome">OME&lt;/a> was published by the LMSYS team in July 2025 (announced on &lt;a href="https://www.lmsys.org/blog/2025-07-08-ome/">their blog&lt;/a>). It is an operator that understands SGLang deeply (that is its first-class runtime) but also supports vLLM, TensorRT-LLM and Triton.&lt;/p>
&lt;h3 id="the-crd-hierarchy">The CRD hierarchy&lt;/h3>
&lt;p>OME models the domain with four main CRDs:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>&lt;code>BaseModel&lt;/code>&lt;/strong> and &lt;strong>&lt;code>ClusterBaseModel&lt;/code>&lt;/strong>: the model itself. It defines origin (Hugging Face, S3, URL), fingerprint and metadata. The &lt;code>Cluster*&lt;/code> version is global; &lt;code>BaseModel&lt;/code> is namespaced. It lets multiple &lt;code>InferenceService&lt;/code> objects reference the same model without duplicating the download.&lt;/li>
&lt;li>&lt;strong>&lt;code>FineTunedWeight&lt;/code>&lt;/strong>: LoRA adapters or finetuned weights served on top of a &lt;code>BaseModel&lt;/code>. Critical for multi-tenant setups where each customer has their own finetune.&lt;/li>
&lt;li>&lt;strong>&lt;code>ServingRuntime&lt;/code>&lt;/strong> and &lt;strong>&lt;code>ClusterServingRuntime&lt;/code>&lt;/strong>: the runtime (vLLM, SGLang, and so on) with its configuration. It declares which args it accepts, which metrics it exports, which deployment modes it supports.&lt;/li>
&lt;li>&lt;strong>&lt;code>InferenceService&lt;/code>&lt;/strong>: the central declarative piece, joining &lt;code>BaseModel&lt;/code> + &lt;code>ServingRuntime&lt;/code> + infrastructure.&lt;/li>
&lt;/ul>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-yaml" data-lang="yaml">&lt;span class="line">&lt;span class="cl">&lt;span class="nt">apiVersion&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">ome.io/v1beta1&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">kind&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">InferenceService&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">metadata&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">llama3-70b-prod&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">namespace&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">inference&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">spec&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">model&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">meta-llama-3-70b-instruct &lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># reference to a BaseModel&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">runtime&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">sglang-h100 &lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># reference to a ServingRuntime&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">deploymentMode&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">PrefillDecodeDisaggregated &lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># standard | PD | MultiNode | Serverless&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">prefill&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">minReplicas&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">2&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">maxReplicas&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">8&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">resources&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">requests&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">nvidia.com/gpu&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">4&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">decode&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">minReplicas&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">4&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">maxReplicas&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">16&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">resources&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">requests&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">nvidia.com/gpu&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">1&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">router&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">type&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">cache-aware &lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># SGLang router with cache awareness&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">autoscaling&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">metricSource&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">keda&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">metrics&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="nt">type&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">prometheus&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">metricName&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">vllm_requests_waiting&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">threshold&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;10&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>That is what the operator takes as input. The output is roughly 8 derived resources that would be horrible to declare by hand: two LeaderWorkerSets (one per prefill/decode pool), two Services, a Deployment for the router, KEDA ScaledObjects for each pool, a Gateway API HTTPRoute, and a PriorityClass that hooks into Kueue for gang scheduling.&lt;/p>
&lt;h3 id="the-four-deployment-modes">The four deployment modes&lt;/h3>
&lt;p>OME materialises the &lt;code>InferenceService&lt;/code> differently depending on &lt;code>deploymentMode&lt;/code>:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Standard&lt;/strong>: one Deployment with N replicas; the classic. For small or single-GPU models.&lt;/li>
&lt;li>&lt;strong>PrefillDecodeDisaggregated&lt;/strong>: two coordinated pools; the SGLang router routes between them.&lt;/li>
&lt;li>&lt;strong>MultiNode&lt;/strong>: tensor parallel across multiple nodes via LeaderWorkerSet, with NCCL/InfiniBand. For models above 70B where a single node is not enough.&lt;/li>
&lt;li>&lt;strong>Serverless&lt;/strong>: Knative-style scale-to-zero. For sporadic workloads where the cost of keeping GPUs powered up does not pay off. The trade-off: the first request pays the model&amp;rsquo;s cold start cost (minutes).&lt;/li>
&lt;/ul>
&lt;h3 id="integration-with-the-k8s-ecosystem">Integration with the K8s ecosystem&lt;/h3>
&lt;p>OME does not invent primitives where they already exist. It leans on:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://kueue.sigs.k8s.io/">Kueue&lt;/a> for gang scheduling: all the pods of a tensor parallel group have to start at once or not at all; Kueue guarantees it.&lt;/li>
&lt;li>&lt;a href="https://lws.sigs.k8s.io/">LeaderWorkerSet (LWS)&lt;/a> for multi-node: workers join the leader&amp;rsquo;s Ray cluster, with an atomic lifecycle (one going down restarts the group).&lt;/li>
&lt;li>KEDA for autoscaling on LLM-specific Prometheus metrics (queue depth, GPU cache usage, TTFT p95).&lt;/li>
&lt;li>&lt;a href="https://gateway-api.sigs.k8s.io/">Gateway API&lt;/a> and its Inference Extension for advanced routing (model-aware, prefix-aware, weighted canary).&lt;/li>
&lt;/ul>
&lt;p>The consequence: OME feels &amp;ldquo;idiomatically Kubernetes&amp;rdquo;. It does not introduce new concepts where they are not needed; it uses standard primitives and concentrates on what is specific to the LLM domain.&lt;/p>
&lt;h3 id="when-to-choose-it">When to choose it&lt;/h3>
&lt;p>OME is the natural choice if SGLang is your main runtime and/or if you come from the KServe ecosystem and want an idiomatic evolution of it. It is mature but relatively young (a year old at the time of writing); expect rough edges on advanced features.&lt;/p>
&lt;h2 id="vllm-production-stack">vLLM Production Stack&lt;/h2>
&lt;p>&lt;a href="https://github.com/vllm-project/production-stack">vLLM Production Stack&lt;/a> is the official project from vLLM itself for production on Kubernetes. Its philosophy is the opposite of OME&amp;rsquo;s: instead of an operator with new CRDs, it is a curated Helm chart that deploys a coherent set of pieces.&lt;/p>
&lt;h3 id="the-three-pieces">The three pieces&lt;/h3>
&lt;p>The stack has three components:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>Serving engines&lt;/strong>: vLLM pods, configured with the flags we have been seeing throughout the series (&lt;code>--enable-prefix-caching&lt;/code>, &lt;code>--kv-cache-dtype fp8&lt;/code>, and so on). The Helm chart lets you declare them as a list; it deploys the underlying Deployments and Services.&lt;/li>
&lt;li>&lt;strong>Request router&lt;/strong>: a proxy in front of the engines that decides which one each request goes to. It supports several policies:
&lt;ul>
&lt;li>&lt;strong>Round-robin&lt;/strong>: trivial, for a baseline.&lt;/li>
&lt;li>&lt;strong>Session-based&lt;/strong>: pins each session to one replica to keep its KV cache.&lt;/li>
&lt;li>&lt;strong>Prefix-aware&lt;/strong>: detects shared prefixes between requests and routes them to the replica that already has them cached.&lt;/li>
&lt;li>&lt;strong>KV-aware&lt;/strong>: sees each replica&amp;rsquo;s &lt;code>gpu_cache_usage_perc&lt;/code> and avoids the saturated ones.&lt;/li>
&lt;li>&lt;strong>Disaggregated-prefill&lt;/strong> with native LMCache: separates prefill and decode, with LMCache as the transport for the KV cache between the two.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>&lt;strong>Observability stack&lt;/strong>: Prometheus + Grafana with ready-made dashboards. It measures TTFT, TBT (Time-Between-Tokens), throughput, queue depth and GPU memory.&lt;/li>
&lt;/ol>
&lt;h3 id="lmcache-and-tiered-kv">LMCache and tiered KV&lt;/h3>
&lt;p>One of the most interesting pieces the stack brings is &lt;a href="https://github.com/LMCache/LMCache">LMCache&lt;/a>, which adds a KV cache with multiple tiers: GPU HBM as L1, CPU RAM as L2, local disk as L3, and optionally remote storage as L4. When a KV cache block does not fit in HBM, instead of evicting and recomputing it, LMCache drops it to a lower tier. For workloads with shared prefixes and multi-turn conversations, the saving is huge.&lt;/p>
&lt;p>LMCache integrates as a sidecar to the engines and as part of the transport in disaggregated-prefill. Production Stack ships it enabled by default in its Helm chart.&lt;/p>
&lt;h3 id="a-typical-manifest-valuesyaml">A typical manifest (values.yaml)&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-yaml" data-lang="yaml">&lt;span class="line">&lt;span class="cl">&lt;span class="nt">servingEngineSpec&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">modelSpec&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="nt">name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">llama3-8b&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">repository&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">vllm/vllm-openai&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">tag&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">v0.6.3&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">modelURL&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">meta-llama/Meta-Llama-3-8B-Instruct&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">replicaCount&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">3&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">requestCPU&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">4&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">requestMemory&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">16Gi&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">requestGPU&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">1&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">vllmConfig&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">enablePrefixCaching&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">true&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">kvCacheDtype&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">fp8&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">maxModelLen&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">32768&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">enableChunkedPrefill&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">true&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">routerSpec&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">routingLogic&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">prefix-aware &lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># round-robin | session | prefix-aware | kv-aware&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">sessionKey&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">x-user-id &lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># when routingLogic=session&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">cacheserverSpec&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">enabled&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">true&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># LMCache for tiered KV&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">storageBackends&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">cpu&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">disk &lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># offload to local disk&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">observabilitySpec&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">prometheus&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">enabled&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">true&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">grafana&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">enabled&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">true&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">dashboards&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">vllm-engine-metrics&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">lmcache-metrics&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>This is declarative but these are not CRDs: they are Helm chart values. The difference with OME is not semantic (both start from declaration) but operational: with Helm, changes go through &lt;code>helm upgrade&lt;/code>; with CRDs, they go through &lt;code>kubectl apply&lt;/code>. For teams already living in GitOps with Argo CD or Flux, both approaches integrate cleanly, but the flows are different.&lt;/p>
&lt;h3 id="when-to-choose-it-1">When to choose it&lt;/h3>
&lt;p>If vLLM is your only runtime and you want the closest thing to &amp;ldquo;the happy path the project recommends&amp;rdquo;, this one. It is the productionised version maintained by the same people who write the engine. The downsides: it ties you to vLLM (it is not generic) and it does not solve some advanced cases such as multi-tenancy with strict quotas or gang scheduling, where OME or full-fledged operators are better.&lt;/p>
&lt;h2 id="nvidia-dynamo">NVIDIA Dynamo&lt;/h2>
&lt;p>&lt;a href="https://developer.nvidia.com/dynamo">NVIDIA Dynamo&lt;/a> is the official successor to Triton Inference Server, announced at GTC 2025 and merged into the brand as Dynamo-Triton in March of that year. Triton had spent years as the most-used inference engine in &amp;ldquo;serious&amp;rdquo; NVIDIA infrastructures; Dynamo is what NVIDIA believes the new generation needs.&lt;/p>
&lt;h3 id="what-it-is-exactly">What it is exactly&lt;/h3>
&lt;p>Dynamo is a distributed inference framework, not exactly a Kubernetes operator. It has its own runtime (it can run engines), a scheduler (Grove), intelligent routing, multi-tier KV cache management and disaggregation. It supports SGLang, TensorRT-LLM and vLLM as engines, but the engines are executed by Dynamo, not the other way round: the model is &amp;ldquo;Dynamo manages, the engine executes&amp;rdquo;.&lt;/p>
&lt;p>On Kubernetes, Dynamo is deployed via its own operator plus CRDs, normalised with the K8s integration NVIDIA formalised at the end of 2025 (covered by &lt;a href="https://www.infoq.com/news/2025/12/nvidia-dynamo-kubernetes/">this InfoQ piece&lt;/a>). The CRDs are product-specific: they define a &lt;code>DynamoCluster&lt;/code>, a topology of prefill/decode workers and a routing policy.&lt;/p>
&lt;h3 id="the-four-contributions">The four contributions&lt;/h3>
&lt;p>Dynamo is sold on four pillars, with figures reported by NVIDIA:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>Disaggregated serving&lt;/strong> built in, with its own scheduler.&lt;/li>
&lt;li>&lt;strong>Smart routing&lt;/strong> based on cache state: if a worker already has most of a prompt cached, the request goes there.&lt;/li>
&lt;li>&lt;strong>Multi-tier KV cache&lt;/strong>: analogous to LMCache, with HBM/RAM/SSD/NVMe.&lt;/li>
&lt;li>&lt;strong>Autoscaling&lt;/strong> integrated with Dynamo&amp;rsquo;s scheduler.&lt;/li>
&lt;/ol>
&lt;p>The marketing figure: up to 30× more throughput than legacy Triton on the same hardware. With all the caution a vendor benchmark deserves.&lt;/p>
&lt;h3 id="grove-its-own-scheduler">Grove: its own scheduler&lt;/h3>
&lt;p>A controversial decision in Dynamo is not to rely 100% on the Kubernetes scheduler and instead bring its own scheduler, called Grove, that understands GPU topologies. Grove decides which worker runs on which physical GPU, which interconnects (NVLink/InfiniBand) are relevant, and how to distribute tensor parallel across nodes. That gives it more control than the standard kube-scheduler.&lt;/p>
&lt;p>Operationally: if your cluster is &amp;ldquo;pure Kubernetes&amp;rdquo; with kube-scheduler and heterogeneous workloads (not only LLMs), Grove adds one more component to operate. If your cluster is dedicated to LLM inference and there is already a team dedicated to running it, Grove gives you more levers.&lt;/p>
&lt;h3 id="when-to-choose-it-2">When to choose it&lt;/h3>
&lt;p>Dynamo makes sense if:&lt;/p>
&lt;ul>
&lt;li>Your infrastructure is NVIDIA-heavy (Hopper, Blackwell, GB200) and you want to exploit the latest in TensorRT-LLM with the familiar Triton integration, modernised.&lt;/li>
&lt;li>You were already a Triton user for legacy inference (vision, recommendation) and want to keep the ecosystem.&lt;/li>
&lt;li>You have a dedicated SRE team for inference and Grove&amp;rsquo;s extra operational complexity is not a problem.&lt;/li>
&lt;/ul>
&lt;p>It is the vendor-specific option of the quartet. In exchange it gives you NVIDIA&amp;rsquo;s support and first-rate integration with their hardware. If your organisation is already fighting NVIDIA for GPUs, they may even call you offering help with Dynamo.&lt;/p>
&lt;h2 id="llm-d">llm-d&lt;/h2>
&lt;p>&lt;a href="https://github.com/llm-d/llm-d">llm-d&lt;/a> is the youngest and the most &amp;ldquo;political&amp;rdquo; of the four. In March 2026, at &lt;a href="https://siliconangle.com/2026/03/24/red-hat-bets-big-kubernetes-inference-llm-d-kubeconeu/">KubeCon Europe Amsterdam&lt;/a>, Red Hat, Google Cloud, IBM Research, CoreWeave and NVIDIA announced the joint donation of the project to the CNCF as a Sandbox project, with backing from AMD, Cisco, Hugging Face, Intel, Lambda, Mistral AI, UC Berkeley and the University of Chicago. An explicit coalition for vendor neutrality.&lt;/p>
&lt;h3 id="philosophy">Philosophy&lt;/h3>
&lt;p>llm-d positions itself as the vendor-neutral &amp;ldquo;Kubernetes blueprint&amp;rdquo; for distributed inference. It is not a runtime; it is a system that sits on top of vLLM (the default engine) and orchestrates the control plane.&lt;/p>
&lt;p>The primitives the project puts on the table:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Intelligent routing&lt;/strong> with prefix-cache awareness and load-aware balancing.&lt;/li>
&lt;li>&lt;strong>Tiered KV cache&lt;/strong> with offload to CPU and disk for multi-turn.&lt;/li>
&lt;li>&lt;strong>Prefill/decode disaggregation&lt;/strong> over fast interconnects.&lt;/li>
&lt;li>&lt;strong>Wide expert parallelism&lt;/strong> for serving very large Mixture-of-Experts (MoE) models, a critical pattern popularised by DeepSeek-V3 and Mixtral, where the experts live on different GPUs and tokens have to be routed to the right expert.&lt;/li>
&lt;/ul>
&lt;h3 id="numbers">Numbers&lt;/h3>
&lt;p>The &lt;a href="https://github.com/llm-d/llm-d/releases">v0.5 release&lt;/a> validates ~3.1k tok/s per decode GPU on B200, and up to 50k output tok/s on a 16×16 B200 prefill/decode topology. The most interesting benchmark: an order-of-magnitude reduction in TTFT against a round-robin baseline. In other words, intelligent routing is worth what they say it is.&lt;/p>
&lt;h3 id="cncf-and-the-future">CNCF and the future&lt;/h3>
&lt;p>Donating to the CNCF as a Sandbox project means neutral governance: no vendor is in charge. For an organisation wary of being tied to a single supplier, llm-d is probably the safest medium-term bet. The price: like any Sandbox project, it is not yet &amp;ldquo;boring&amp;rdquo; in the way vLLM is. There is API churn, features that move around, documentation that lags the code.&lt;/p>
&lt;h3 id="when-to-choose-it-3">When to choose it&lt;/h3>
&lt;p>llm-d makes sense if:&lt;/p>
&lt;ul>
&lt;li>You want multi-vendor portability without ties to NVIDIA, Red Hat or Google.&lt;/li>
&lt;li>Your workload includes large MoE models (DeepSeek-V3, Mixtral 8x22B, Llama 4 Behemoth if the size is confirmed), where wide expert parallelism is decisive.&lt;/li>
&lt;li>Your organisation is already comfortable with CNCF Sandbox (projects under active evolution, not yet a stable 1.0).&lt;/li>
&lt;li>You want to bet on the project that will probably be the de facto standard in 2-3 years.&lt;/li>
&lt;/ul>
&lt;h2 id="the-common-ancestor-is-still-there-kserve">The common ancestor is still there: KServe&lt;/h2>
&lt;p>It is worth reconnecting before the comparison: KServe is still alive and heavily used in organisations that serve both LLMs and traditional models (scikit-learn, XGBoost, PyTorch CV). Its &lt;code>InferenceService&lt;/code> is generic enough to serve any model, including vLLM or SGLang as a &lt;code>ServingRuntime&lt;/code>. What it does not do well is the LLM-specific part: disaggregation, multi-node tensor parallel, routing with KV cache awareness. If your organisation already has KServe in production for other models, adding an LLM-specific operator alongside it (OME, vLLM Stack or llm-d) is reasonable. Fighting it all out from pure KServe is not.&lt;/p>
&lt;h2 id="decision-map">Decision map&lt;/h2>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Dimension&lt;/th>
&lt;th>OME&lt;/th>
&lt;th>vLLM Prod Stack&lt;/th>
&lt;th>NVIDIA Dynamo&lt;/th>
&lt;th>llm-d&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;strong>Philosophy&lt;/strong>&lt;/td>
&lt;td>Classic K8s-idiomatic operator&lt;/td>
&lt;td>Curated Helm chart&lt;/td>
&lt;td>Framework with its own scheduler&lt;/td>
&lt;td>Vendor-neutral CNCF blueprint&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Own CRDs&lt;/strong>&lt;/td>
&lt;td>Yes (BaseModel, ServingRuntime, InferenceService&amp;hellip;)&lt;/td>
&lt;td>No (Helm values)&lt;/td>
&lt;td>Yes (DynamoCluster)&lt;/td>
&lt;td>Yes (KServe-derived + extensions)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Primary runtime&lt;/strong>&lt;/td>
&lt;td>SGLang (first class), also vLLM/TRT-LLM/Triton&lt;/td>
&lt;td>vLLM only&lt;/td>
&lt;td>TensorRT-LLM (first class), also SGLang/vLLM&lt;/td>
&lt;td>vLLM (first class)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>PD-disaggregation&lt;/strong>&lt;/td>
&lt;td>Yes, declarative&lt;/td>
&lt;td>Yes, with LMCache&lt;/td>
&lt;td>Yes, own scheduler&lt;/td>
&lt;td>Yes, native&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Multi-node TP&lt;/strong>&lt;/td>
&lt;td>Yes, via LWS&lt;/td>
&lt;td>Limited&lt;/td>
&lt;td>Yes, via Grove&lt;/td>
&lt;td>Yes, via LWS and MoE EP&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Multi-model in a cluster&lt;/strong>&lt;/td>
&lt;td>Yes, mature multi-tenant&lt;/td>
&lt;td>Yes (list of models in values)&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>Yes&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Multi-LoRA&lt;/strong>&lt;/td>
&lt;td>Yes, first class (FineTunedWeight CRD)&lt;/td>
&lt;td>Limited&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>On the roadmap&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Tiered KV cache&lt;/strong>&lt;/td>
&lt;td>Via LMCache (external integration)&lt;/td>
&lt;td>Native LMCache&lt;/td>
&lt;td>Own multi-tier&lt;/td>
&lt;td>Yes, native&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Intelligent routing&lt;/strong>&lt;/td>
&lt;td>Cache-aware via the SGLang router&lt;/td>
&lt;td>Prefix-aware / KV-aware / session-based&lt;/td>
&lt;td>Own smart routing&lt;/td>
&lt;td>Prefix-cache + load-aware&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>GPU scheduler&lt;/strong>&lt;/td>
&lt;td>kube-scheduler + Kueue&lt;/td>
&lt;td>kube-scheduler&lt;/td>
&lt;td>Grove (its own)&lt;/td>
&lt;td>kube-scheduler + Kueue&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Hardware&lt;/strong>&lt;/td>
&lt;td>NVIDIA, AMD ROCm, Intel&lt;/td>
&lt;td>NVIDIA, AMD ROCm&lt;/td>
&lt;td>NVIDIA only (with emphasis)&lt;/td>
&lt;td>NVIDIA, AMD, Intel — neutral&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Maturity (mid-2026)&lt;/strong>&lt;/td>
&lt;td>Young, evolving&lt;/td>
&lt;td>Stable&lt;/td>
&lt;td>Stable, vendor-driven&lt;/td>
&lt;td>CNCF Sandbox, evolving fast&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Governance&lt;/strong>&lt;/td>
&lt;td>LMSYS (academic-industrial)&lt;/td>
&lt;td>vLLM project (academic)&lt;/td>
&lt;td>NVIDIA (vendor)&lt;/td>
&lt;td>CNCF (neutral)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Learning curve&lt;/strong>&lt;/td>
&lt;td>Medium (4 new CRDs)&lt;/td>
&lt;td>Low (familiar Helm values)&lt;/td>
&lt;td>Medium-high (Grove + own CRDs)&lt;/td>
&lt;td>Medium (similar to extended KServe)&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h3 id="when-to-choose-each-one">When to choose each one&lt;/h3>
&lt;p>&lt;strong>Choose OME&lt;/strong> if:&lt;/p>
&lt;ul>
&lt;li>SGLang is your main engine.&lt;/li>
&lt;li>You need multi-LoRA serving in production.&lt;/li>
&lt;li>The hierarchical abstraction (BaseModel → ServingRuntime → InferenceService) fits you and you come from, or live alongside, KServe.&lt;/li>
&lt;li>You have an appetite for a young and very active project.&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Choose vLLM Production Stack&lt;/strong> if:&lt;/p>
&lt;ul>
&lt;li>vLLM is your only engine and you want to align with what the project recommends.&lt;/li>
&lt;li>Your team already lives in Helm and does not want to learn new CRDs.&lt;/li>
&lt;li>LMCache + advanced routing inside a single Helm chart is exactly what you need.&lt;/li>
&lt;li>Your scale is medium (tens of replicas), not extreme.&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Choose NVIDIA Dynamo&lt;/strong> if:&lt;/p>
&lt;ul>
&lt;li>Your infrastructure is NVIDIA-heavy and you want the most optimised path for Hopper/Blackwell.&lt;/li>
&lt;li>You already ran Triton for legacy inference and the transition is natural.&lt;/li>
&lt;li>You accept vendor lock-in in exchange for direct NVIDIA support.&lt;/li>
&lt;li>Your organisation has a dedicated SRE team for inference.&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Choose llm-d&lt;/strong> if:&lt;/p>
&lt;ul>
&lt;li>You want to bet on the future CNCF standard, neutral between vendors.&lt;/li>
&lt;li>Your workload includes large MoE models with wide expert parallelism.&lt;/li>
&lt;li>You operate multi-cloud or multi-hardware and portability is valuable.&lt;/li>
&lt;li>You accept the immaturity of a Sandbox project in exchange for the bet on the future.&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Choose pure KServe&lt;/strong> if:&lt;/p>
&lt;ul>
&lt;li>You already serve non-LLM models and want to unify; LLMs are a minority of your workload.&lt;/li>
&lt;li>You need the most conservative and mature use case.&lt;/li>
&lt;li>You accept that advanced LLM features (disaggregation, MoE EP, smart routing) are yours to add with external pieces.&lt;/li>
&lt;/ul>
&lt;h3 id="concrete-scenarios">Concrete scenarios&lt;/h3>
&lt;p>&lt;strong>Scenario A — Small startup, 1-2 models, 1-3 GPU nodes.&lt;/strong> You probably do not need an operator. Deployment + Service + HPA with KEDA metrics, as in the vLLM on Kubernetes article. When you grow to 5+ models, reassess.&lt;/p>
&lt;p>&lt;strong>Scenario B — Mid-sized company, 5-15 models, internal multi-tenant.&lt;/strong> vLLM Production Stack or OME are the reasonable options. Production Stack if vLLM is all you are going to use; OME if you want runtime flexibility and idiomatic CRDs.&lt;/p>
&lt;p>&lt;strong>Scenario C — Internal corporate platform or an external service for end customers.&lt;/strong> llm-d or Dynamo. llm-d if you value vendor neutrality; Dynamo if you live on NVIDIA infrastructure and want the path they recommend.&lt;/p>
&lt;p>&lt;strong>Scenario D — Mixed cluster of LLMs plus traditional models.&lt;/strong> KServe as the base, with an LLM operator alongside (OME is the most natural given its conceptual kinship).&lt;/p>
&lt;h2 id="common-traps">Common traps&lt;/h2>
&lt;p>&lt;strong>&amp;ldquo;I&amp;rsquo;ll start with pure KServe because it&amp;rsquo;s mature&amp;rdquo;.&lt;/strong> For mid-sized LLMs and up, pure KServe leaves a lot of optimisation on the table. The sensible route is KServe as the base if you live alongside other models, but with an LLM-specific operator next to it.&lt;/p>
&lt;p>&lt;strong>&amp;ldquo;I&amp;rsquo;ll wire everything by hand to understand it&amp;rdquo;.&lt;/strong> Reasonable in a PoC, suicidal in production. There are 8 derived resources per model. Multiply by 10 models. You are writing 80 YAMLs and maintaining them. Use an operator.&lt;/p>
&lt;p>&lt;strong>&amp;ldquo;I&amp;rsquo;ll pick the one I like best and pivot if I&amp;rsquo;m wrong&amp;rdquo;.&lt;/strong> Pivoting between operators is not free: although the &lt;code>InferenceService&lt;/code> abstraction is converging, the details (how LoRA is modelled, how routing is configured, how metrics are exposed) vary. Migrating from OME to Dynamo is a project of weeks, not days.&lt;/p>
&lt;p>&lt;strong>&amp;ldquo;I&amp;rsquo;ll go with Dynamo because it&amp;rsquo;s NVIDIA&amp;rsquo;s and therefore better&amp;rdquo;.&lt;/strong> Only if your organisation is already aligned with its operational philosophy (its own scheduler, acceptable vendor lock-in). For many cases, vLLM Production Stack or llm-d give 95% of the value with less friction.&lt;/p>
&lt;p>&lt;strong>&amp;ldquo;Helm chart vs operator is a technical decision&amp;rdquo;.&lt;/strong> It is a cultural and operational decision. If your team ships via Argo CD with Helm values in Git, Production Stack fits without friction. If your team lives in direct &lt;code>kubectl apply -f&lt;/code> and the idea of operators feels natural, OME or llm-d.&lt;/p>
&lt;h2 id="what-we-have-not-covered">What we have not covered&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>&lt;a href="https://github.com/kvcache-ai/Mooncake">Mooncake&lt;/a>&lt;/strong>: the KV cache system shared between instances that Kimi/Moonshot runs in production across hundreds of millions of queries. It is a primitive (not a complete operator), but it integrates as a cache tier with several of the above.&lt;/li>
&lt;li>&lt;strong>&lt;a href="https://docs.ray.io/en/latest/serve/llm/serving-llms.html">Ray Serve LLM&lt;/a>&lt;/strong>: Anyscale&amp;rsquo;s offering, on Kubernetes through KubeRay. More tied to the Ray ecosystem than to native K8s CRDs. Useful if Ray is already part of your infrastructure.&lt;/li>
&lt;li>&lt;strong>&lt;a href="https://fireworks.ai/">Fireworks AI&lt;/a>, &lt;a href="https://www.modular.com/">Modular MAX&lt;/a>&lt;/strong>: commercial platforms with similar primitives, but hosted. They are not K8s operators; they are competitors at another layer.&lt;/li>
&lt;li>&lt;strong>Gateway API Inference Extension&lt;/strong>: the sigwg proposal to extend Gateway API with LLM primitives (model-aware routing, sticky sessions, fairness). In 2026 it is in alpha; the operators above are already starting to support it. When it matures, routing will stop being each operator&amp;rsquo;s problem and become part of the Kubernetes standard.&lt;/li>
&lt;li>&lt;strong>A generic inference observability stack&lt;/strong>: Prometheus + Grafana is standardising around the &lt;code>vllm:*&lt;/code> metrics we covered in the vLLM article. There is an OpenTelemetry effort for LLMs (&lt;code>gen-ai&lt;/code> semantic conventions) that is probably the next link in the chain.&lt;/li>
&lt;/ul>
&lt;h2 id="closing-the-series">Closing the series&lt;/h2>
&lt;p>This series of four articles has walked through LLM inference in production from the bottom up:&lt;/p>
&lt;ol>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/kv-cache-working-memory-llm-inference/">KV cache: the working memory that holds up LLM inference&lt;/a> — why each token consumes VRAM, and how much.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/vllm-kubernetes-llm-inference-that-scales/">vLLM on Kubernetes: the LLM inference piece that actually scales&lt;/a> — how a model is served in production with a serious Deployment.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/pagedattention-vllm-block-manager/">PagedAttention from the inside and the state of the art of the KV cache in 2026&lt;/a> — what happens inside the engine at block level, and what has arrived since.&lt;/li>
&lt;li>This one — how many models are orchestrated in a cluster.&lt;/li>
&lt;/ol>
&lt;p>If you have got this far, you have the vocabulary and the map to sit in a meeting where five people throw acronyms around and place each one correctly. And, more importantly, to start making reasoned decisions about where to begin.&lt;/p>
&lt;h2 id="see-also">See also&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/kserve-open-inference-protocol-control-plane/">Chain of trust for the model (1/4): KServe and the Open Inference Protocol&lt;/a> — the KServe deep dive, the common ancestor this post cites: InferenceService, ServingRuntime, deployment modes and the V2 API contract against the OpenAI API.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/model-chain-of-trust-where-the-bytes-live-registry-oci-artefacts/">Chain of trust for the model (2/4): registry, OCI artifacts and distribution&lt;/a> — where the &lt;code>storageUri&lt;/code> of any of these operators gets its weights from.&lt;/li>
&lt;/ul>
&lt;h2 id="references">References&lt;/h2>
&lt;p>Operators and projects covered:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://github.com/ome-projects/ome">OME — Open Model Engine (GitHub)&lt;/a> — LMSYS operator for LLM serving with SGLang/vLLM/TRT-LLM/Triton.&lt;/li>
&lt;li>&lt;a href="https://www.lmsys.org/blog/2025-07-08-ome/">Introducing OME (LMSYS Blog, jul 2025)&lt;/a> — announcement and architecture.&lt;/li>
&lt;li>&lt;a href="https://github.com/vllm-project/production-stack">vLLM Production Stack (GitHub)&lt;/a> — official vLLM Helm chart for K8s.&lt;/li>
&lt;li>&lt;a href="https://docs.vllm.ai/projects/production-stack/en/latest/deployment/">vLLM Production Stack docs&lt;/a> — installation and configuration.&lt;/li>
&lt;li>&lt;a href="https://github.com/LMCache/LMCache">LMCache (GitHub)&lt;/a> — KV cache with tiers.&lt;/li>
&lt;li>&lt;a href="https://developer.nvidia.com/dynamo">NVIDIA Dynamo&lt;/a> — successor to Triton.&lt;/li>
&lt;li>&lt;a href="https://www.infoq.com/news/2025/12/nvidia-dynamo-kubernetes/">NVIDIA Dynamo Addresses Multi-Node LLM Inference Challenges (InfoQ, dic 2025)&lt;/a> — K8s integration.&lt;/li>
&lt;li>&lt;a href="https://github.com/llm-d/llm-d">llm-d (GitHub)&lt;/a> — CNCF Sandbox project.&lt;/li>
&lt;li>&lt;a href="https://thenewstack.io/llm-d-cncf-kubernetes-inference/">IBM, Red Hat, and Google donated llm-d to CNCF (The New Stack)&lt;/a> — KubeCon EU 2026 announcement.&lt;/li>
&lt;li>&lt;a href="https://siliconangle.com/2026/03/24/red-hat-bets-big-kubernetes-inference-llm-d-kubeconeu/">Red Hat bets big on Kubernetes inference with llm-d (SiliconANGLE, mar 2026)&lt;/a> — coverage of the announcement.&lt;/li>
&lt;/ul>
&lt;p>Ancestors and primitives:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://kserve.github.io/website/">KServe (site)&lt;/a> and &lt;a href="https://thenewstack.io/kserve-joins-cncf-to-standardize-ai-model-serving-on-kubernetes/">KServe joins CNCF (The New Stack)&lt;/a>.&lt;/li>
&lt;li>&lt;a href="https://kueue.sigs.k8s.io/">Kueue&lt;/a> — gang scheduling.&lt;/li>
&lt;li>&lt;a href="https://lws.sigs.k8s.io/">LeaderWorkerSet&lt;/a> — coordinated workloads such as multi-pod tensor parallel.&lt;/li>
&lt;li>&lt;a href="https://keda.sh/">KEDA&lt;/a> — autoscaling on external metrics.&lt;/li>
&lt;li>&lt;a href="https://gateway-api.sigs.k8s.io/">Gateway API&lt;/a> — the successor to Ingress.&lt;/li>
&lt;/ul>
&lt;p>Analysis and perspectives:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://jimmysong.io/blog/cloud-native-llm-inference-stack/">Building Efficient LLM Inference with the Cloud Native Quartet: KServe, vLLM, llm-d, and WG Serving (Jimmy Song)&lt;/a> — an integrating view.&lt;/li>
&lt;li>&lt;a href="https://dev.to/x4nent/complete-guide-to-llm-d-cncf-sandbox-kubernetes-native-distributed-llm-inference-1imj">Complete Guide to llm-d CNCF Sandbox (DEV Community)&lt;/a> — an operational walkthrough.&lt;/li>
&lt;li>Previous articles on this blog: &lt;a href="https://blog.lo0.es/en/posts/kv-cache-working-memory-llm-inference/">KV cache&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/vllm-kubernetes-llm-inference-that-scales/">vLLM on Kubernetes&lt;/a>, &lt;a href="https://blog.lo0.es/en/posts/pagedattention-vllm-block-manager/">PagedAttention deep dive&lt;/a>.&lt;/li>
&lt;/ul></description></item></channel></rss>