vLLM, SGLang and TensorRT-LLM make one GPU, or one node, serve a model well. NVIDIA Dynamo (ai-dynamo/dynamo, Apache-2.0, Rust core with Python extensions) is the layer above them: it turns a cluster of engine workers into one coordinated inference system. This lesson explains the problems that only appear at multi-node scale, and the four ideas Dynamo applies to them: KV-aware routing, disaggregated prefill and decode, tiered KV cache, and an SLA-driven planner. It also shows how to run it, from one container to Kubernetes, and when you do not need it.
- Explain why naive load balancing wastes prefill work across LLM replicas
- Describe disaggregated serving and the KV transfer it depends on
- Run a Dynamo frontend with vLLM workers, aggregated and disaggregated
- Explain what the KV Block Manager and the Planner add
- Decide when an engine alone is enough and when Dynamo pays off
Problems that appear at cluster scale
Put ten vLLM replicas behind a round-robin load balancer and three problems show up. First, wasted prefill: a multi-turn conversation's next message lands on a replica that has never seen it, so the whole history is prefilled again, even though another replica holds that exact prefix in its KV cache. Second, interference: prefill is compute-heavy and bursty, decode is memory-bandwidth-bound and steady, and mixing them on the same GPU makes long prompts stall everyone else's token stream. Third, static sizing: the right number of GPUs for prefill versus decode changes with traffic, prompt lengths and output lengths throughout the day.
Dynamo addresses these without replacing the engine. Its README is explicit: it does not replace SGLang, TensorRT-LLM or vLLM; it coordinates them. If you run one model on one GPU, the engine alone is probably enough.
| Component | Role |
|---|---|
| Frontend | OpenAI-compatible HTTP server (port 8000 by default); tokenizes and forwards |
| Router | Chooses a worker per request, optionally by KV cache overlap and load |
| Workers | Engine processes (vLLM, SGLang, TensorRT-LLM), aggregated or split into prefill and decode |
| NIXL | Transfer library that moves KV cache between GPUs and nodes over NVLink, RDMA or storage |
| KVBM | KV Block Manager: offloads cache from GPU to CPU memory, SSD and remote storage |
| Planner | Autoscaler that sizes prefill and decode pools to meet latency targets |
KV-aware routing
Workers publish KV events: which cache blocks they hold, keyed by hashes of token prefixes. The router keeps a global index and, for each request, scores workers by how much of the prompt they already have cached and how loaded they are, then sends the request where the least new prefill is needed without overloading anyone. A returning conversation, an agent loop that re-sends a long tool transcript, or many users sharing one long system prompt all benefit, and the visible gain is lower time to first token.
export MODEL_ID=YOUR_ORG/YOUR_MODEL
python3 -m dynamo.frontend --http-port 8000 --router-mode kv &
CUDA_VISIBLE_DEVICES=0 python3 -m dynamo.vllm --model "$MODEL_ID" &
CUDA_VISIBLE_DEVICES=1 python3 -m dynamo.vllm --model "$MODEL_ID" &
waitClients call http://localhost:8000/v1/chat/completions exactly as they would call vLLM. On Kubernetes, the same routing logic can run inside the standard Gateway API Inference Extension as an endpoint picker, so a cluster gateway makes KV-aware choices.
Disaggregated prefill and decode
Disaggregated serving runs prefill and decode on separate pools of GPUs. A request is prefilled on a prefill worker, its KV cache is transferred to a decode worker, and the decode worker streams the tokens. Each pool can be sized and configured for its own bottleneck, for example more parallelism for prefill and larger batches for decode, and long prompts no longer stall token streams.
python3 -m dynamo.frontend &
CUDA_VISIBLE_DEVICES=0 python3 -m dynamo.vllm --model "$MODEL_ID" \
--disaggregation-mode decode \
--kv-transfer-config '{"kv_connector":"NixlConnector","kv_role":"kv_both"}' &
CUDA_VISIBLE_DEVICES=1 python3 -m dynamo.vllm --model "$MODEL_ID" \
--disaggregation-mode prefill \
--kv-transfer-config '{"kv_connector":"NixlConnector","kv_role":"kv_both"}' &
waitDisaggregation is not free. Every request's KV cache crosses the interconnect, so it pays off with fast links (NVLink, InfiniBand or RoCE) and with workloads where prompts are long or prefill and decode contend. On slow networks, or with short prompts, aggregated serving with KV-aware routing is often better. Benchmark both.
Tiered cache, planning and fast starts
- KV Block Manager (KVBM) extends the KV cache beyond GPU memory into CPU memory, local SSD and remote or object storage. Blocks evicted from the GPU can be brought back instead of recomputed, which matters for long contexts and many idle conversations.
- Planner watches time to first token and inter-token latency against targets and adds or removes prefill and decode workers, aiming to meet the SLA with the fewest GPUs.
- ModelExpress streams weights GPU-to-GPU to new replicas, shortening the minutes-long cold start of large models.
- Fault tolerance health-checks workers and migrates in-flight requests when one fails, so a crashed worker does not mean failed user requests.
- Grove is a Kubernetes operator for topology-aware gang scheduling, placing the pods of one model across racks and NVLink domains sensibly.
Discovery and messaging are light by default: local development uses --discovery-backend file, and on Kubernetes Dynamo uses native resources, so etcd and NATS are optional rather than required.
Deploying on Kubernetes, and when not to
In production you install the Dynamo platform (operator and CRDs) and describe deployments declaratively. The newest path, in beta, is a DynamoGraphDeploymentRequest: you state the model, backend and latency targets, and Dynamo profiles candidate configurations, picks a topology and applies it. Ready-made recipes in the repository cover common model, engine and mode combinations.
apiVersion: nvidia.com/v1beta1
kind: DynamoGraphDeploymentRequest
metadata:
name: chat
spec:
model: YOUR_ORG/YOUR_MODEL
backend: vllm
sla:
ttft: 200.0
itl: 20.0
autoApply: true| Situation | Reasonable choice |
|---|---|
| One model, fits on one GPU, modest traffic | The engine alone (vLLM, SGLang) |
| Several replicas, repeated prefixes, multi-turn chat | Engine plus KV-aware routing |
| Long prompts, multi-node, fast interconnect, strict latency SLOs | Disaggregated serving with Planner |
| Very long contexts or many idle sessions | Add KVBM tiered cache |
Measure before adopting: the repository's benchmarking guide uses AIPerf to compare aggregated and disaggregated topologies on your own prompt and output lengths. Keep the comparison honest by changing one variable at a time and recording time to first token, inter-token latency and throughput per GPU.