Distributed KV cache scheduling & offloading libraries
See the code[!IMPORTANT] The KV-Cache Indexer — the
kvcache,kvblock, andkveventslibraries that power KV-cache-aware routing — has moved to llm-d-router (llm-d/llm-d-router#1886). New development happens there. A few imports of deprecated modules remain in this repository; once removed, no scheduling-related logic will live here. Open PRs against these libraries should be replicated against llm-d-router.
Efficiently caching Key & Value (KV) tensors is crucial for optimizing LLM inference.
Reusing the KV-Cache, rather than recomputing it, significantly improves both Time To First Token (TTFT) and overall throughput, while also maximizing system resource-utilization.
As a distributed LLM inference platform, llm-d provides a comprehensive suite of KV-Cache management capabilities to achieve these goals.
This repository contains the llm-d-kv-cache, a pluggable service designed to enable KV-Cache Aware Routing and lay the foundation for advanced, cross-node cache coordination in vLLM-based serving platforms.
See the Project Northstar document for a detailed overview of the project's goals and vision.
The major component of this project is the KV-Cache Indexer is a high-performance library that keeps a global, near-real-time view of KV-Cache block locality across a fleet of vLLM pods.
It is powered by KVEvents streamed from vLLM, which provide structured metadata as KV-blocks are created or evicted from a vLLM instance's KV-cache.
This allows the indexer to track which blocks reside on which nodes and on which tier (e.g., GPU or CPU).
This metadata is the foundation for intelligent routing, enabling schedulers to make optimal, KV-cache-aware placement decisions.
The diagram below shows the primary data flows: the Read Path (scoring) and the Write Path (event ingestion).
graph TD
subgraph "Inference Scheduler"
A[Scheduler]
subgraph "KV-Cache"
B[`kvcache.Indexer`]
C[`kvblock.Index`]
D[`kvevents.Pool`]
end
end
subgraph "vLLM Fleet"
E[vLLM Pod 1]
F[vLLM Pod 2]
G[...]
end
A--"1: Score(prompt, pods)"-->B
B--"2: Query Index"-->C
B--"3: Return Scores"-->A
E--"A: Emit KVEvents"-->D
F--"A: Emit KVEvents"-->D
D--"B: Update Index"-->C
Read Path:
Write Path:
KVEvents containing metadata about these changesFor a more detailed breakdown, please see the high-level Architecture and the Configuration docs.
kvcache.Indexer modulekvcache.Indexer into a scheduler like the llm-d-routerPVC Evictor: Kubernetes-side utility that automatically manages disk space for the offloading connector's KV-cache storage on PVCs.
llmd-fs-backend:
Storage backend for vLLM's OffloadingConnector — moves KV-cache blocks between GPU and shared storage (local disk, shared filesystem, or object store). Pre-built wheels are published via the project's pip index; see the connector README for install instructions and configuration.
[!IMPORTANT] Now upstreamed into vLLM.
llmd-fs-connector==0.23(llm-d v0.8 / vLLM v0.23) is the final release — llmd-fs-backend is now the FS tier of vLLM's multi-tier offloading connector (TieringOffloadingSpec). All new features and support continue there; see the vLLM KV offloading guide.
834 followers · starred May 2025
797 followers · starred Oct 2026
247 followers · starred May 2025
23 followers · starred Nov 2025
Distributed KV cache scheduling & offloading libraries
See the code[!IMPORTANT] The KV-Cache Indexer — the
kvcache,kvblock, andkveventslibraries that power KV-cache-aware routing — has moved to llm-d-router (llm-d/llm-d-router#1886). New development happens there. A few imports of deprecated modules remain in this repository; once removed, no scheduling-related logic will live here. Open PRs against these libraries should be replicated against llm-d-router.
Efficiently caching Key & Value (KV) tensors is crucial for optimizing LLM inference.
Reusing the KV-Cache, rather than recomputing it, significantly improves both Time To First Token (TTFT) and overall throughput, while also maximizing system resource-utilization.
As a distributed LLM inference platform, llm-d provides a comprehensive suite of KV-Cache management capabilities to achieve these goals.
This repository contains the llm-d-kv-cache, a pluggable service designed to enable KV-Cache Aware Routing and lay the foundation for advanced, cross-node cache coordination in vLLM-based serving platforms.
See the Project Northstar document for a detailed overview of the project's goals and vision.
The major component of this project is the KV-Cache Indexer is a high-performance library that keeps a global, near-real-time view of KV-Cache block locality across a fleet of vLLM pods.
It is powered by KVEvents streamed from vLLM, which provide structured metadata as KV-blocks are created or evicted from a vLLM instance's KV-cache.
This allows the indexer to track which blocks reside on which nodes and on which tier (e.g., GPU or CPU).
This metadata is the foundation for intelligent routing, enabling schedulers to make optimal, KV-cache-aware placement decisions.
The diagram below shows the primary data flows: the Read Path (scoring) and the Write Path (event ingestion).
graph TD
subgraph "Inference Scheduler"
A[Scheduler]
subgraph "KV-Cache"
B[`kvcache.Indexer`]
C[`kvblock.Index`]
D[`kvevents.Pool`]
end
end
subgraph "vLLM Fleet"
E[vLLM Pod 1]
F[vLLM Pod 2]
G[...]
end
A--"1: Score(prompt, pods)"-->B
B--"2: Query Index"-->C
B--"3: Return Scores"-->A
E--"A: Emit KVEvents"-->D
F--"A: Emit KVEvents"-->D
D--"B: Update Index"-->C
Read Path:
Write Path:
KVEvents containing metadata about these changesFor a more detailed breakdown, please see the high-level Architecture and the Configuration docs.
kvcache.Indexer modulekvcache.Indexer into a scheduler like the llm-d-routerPVC Evictor: Kubernetes-side utility that automatically manages disk space for the offloading connector's KV-cache storage on PVCs.
llmd-fs-backend:
Storage backend for vLLM's OffloadingConnector — moves KV-cache blocks between GPU and shared storage (local disk, shared filesystem, or object store). Pre-built wheels are published via the project's pip index; see the connector README for install instructions and configuration.
[!IMPORTANT] Now upstreamed into vLLM.
llmd-fs-connector==0.23(llm-d v0.8 / vLLM v0.23) is the final release — llmd-fs-backend is now the FS tier of vLLM's multi-tier offloading connector (TieringOffloadingSpec). All new features and support continue there; see the vLLM KV offloading guide.
834 followers · starred May 2025
797 followers · starred Oct 2026
247 followers · starred May 2025
23 followers · starred Nov 2025