ContextCache: Persistent KV Cache with Content-Hash Addressing for Zero-Degradation Tool Schema Caching
Abstract
ContextCache is a persistent KV cache system that accelerates tool-augmented LLM inference by caching prefilled key-value states of tool schema prefixes with SHA-256 content-hash addressing. On cache hits, only the user query requires prefilling, reducing time-to-first-token by 6.9x (787ms to 114ms) with zero quality degradation — group-cached generation matches full prefill exactly on Tool Selection Accuracy across all evaluation splits. This work also documents a negative result: per-tool independent KV compilation with NoPE/deferred-RoPE fails (TSA ~0.1) due to cross-tool attention dependencies, motivating the group caching design. The system includes disk persistence, a model-agnostic adapter layer (Qwen, Llama, Mistral), FastAPI serving, and a browser-based UI, breaking even after just 2.1 requests.
Fields of Study & Subjects
Natural Language Processing Techniques
Topic Modeling
Information Retrieval and Search Behavior
Publication details
- Journal / source
- Zenodo (CERN European Organization for Nuclear Research)
- Publication date
- 27 February 2026
- Language
- EN
- Document type
- Preprint