Mooncake
Disaggregated KV cache engine for LLM serving at scale
Replaces —
Who it's for
Teams running vLLM or SGLang clusters processing high volumes of long-context requests can integrate Mooncake Store for cross-instance KV cache reuse and Transfer Engine for disaggregated prefill, reducing redundant computation and improving throughput without changing their serving API.
Running a single-node or low-traffic inference setup where cross-instance cache sharing provides no benefit.
Teams building disaggregated RL pipelines — separating inference rollout from training — can use Transfer Engine to move hidden states and model weights between workers via RDMA, as demonstrated by integrations with verl, Speculators, Miles, and TorchSpec.
Using a single-machine or offline training setup where data movement between rollout and training is not a bottleneck.
Platforms serving vision-language models can decouple compute-intensive ViT encoders from language model nodes using Mooncake's EPD (Encode-Prefill-Decode) disaggregation, transferring large multimodal embeddings zero-copy via RDMA. Supported in SGLang and vLLM-Omni.
Serving text-only models where encoder disaggregation is not applicable.
ML platform teams managing multi-thousand-GPU training jobs can use checkpoint-engine to synchronize model weights peer-to-peer across nodes via RDMA, replacing slow broadcast-based checkpointing. The system updated Kimi-K2's 1T parameters across thousands of GPUs in roughly 20 seconds.
Training on a single node or a small cluster where checkpoint synchronization latency is not a practical concern.
The problem
Large-scale LLM inference wastes significant GPU memory and compute by co-locating prefill and decode on the same nodes, failing to reuse KV cache across requests, and leaving CPU, DRAM, and SSD resources idle. As context lengths grow, this inefficiency compounds: repeated prefill of shared prompt prefixes burns GPU cycles, and KV cache that exceeds device memory is simply evicted rather than offloaded or shared.
How it works
Separates prefill and decode into independent clusters, letting each scale independently and eliminating the GPU memory pressure caused by co-location. This architecture underpins Kimi's ability to handle 75% more requests under real production traffic.
Provides a unified interface for batched data movement across RDMA (RoCE, InfiniBand), TCP, NVLink, and heterogeneous accelerators including CUDA, ROCm, Ascend NPU, and MUSA. Topology-aware path selection and multi-NIC aggregation deliver up to 190 GB/s on 8×400 Gbps RoCE networks — 4.6x faster than TCP.
Content-addressed distributed store built on Transfer Engine that pools KV cache across CPU DRAM, host memory, and SSD tiers. Enables cross-instance prefix reuse so repeated prompt prefixes are served from cache rather than recomputed. Integrated with vLLM, SGLang, LMDeploy, TensorRT-LLM, and LMCache.
The KVCache-centric scheduler continuously balances throughput against per-request latency SLOs. In overloaded conditions, prediction-based early rejection rejects requests that cannot meet their SLO before any GPU compute is spent on them.
Mooncake EP and PG support fault-tolerant elastic expert parallelism for Mixture-of-Experts models. The foundation powers SGLang's Elastic Expert Parallel inference and was used to deploy the 1-trillion-parameter Kimi-K2 model across 128 H200 GPUs at 224k tokens/sec prefill throughput.
The open-sourced checkpoint-engine enables peer-to-peer weight synchronization between training and rollout workers via RDMA. In production it updates the Kimi-K2 1T-parameter model across thousands of GPUs in approximately 20 seconds — down from 53 seconds with SGLang's RDMA P2P weight transfer.
Features
- Prefill-Decode Disaggregation
- High-Performance Transfer Engine
- Distributed KV Cache Pool (Mooncake Store)
- SLO-Aware Scheduling with Early Rejection
- Elastic MoE Expert Parallelism
- Checkpoint Engine for Distributed Training
How to install
pip install mooncake-transfer-engine
Recommended for this setup
Strengths
- Production-proven at massive scale: Mooncake is not a research prototype — it is the live serving infrastructure for Kimi. The architecture has been validated at trillion-token-per-day throughput, 1T-parameter model deployments, and multi-thousand-GPU training synchronization runs.
- Broad ecosystem integration: Transfer Engine and Mooncake Store are natively integrated into vLLM, SGLang, LMDeploy, TensorRT-LLM, LMCache, llm-d, Dynamo, FastDeploy, verl, and others. Most integrations are included in the upstream releases of those frameworks, requiring no patching.
- Heterogeneous hardware support: PyPI packages cover CUDA (up to 13.1), ROCm, Ascend NPU, MUSA, and AWS EFA. Transfer Engine supports RDMA, TCP, NVLink, and GPUDirect RDMA (GDR), making Mooncake usable across cloud and on-premise GPU clusters regardless of interconnect.
- Peer-reviewed architecture: The underlying design won the Best Paper Award at FAST 2025, a top systems conference. The published paper, slides, and production traces are openly available, giving teams a solid foundation for evaluating and extending the system.
Trade-offs
- Operational complexity of disaggregation: Running separate prefill and decode clusters adds infrastructure overhead compared to a single unified serving pool. Teams without experience operating distributed GPU clusters may find the networking, RDMA configuration, and cluster coordination non-trivial to set up.
- Best suited for high-concurrency, long-context workloads: The documented throughput gains (up to 525%) are measured on long-context scenarios with high request volume. Single-user or low-concurrency deployments are unlikely to benefit meaningfully from the disaggregated KV cache pool.
- RDMA hardware dependency for peak performance: The highest bandwidth figures require RoCE or InfiniBand NICs. Deployments limited to TCP will see reduced Transfer Engine performance and cannot take advantage of GPUDirect RDMA features like GDR.
Tech stack
FAQ
Transfer Engine is the low-level data movement layer: it provides a unified API for batched transfers across RDMA, TCP, NVLink, and GDR, with topology-aware routing and multi-NIC aggregation. Mooncake Store is built on top of Transfer Engine and provides content-addressed distributed KV cache and model-weight management with tiered storage across device memory, host DRAM, and SSD.
vLLM (Transfer Engine as KV Connector in v1; Mooncake Store featured in vLLM blog), SGLang (Transfer Engine, Mooncake Store as HiCache backend, EPD disaggregation), LMDeploy (Mooncake Store in v0.18.0), TensorRT-LLM (Transfer Engine and Mooncake Store connector in KVCMv2), and LMCache are the primary integrations. llm-d, Dynamo, FastDeploy, and several others also have upstream support.
Mooncake runs on CUDA GPUs (supported up to CUDA 13.1), ROCm GPUs, Ascend NPUs, and MUSA accelerators. For network transport it supports TCP (no special hardware), RoCE and InfiniBand RDMA NICs (required for the highest bandwidth figures), AWS EFA, and GPUDirect RDMA for GPU-to-GPU transfers. Docker images are available at kvcacheai/mooncake on Docker Hub.
Results depend heavily on workload. In simulated long-context scenarios Mooncake reports up to a 525% throughput increase while meeting SLOs. Under real Kimi production traffic the architecture enabled 75% more handled requests. For the 1T-parameter Kimi-K2 on 128 H200 GPUs with PD disaggregation, the deployment achieved 224k tokens/sec prefill and 288k tokens/sec decode throughput.
Mooncake covers both. For inference it provides the disaggregated KV cache architecture and Transfer Engine. For training it provides checkpoint-engine for peer-to-peer weight synchronization between training and rollout workers, and is integrated into verl, Speculators, Miles, and TorchSpec for RLHF and speculative decoding training pipelines.