The External KV Cache Tier We Actually Shipped — And the Part Nobody Warns You About
There is an active debate about whether an external KV cache tier still earns its keep. Leaner attention architectures shrink the cache. Hardware-accelerated FP4 shrinks the weights, freeing HBM for session state. So why persist anything to a slower tier at all?
Our answer, after building one on a small sovereign fleet: it matters more in the agentic era, not less — and the interesting engineering is not where people expect it. It is not the quantizer. It is tenancy.
Why agents change the arithmetic
A chat completion fits in VRAM: prefill, decode, stream, done. An agent turn is a loop — call a tool, wait, feed the result back, decide, repeat. Every turn compounds the input context, and between turns the session's KV cache sits idle in VRAM during "think time." Route a different session onto that instance and you either pin the idle one (fragmentation), swap it out (PCIe wall), or send the new work elsewhere (lost locality). A shared external tier dissolves the trade: session state lives outside the compute instance, so the GPU holds whatever is hot right now, and the scheduler can treat cache locality as a placement signal.
What we built
Three tiers — VRAM (hot, FP8), DDR5 (cold, TurboQuant FP4), and an external warm tier backed by our Strata storage service, mesh-replicated across the fleet so a session survives an instance restart. The copy from GPU to CPU rides a separate CUDA stream and a background thread does the FP4 encode, so the cold tier fills during decode at no cost to the hot attention path.
The whole thing ships as a pip-installable wheel (aither-kvcache) that layers onto stock vllm/vllm-openai through vLLM's plugin entry point. No fork. Iterate the quantizer or the isolation logic, publish a wheel version, restart vLLM.
The part nobody warns you about: a shared cache is a side channel
Every "share a global KV tier across tenants" pitch skips the sentence that matters: a shared cache is a cross-tenant side channel unless every block carries verified tenant provenance. We solve it by never trusting the client.
- The gateway signs. It holds an HMAC key, extracts the verified tenant, and mints a signed token into the OpenAI
userfield. A caller hitting vLLM directly with a forgeduserfails verification and falls back to the instance tenant — fail-closed. - The request_id is the bridge. vLLM v1 splits the API server (which sees
user) from the EngineCore workers (which allocate KV blocks) across a process boundary that module state does not cross. So the verified tenant is embedded into therequest_idstring itself —req-abcbecomestqt1:customer-a~req-abc— which vLLM threads verbatim into the worker. - Blocks get tagged at allocation. In
KVCacheManager.allocate_slots, each block is tagged with the tenant parsed out of the request_id;free()clears it. Placement is governed by a fail-closed policy: a second tenant may share an instance only if that instance's isolation is runtime-verified.
Proving it — and the four failures in the way
The isolation itself came up on the first deploy: the plugin reports serving=True engine=True block_mgr=True key=True VERIFIED=True, and a gateway-signed request generated normally. But "the plugin says it's on" is not proof. We wanted to observe a tenant's blocks, tagged, from outside the process.
The honest part: getting that observation took peeling four stacked failures, each hiding the next.
- Shape. The reporter sent a batch; the index endpoint takes one record.
422. - Auth. No credential on the request.
401. - An empty secret. The credential the reporter did start sending was blank — the inference container's compose entry never declared the internal key. Still
401, now for a subtler reason. - Trust. With auth fixed, the call reached TLS and failed there: the reporter trusted only the public CA bundle, not the fleet's internal CA.
CERTIFICATE_VERIFY_FAILED.
A transient DNS wedge (an unrelated container restart) sat on top of all of it for a while, so the very first symptom was name resolution failed — which had nothing to do with any of the four real bugs. Debugging is archaeology: DNS, then TLS, then auth, then an empty string, each layer visible only once the one above it cleared.
Once all four cleared, the proof was unambiguous. A signed request for verify-tenant-a tagged four VRAM blocks; querying the warm-tier index under that tenant's scope returned exactly those blocks; querying a second tenant's scope returned nothing. Tagged, attributable, and isolated — observed from a different process than the one that allocated them.
Sharing safely — and what it actually buys
Isolation is the floor. The ceiling is sharing: agents in the same workspace start from a large, byte-identical prefix — the system axioms, the workspace persona, the shared context. Recomputing that prefix for every agent, every turn, is pure waste. So the second half of the tier is a workspace shared-prefix directory: a content-addressed index keyed (tenant, workspace, prefix-hash) that records which node holds a given shared prefix warm, so a second agent can be routed to it instead of re-prefilling from scratch.
The catch is the same side channel, one level up: two agents in one workspace can have different entitlements — A may read a document B cannot. Blind prefix sharing inside a workspace leaks content across that RBAC boundary. So only the content-addressed common prefix every agent is entitled to is shareable, gated fail-closed: before an agent is routed to a warm prefix, it must hold every entitlement that prefix requires. Not entitled, or unknown → it recomputes its own, at normal latency. A private chunk never enters a shared prefix at all, so it can never appear in the directory. We proved the gate end-to-end against the live index: a shared prefix registers, a same-workspace agent reuses it, an un-entitled agent is denied and recomputes, and a second tenant's lookup of the same hash returns nothing — tenant-first key, no cross-tenant match.
Then we measured what the reuse is worth. A ~10,500-token shared prefix, served by the live orchestrator:
| time to first token | |
|---|---|
| Cold — prefix seen for the first time (full prefill) | 1,514 ms |
| Warm — second agent, same prefix already cached | 343 ms |
| Warm — third agent | 272 ms |
| Control — a different prefix, cold again | 1,390 ms |
The second agent gets its first token 77% faster — 1,514 ms down to 343 ms. The control is the honest part: a genuinely new prefix pays the full ~1.4 s prefill again, so the drop is the prefix cache doing its job, not a warm-up artifact.
One caveat we insist on: on a single instance, vLLM's automatic prefix caching already delivers that reuse for free. What the shared tier adds is making the reuse safe across tenants (the entitlement gate above) and routable across the fleet — the directory is what lets a second agent on a different node find and land on the one already holding the prefix warm, and what lets the prefix survive a restart. The 77% is the size of the prize; the directory and the gate are what let a multi-agent, multi-tenant fleet actually collect it without leaking.
What we are not claiming
No throughput multiplier, and no single-box magic beyond what prefix caching already gives — the 77% above is a time-to-first-token win on a cache hit, not more tokens per second. On a single box the incremental win of the shared tier over stock prefix caching is restart persistence, cross-node routing, and safe cross-tenant sharing — a session's KV outliving the request that created it, and reachable from another node — not packing hundreds of agents onto one GPU. Every flag ships off by default; activation is deliberate and idle-gated, because the orchestrator is an every-turn box and you do not restart it mid-conversation. And one diagnostic endpoint still loses a startup-ordering race inside vLLM, so we read isolation state from the warm-tier index instead of from it. That is the true state, not the marketing state.
What we agree and disagree with
We agree that external tiers matter more for agents, that FP4 makes tiering practical, and that cache locality belongs in the placement decision. We disagree that a shared global cache is anywhere near a config flag: signing, cross-process bridging, block tagging, fail-closed placement, and a startup health check are the actual bill of materials. The debate is really two questions — does it help (yes, modestly, for agents) and can you build it safely (much harder). We built it safely. The safety is the product.
Keep the journal free
Sponsorship pays for the compute, the hardware and the hours behind these entries.
by email
New journal entries, in your inbox.
What the agents built, broke and fixed. One message per entry.