Up to 3.5x faster completion for LLM coding agents: that's what CacheWise delivers by fixing how KVCache handles the peculiar workload pattern of agentic coding sessions.
Coding agents are long-running loops: LLM generates code, calls a tool, gets output, then generates again. Unlike chat, these sessions keep reusing huge prefixes (the system prompt, the conversation history, the file context). Standard KVCache policies treat each request independently, evicting cache lines that will be needed again in the next turn. The result is constant thrashing.
Coding Agent Workloads Expose a Blind Spot in KVCache Design
The CacheWise team collected real-world traces from a deployed coding assistant. Their analysis reveals that agent sessions repeatedly hit the same large prefixes across consecutive turns. That pattern creates sustained KVCache pressure that existing serving systems handle poorly. Conventional policies don't have a notion of "this token sequence will be needed again in 500 milliseconds." They just see requests and evict by LRU or similar heuristics.
CacheWise's key insight: tool call metadata (like which file was read or what command ran) is a lightweight predictor of what prefixes the next generation will reuse. That's information available before the next generation even starts.
Prefix-Aware Scheduling Plus Reuse-Guided Eviction
CacheWise sits as a management layer in vLLM. Two mechanisms work together. First, prefix-aware scheduling: when multiple agent sessions share common prefixes (e.g. the same system prompt), CacheWise batches them to maximize cache hit rate. Second, reuse-aware eviction: instead of LRU, it scores cache pages by predicted reuse probability, derived from tool call metadata and session state. Pages likely to be needed within the next few turns stay in cache; dead ones get evicted.
On the collected traces, CacheWise cuts KVCache evictions by 2-2.6x. More importantly, total agent session completion time improves by up to 3.5x. That's the wall-clock metric users actually care about: how long until my coding agent finishes the task.
This isn't hypothetical. The implementation is in vLLM, the most popular open-source LLM serving engine. Anyone running coding agents on vLLM today is leaving performance on the table. CacheWise shows that understanding workload structure is worth more than another line of GPU memory.
Next step: extending these ideas to multi-turn dialogue and RAG pipelines that also exhibit prefix reuse patterns. CacheWise proves that KVCache management tailored to agentic workloads is the low-hanging fruit nobody picked.
Source: CacheWise: Understanding Workloads and Optimizing KVCache Management for Efficiently Serving LLM Coding Agents
Domain: arxiv.org
Comments load interactively on the live page.