Separated prefill and decode (P/D disaggregation) is a setup in which one group of GPUs handles the input prompt and another generates the response, with the KV cache passed between them over a high-speed network. It lets you tune time to first token and generation speed separately and removes latency spikes when someone else’s long prefill slows down in-flight responses. By itself, it does not increase throughput, it requires an RDMA network, and it pays off for large models with long prompts, not short chats.
Prepared by Vladimir Lomtsev’s AI Studio on November 16, 2026 for architects and engineers planning a multi-server inference cluster. We relied on the vLLM and llm-d documentation, the Mooncake repository, and the DistServe paper. We did not run our own benchmarks. Configuration figures are given as stated by the source authors.
Contents
- How prefill differs from decode
- How the setup works
- What the vLLM documentation says
- llm-d: P/D in Kubernetes
- DisaggregatedSet: updates without downtime
- Mooncake and other implementations
- When separate phases make sense
- Risks and what to check before launch
- How to run a pilot
- Frequently asked questions
How prefill differs from decode
Prefill processes the entire input prompt in one pass: thousands of tokens in parallel. This phase is compute-bound on the GPU. Decode generates the response one token at a time and reads the model weights and KV cache at each step. This phase is memory-bandwidth-bound. Both phases are covered in more detail in the guide to inference engines and acceleration.
When both phases run on the same GPU, they interfere with each other. A long prefill for a new request takes a step away, and users whose responses are already streaming see a pause between tokens. The authors of DistServe showed that separating the phases onto different GPUs removes this interference and makes it possible to tune parallelism and resources for each phase independently.
Within a single instance, chunked prefill addresses the same issue: a long prompt is split into pieces and interleaved with decode steps. How to configure it is explained in the article on the LLM request queue. Separate phases are the next level, when splitting is no longer enough.
How the setup works
- A request arrives at the router.
- The router selects a decode replica and decides whether a separate prefill is needed. If most of the prompt is already in the decode replica’s cache, prefill can be done locally.
- The prefill replica processes the prompt and builds the KV cache.
- The KV cache is transferred to the decode replica through a transfer library such as NIXL, Mooncake Transfer Engine, or LMCache.
- The decode replica generates the response and returns it to the client.
The main cost of this setup is cache transfer. For a long prompt, that means hundreds of megabytes or gigabytes. A token-by-token size calculation is given in the article on offloading the KV cache to RAM and NVMe: for a hypothetical model with 128 KiB per token, a 10,000-token prompt produces about 1.2 GiB of cache (128 KiB × 10,000 = 1,280,000 KiB ≈ 1.22 GiB). Without an RDMA network, that transfer will eat up the benefit.
What the vLLM documentation says
In the vLLM disaggregated prefill documentation two reasons are given for using this setup: you can tune time to first token and inter-token latency separately, and you can control the tail of inter-token latency because prefill no longer interrupts decode. The same page also states directly that disaggregated prefill does not increase throughput, and the feature is marked experimental.
vLLM performs cache transfer through the connectors specified in --kv-transfer-config. The documentation lists, among others, NixlConnector, MooncakeConnector, LMCacheConnectorV1, MultiConnector and MoRIIOConnector for ROCm. The set changes from version to version, so check the documentation for the version you are deploying.
llm-d: P/D in Kubernetes
In llm-d, separate phases are one of the core scenarios. According to the P/D architecture description:
- prefill and decode pods run in the same InferencePool and are distinguished by role labels;
- a proxy sidecar sits in front of the decode engine, first sending prefill to a remote replica and then passing the enriched request to the local decode;
- the router first chooses a decode replica and adds a prefill replica only if the prompt has a large uncached tail;
- if the prefill replica returns a server error, the vLLM sidecar switches to decode-only mode;
- NIXL transfers the cache, and with GPUDirect RDMA the transfer can bypass the CPU.
The documentation names suitable workloads: long context with an input-to-output ratio around 10:1, medium and large models, and sparse MoE models with wide expert parallelism. It also clearly says that P/D is not for every workload: for short requests like 200 tokens in and 200 tokens out, the setup is unnecessary.
The network requires RDMA connections: UCX over InfiniBand or RoCE, UCCL over IB, RoCE, TCP-X, or EFA, and libfabric over EFA. Without RDMA, NIXL falls back to TCP, and the documentation recommends that mode for testing and development only.
There is no fixed ratio of prefill to decode replicas. As an example, llm-d gives 8 prefill pods with TP=1 and 2 decode pods with TP=4, 16 GPUs total, for a workload of 5,000 input tokens and 250 output tokens on gpt-oss-120b. This is the authors’ example for their model, not a rule: the ratio should be chosen based on your own input and output lengths.
DisaggregatedSet: updates without downtime
In llm-d v1.0.0 release on October 20, 2026, DisaggregatedSet was introduced as a way to manage prefill and decode replicas as one logical unit. According to its description it is a Kubernetes controller built on top of LeaderWorkerSet:
- each role in
spec.rolesbecomes a separate LeaderWorkerSet and scales independently, including through HPA or KEDA; - role updates are coordinated so that the prefill-to-decode ratio is preserved;
- a new revision receives traffic only when every required role has a ready set;
- during an update, one revision serves both prefill and decode for a given request.
The last point matters: if you update prefill replicas to a new model or engine version before decode, the cache format may no longer match and responses can break.
Mooncake and other implementations
Mooncake describes itself as a split-phase LLM serving architecture built around the KV cache and calls itself the serving platform for Moonshot AI's Kimi service. The authors write that, on real-world traffic, the architecture let Kimi handle 75% more requests while meeting target latency; this is their own estimate from the FAST 2025 conference paper. The project produced Mooncake Transfer Engine, which vLLM, SGLang, and LMCache use for cache transfer.
NVIDIA Dynamo also supports split phases. According to LMCache's material on Dynamo 1.0, in this setup the prefill worker can offload the cache through LMCache, and NIXL handles transfer between prefill and decode.
When split phases make sense
| Signal | More likely needed | More likely not needed |
|---|---|---|
| Input and output length | Inputs in the thousands of tokens, outputs shorter | Short conversations, input and output are comparable |
| Model | Large, across multiple GPUs, MoE | Fits on one GPU |
| Latency requirements | Tight tail inter-token latency | Average latency is enough |
| Network | InfiniBand or RoCE between servers | Standard Ethernet without RDMA |
| Scale | Dozens of GPUs and steady traffic | One or two servers |
| Team | Experience operating Kubernetes and RDMA networks | No dedicated infrastructure team |
If most answers are “more likely not needed,” start with chunked prefill, the max-num-batched-tokens, KV-cache routing and standard replicas. That is simpler and cheaper.
Risks and what to check before launch
- Network. Measure throughput and latency between servers before deployment. Cache transfer over TCP can make the setup slower than the standard approach.
- Prefill pool capacity. Make sure the configured maximum context length fits within the KV pool of the prefill replica. In an LMSYS analysis from October 26, 2026 this mismatch was identified as the root configuration error behind an incident in which users on SGLang with split phases could receive fragments of another user's context. Fixes were included in SGLang 0.5.21 and later versions.
- Request cancellation. The router should cancel both halves of the prefill/decode pair if the client disconnects. This is one of the recommendations from the same analysis.
- Version compatibility. Prefill and decode must run on the same engine and model version.
- Failures. Decide what happens if the prefill replica goes down: fail over to decode-only mode, retry, or return an error to the client.
- Observability. Measure prefill time, cache transfer time, and decode inter-token latency separately. Otherwise, it is impossible to tell which part of the pipeline is slowing things down. Basic dashboards are described in the article on vLLM monitoring.
How to run a pilot
- Profile the workload: input and output length distribution, share of repeated prefixes, and peak requests per second.
- Record target p95 time to first token and inter-token latency.
- Establish a baseline on standard replicas with chunked prefill.
- Deploy a minimal setup: one prefill replica and one decode replica on RDMA-enabled servers.
- Run the same workload and compare latency, cache transfer time, and GPU count.
- Adjust the prefill-to-decode ratio if one role is underutilized.
- Test failure and upgrade scenarios before shifting traffic.
Frequently asked questions
Will split phases speed up my service? They smooth out inter-token latency and let you tune the phases separately. The vLLM documentation explicitly says they do not increase throughput. They pay off where phase interference makes it hard to meet latency targets.
Can I run P/D on one server with two GPUs? Technically yes; the cache will move over NVLink or PCIe. But on a single server, the benefit is usually smaller than the added complexity. Try chunked prefill first.
Do I need Kubernetes? For llm-d and DisaggregatedSet — yes. vLLM, SGLang, and Dynamo can be set up with split phases without it, but then you have to handle routing, updates, and failures yourself.
What prefill-to-decode ratio should I choose? There is no universal answer. It depends on input and output length. Start with one replica of each role and see which one becomes resource-constrained.
How Vladimir Lomtev's AI studio helps with inference architecture
Vladimir Lomtev's AI studio designs and deploys LLMs on companies' own servers. For deciding on split phases, that means:
- profiling the workload and checking where prefill and decode interfere;
- comparing standard replicas with chunked prefill and a split-phase setup in a pilot;
- designing the routing, updates, and monitoring for the chosen architecture;
- giving the team criteria for when the setup should be scaled up or rolled back.
The first step is to choose one service, record its request profile and latency targets, and check whether it meets them on standard replicas. Discuss the project.
Bottom line: prove the interference first
Separate prefill and decode is a powerful tool for large models with long prompts and strict latency requirements, but it comes at a high cost: an RDMA network, more moving parts, and new classes of failures. Make the decision based on measurements: if standard replicas with chunked prefill and cache-based routing meet the targets, there is no need to complicate the architecture.



