On this page
A single vLLM or SGLang server knows how to batch requests on its own GPUs. It knows nothing about the other 40 replicas in your cluster: which one already holds this conversation's KV cache, which ones are busy with long prefills, or whether prefill and decode should run on different machines. A new layer of software has appeared to answer those questions, and the two best-known projects are NVIDIA Dynamo and llm-d.
#What problem they solve
Once you run more than a handful of replicas, three inefficiencies dominate:
- Cache-blind routing. A round-robin load balancer sends turn 5 of a conversation to a replica that never saw turns 1 to 4, so the whole history is prefilled again. Routing by where the KV cache already lives (prefix caching) avoids that work.
- Prefill interfering with decode. Long prompts stall other users' token streams. Splitting prefill and decode onto separate GPU pools fixes it, at the cost of moving the KV cache between them (disaggregation explained).
- Static capacity. Prefill and decode demand shift during the day. Scaling them independently, against latency targets rather than CPU load, saves GPUs.
Both frameworks attack all three. They differ mainly in where they come from and what they assume about your stack.
#NVIDIA Dynamo
Dynamo is NVIDIA's open-source framework for distributed inference, announced in March 2025. Its main parts:
- Engine-agnostic workers. vLLM, SGLang and TensorRT-LLM can all run as backends.
- KV-aware router. Tracks which worker holds which KV blocks and scores workers by cache overlap and load.
- Disaggregated serving. Separate prefill and decode workers, with KV cache transferred over NIXL (NVIDIA's inference transfer library, which uses NVLink, InfiniBand or RDMA where available).
- KV block manager. Offloads KV cache from GPU memory to CPU memory, local SSD or remote storage, and brings it back when a conversation resumes.
- Planner. Adjusts the number of prefill and decode workers to meet latency targets.
It runs on Kubernetes or directly on machines, and it's designed with NVIDIA's large systems (such as GB200 NVL72) in mind, though it isn't limited to them.
#llm-d
llm-d is an open-source project launched in May 2025 by Red Hat with Google, IBM Research, CoreWeave, NVIDIA and others. Its main parts:
- Kubernetes-native design. Everything is expressed as Kubernetes resources and deployed with Helm.
- vLLM as the engine. llm-d builds on vLLM rather than supporting several engines.
- Inference scheduler. Built on the Kubernetes Gateway API Inference Extension: an "endpoint picker" chooses a vLLM pod for each request using prefix-cache affinity, queue depth and KV memory pressure.
- Disaggregated serving. Prefill and decode pods, with KV transfer over NIXL.
- KV cache tiering to CPU memory and other storage, using vLLM's connectors.
- Well-lit paths. Tested reference configurations for common patterns, such as prefix-aware routing, prefill/decode split and wide expert parallelism for large MoE models.
#Side by side
| Dynamo | llm-d | |
|---|---|---|
| Backed by | NVIDIA | Red Hat, Google, IBM, CoreWeave, NVIDIA and others |
| Engines | vLLM, SGLang, TensorRT-LLM | vLLM |
| Where it runs | Kubernetes or bare machines | Kubernetes only |
| Routing | Own KV-aware router | Gateway API Inference Extension endpoint picker |
| KV transfer | NIXL | NIXL |
| Hardware focus | NVIDIA, including rack-scale systems | Vendor-neutral where vLLM is (NVIDIA, AMD, TPU) |
| Autoscaling | Planner, latency-target driven | Kubernetes autoscalers, with inference-aware signals |
| Best fit | NVIDIA-centric fleets, multiple engines, very large deployments | Teams standardised on Kubernetes and vLLM |
Both projects move fast; check current documentation before choosing, since features listed as experimental one quarter are often default the next.
#A request's path, step by step
Both frameworks route a request in broadly the same way:
- The request arrives at a router or gateway, which tokenises the prompt (or a prefix of it) and works out which KV blocks it would need.
- The router scores the workers. It checks which ones already hold matching prefix blocks, how busy each is (queue depth, running requests) and how much free KV memory each has. It picks the worker with the best balance of cache overlap and spare capacity.
- If prefill and decode are split, the request goes to a prefill worker first. That worker computes the missing part of the prompt's KV cache, reusing any cached blocks.
- The KV cache moves to a decode worker over NIXL, ideally streamed layer by layer while prefill is still running (disaggregation explained).
- The decode worker streams tokens back through the gateway.
- Afterwards, the KV blocks stay cached on the worker (and may be offloaded to CPU memory or storage), and the router's index is updated so the next turn of the conversation can find them.
The engines (vLLM, SGLang, TensorRT-LLM) still do steps 3 to 5. The framework's job is steps 1, 2 and 6, plus moving data between workers and scaling them.
#Worked example: what cache-aware routing saves
A chat service runs 16 replicas of a 70B model. A typical conversation turn carries 6,000 tokens of history plus 300 new tokens.
- Round-robin routing: a turn lands on the replica holding its history only 1 time in 16. The other 15 times, the whole 6,300 tokens are prefilled again. Average prefill per turn: about 5,900 tokens.
- Cache-aware routing: turns go back to the replica holding their history (unless it's overloaded), so most turns prefill only the 300 new tokens. Average prefill per turn: a few hundred tokens.
That's roughly a 15- to 20-fold cut in prefill work, which shows up directly as lower time to first token and fewer GPUs for the same traffic. It's the main reason these frameworks exist. The exact saving depends on how long conversations are and how often caches get evicted.
#KV offload: more cache than GPU memory
GPU memory fills up long before conversations end, especially with agents that pause for tool calls. Both frameworks can move cold KV blocks down a hierarchy instead of throwing them away:
| Tier | Typical capacity per node | Rough bandwidth back to the GPU |
|---|---|---|
| GPU memory (HBM) | 640 GB to 1.5 TB across 8 GPUs | terabytes per second, local |
| CPU memory | 1 to 2 TB | tens of GB/s per GPU over PCIe |
| Local NVMe | several TB | a few to tens of GB/s |
| Remote storage | effectively unlimited | depends on the network |
Is fetching a cache faster than recomputing it? For the 70B model with an FP8 cache, 6,000 tokens of history is about 1 GB. From CPU memory at about 50 GB/s, that's around 20 ms. Recomputing it would take roughly 100 ms of prefill on a full 8-GPU node. So offloading to CPU memory pays off easily; slower tiers pay off for longer histories or busier prefill pools.
#Do you need either one?
Probably not yet if:
- You run one to three replicas per model. A plain load balancer with session affinity gets most of the prefix-cache benefit.
- Prompts are short and there's little shared prefix. Cache-aware routing and disaggregation have little to save.
- Your latency target is relaxed. Chunked prefill inside one engine is far simpler than a disaggregated deployment (continuous batching explained).
Probably yes if:
- You run many replicas of the same model and see a low prefix-cache hit rate.
- Prompts are long (RAG, agents, multi-turn chat with big histories) and decode latency suffers during prefill spikes.
- You serve large MoE models across multiple nodes with expert parallelism (MoE inference explained).
- GPU spend is large enough that a 20 to 30% efficiency gain pays for the extra operational complexity.
#How to evaluate them
- Measure your baseline first: prefix cache hit rate per replica, P95 time to first token and time per output token under real load (serving metrics).
- Turn on cache-aware routing alone. It's the cheapest win and both frameworks support it. Re-measure.
- Only then try disaggregation, and check that KV transfer time stays well under the prefill time it saves.
- Compare goodput per GPU at your latency targets against the baseline, not peak throughput.
- Count the operational cost: new components to monitor, upgrade and debug.
#What to monitor once it's running
- Prefix cache hit rate, per worker and overall. Cache-aware routing should raise it sharply; if it doesn't, look at prompt structure (variable content at the start of prompts breaks sharing).
- Routing balance: requests and KV usage per worker. A router that over-favours cache hits can pile load onto a few workers.
- Time to first token, split into parts: queueing, prefill, KV transfer.
- KV transfer time and failures between prefill and decode pools.
- Offload traffic: how often blocks are fetched back from CPU or storage, and how long it takes.
- Pool utilisation for prefill and decode separately, to tune the ratio between them.
#Common mistakes
- Adopting a distributed framework for two replicas. The complexity outweighs the gain.
- Turning everything on at once. Enable one feature at a time and measure each.
- Breaking prefix sharing in the application with timestamps or user IDs at the start of prompts, then concluding cache-aware routing doesn't work.
- Ignoring the network. Disaggregation over slow links can make time to first token worse.
#FAQ
Can I use Dynamo with vLLM? Yes. vLLM is one of Dynamo's supported backends, alongside SGLang and TensorRT-LLM.
Does llm-d only work with NVIDIA GPUs? It's built on vLLM, so it aims to run wherever vLLM does, including AMD and Google TPU, though support for individual features varies by hardware.
Do I need Kubernetes? For llm-d, yes. Dynamo can also run without it.
Is this the same as an API gateway? No. A general API gateway routes by path or load; these frameworks route by where each request's KV cache lives, and manage the cache itself (gateways, routing and failover).
#Go deeper
Disaggregated prefill and decode covers the mechanics and the KV transfer maths, gateways, routing and failover covers routing in production, and serving platforms and GitOps covers running serving stacks on Kubernetes.
dynamollm-ddisaggregationkubernetesinference-engineering
Found this useful?
Send it to someone who is learning the same thing.
Preparing for an interview?
Next: learn it step by step, free
Capacity planning and cost
Turn traffic and latency targets into a GPU count and a monthly bill. A free lesson with step-through diagrams and a quiz.