Building py-kvcache: A Performance Characterization of External KV Caching for vLLM with NVMe SSDs

Joseph Kanichai, Tiziano De Matteis, Animesh Trivedi
9/10/2026
2 citations
cs.DCcs.LG

Official code: atlarge-research/py-kvcache (6 stars, Python, Apache-2.0, last commit 2026-07-26).

Abstract

Prefix caching can reduce the time to first token (TTFT) of long-context LLM requests by reusing previously computed key-value (KV) states, but for short prefixes or fast GPUs, recomputation can be faster than loading from an external cache. We characterize this tradeoff in vLLM across GPU, CPU, and NVMe tiers using synthetic workloads, long-context benchmarks, production traces, and find that cache performance depends on transfer granularity, intermediate memory use, and when transfers enter the request schedule, not only on device bandwidth.

Show full abstract

These findings motivate py-kvcache, a vLLM KV Offload connector with asynchronous direct I/O, bounded shared staging, and scheduler-aware preloading, which starts disk reads while requests are still waiting, overlapping with compute. At 80k tokens, py-kvcache loading from disk is 2.0x faster than LMCache, with preloading contributing 1.34x. With GPU, CPU, and disk caching enabled, it is 1.23x faster than LMCache and within approximately 4% of the native vLLM KV Offload implementation. LongBench and SCBench show that these benefits extend to irregular prefix chains and multi-turn workloads. Bailian trace replays improve TTFT on a weaker GPU, but on an H100 the average request falls below the break-even point and GPU memory alone retains enough prefixes. External KV caching should therefore be treated as a setup specific admission decision. The py-kvcacheimplementation is available at: https://github.com/atlarge-research/py-kvcache.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

iouring based external KV cache for vLLM. Supports preloading KV cache, break-even ops gating, ARC DRAM cache.

61PythonAug 8, 20264 months agoApache-2.0

Similar Papers

Cite this paper

@article{kanichai2026building,
  title  = {Building py-kvcache: A Performance Characterization of External KV Caching for vLLM with NVMe SSDs},
  author = {Joseph Kanichai and Tiziano De Matteis and Animesh Trivedi},
  year   = {2026},
  eprint = {2609.11744},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2609.11744v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2609.11744.svg)](https://codeofpaper.com/paper/2609.11744)

Discussion