Axisdream
Written and Published byAxisdream·

Cross-Engine KV Cache Sharing: Prompt Memory as Storage

Editorial cover for Cross-Engine KV Cache Sharing: Prompt Memory as Storage featuring minimalist Swiss typography and geometric composition.

Through 2026, open-source infrastructure layers including LMCache and Mooncake integrated directly across vLLM, SGLang, and TensorRT-LLM to pull key-value (KV) prompt attention states out of individual GPU memory cards and store them across shared CPU RAM, NVMe drives, and high-speed RDMA pools. Treating computed prompt memory as a persistent distributed cache tier stops clusters from recomputing identical 50,000-token codebases and policy manuals every time a user session bounces to another server.

Most enterprise AI traffic repeats huge chunks of unchanging background context across consecutive requests. Every time an agent answers step four of a multi-hour repository refactor or customer billing ticket, it re-reads the exact same instruction blocks, API documentation, and prior conversation transcript. Keeping that intermediate KV memory trapped inside one specific GPU card forces any request routed to a second replica during autoscaling or load-balancing to compute the entire prompt from scratch all over again.

Why single-GPU prefix caches miss half the traffic

Single-node prefix caching inside vLLM and SGLang speeds up repeat turns cleanly whenever sticky routing forces every follow-up request from a customer back onto the exact same GPU instance. Under real production conditions, however, sticky GPU routing breaks quickly.

When a user pauses for three minutes to read an answer, that single GPU's limited VRAM evicts their idle session state to make room for newer active traffic. Or when Kubernetes autoscales replicas during a morning traffic surge, the load balancer shifts user sessions onto freshly booted containers holding empty local caches. Every eviction wastes valuable compute time redoing expensive prompt prefill work, driving up both user wait times and datacenter electricity bills.

Cache tiering modelWhere KV states liveSurvives cross-node load balancingLatency trade-off
Ephemeral single-GPU cacheLocal HBM VRAM on one GPU cardNo; misses whenever requests hit sibling workersFastest when warm; lowest hit rate under churn
Shared distributed pool (LMCache, Mooncake)Pooled host RAM, NVMe, and RDMA clustersYes; any worker fetches precomputed blocks via hash IDSlight network/PCIe load cost; slashes prefill compute spikes

How distributed KV storage works with disaggregation

Externalized KV cache layers treat computed prompt blocks similarly to how distributed web systems treat Redis or Memcached objects. Once a prefill server reads a shared corporate employee handbook or 80,000-token codebase, LMCache pushes the resulting KV tensors asynchronously off precious GPU memory into cheaper host DDR5 RAM, high-speed local NVMe flash, or pooled network storage indexed by content hash.

When another worker elsewhere in the cluster handles a subsequent turn referencing that same prefix, it pulls the precomputed attention blocks over high-speed fabrics (such as RDMA via NIXL or fast local memory buses) in a fraction of the time needed to recompute prompt math from zero. That decoupling sits at the foundation of disaggregated prefill and decode architectures, letting organizations scale shared storage capacity independently from expensive compute cards while tightening prefix hit rates compared to semantic approximation caches.

Evaluating network speed against recomputation cost

Moving multi-gigabyte KV tensors across clusters is not automatically cheaper than recomputing short prompts. As inference hardware gets faster every generation, recomputing a short 1,000-token system prompt directly on an idle GPU takes milliseconds and skips storage bandwidth overhead altogether.

Distributed KV sharing wins decisively on long contexts (typically 10,000 to 250,000+ tokens), multi-turn coding agents, and RAG portals sharing large static knowledge manuals across thousands of users. Platform engineers sizing clusters check one simple break-even check: whether fetching cached tensor gigabytes over their cluster's actual network bandwidth finishes significantly faster than recomputing those input tokens from scratch. Where fast host RAM pools and RDMA links are available, elevating KV states into a shared cluster tier multiplies effective GPU throughput without buying extra accelerators. Teams deploying pooled KV stores should also align retention eviction policies with tenant isolation boundaries so shared host RAM buffers clean out stale customer context reliably under compliance audits. Monitoring cache-hit latency alongside network queue depth ensures externalized prompt memory boosts real user responsiveness rather than shifting compute waits onto overloaded storage switches.

Sources

Related Dispatches