Agentic Inference Turns the KV Cache Into a Placement and Routing Problem
Agents leave KV state idle during tool calls. GPU, CPU and storage tiers can preserve it, but transfer cost and routing decide the payoff.
On this page
An agent may generate a few tokens, call a search or code tool, and wait several seconds before continuing. During that gap, its key-value cache can sit in GPU memory doing no computation while still consuming capacity. The infrastructure question is not simply how much HBM a rack has. It is whether a returning turn can reuse the right state without making the system slower or harder to balance.

The state behind the next token
Transformer inference computes attention keys and values for prompt tokens. Retaining them in a KV cache lets later tokens reuse prior attention state instead of repeating all of the prefill computation. The cache grows with context length, model dimensions, number of active sequences and representation precision. In a high-concurrency service, these bytes compete with model weights and active decode state for GPU HBM.
For a simple chat turn, holding the cache in HBM may be the obvious choice. An agent changes the timing. It can pause while a tool runs, then return with the same long conversation plus new results. The state is valuable, but the wait makes it idle. A fleet with many concurrent agents may have large amounts of context that are temporarily inactive yet potentially reusable.
NVIDIA frames the problem as using each memory byte for useful work. Its architecture article describes KV-aware routing, disaggregated serving and a KV Cache Runner that can move blocks among GPU, CPU and storage tiers using NIXL. That vendor description outlines the design direction; the best placement policy depends on workload reuse, transfer bandwidth, eviction rate and serving latency targets. [1]
Routing is part of memory management
In a distributed serving pool, the request router needs to know which worker has a matching prefix. NVIDIA Dynamo’s KV Router documentation describes active decoding blocks tracked over a request lifecycle and cached blocks indexed from worker-reported KV events. Its cost function combines the prefill work a request would need on a worker with active decode load. A cache hit has value only if it does not send too much additional work to an already saturated node. [2]
This creates a familiar scheduling tension:
- Cache locality: routing to a worker with the prefix can avoid redoing prefill.
- Load balance: a hot worker should not receive every request just because it has popular context.
- Transfer cost: if the state lives elsewhere, moving it may cost more than recomputation.
- Freshness and lifecycle: cache events can lag, and blocks must be retired when requests finish or state is evicted.
The router is making an estimate from cache overlap, active request state and system configuration. Teams should measure whether the route saved work end to end, not just count cache hits. A hit rate can rise while tail latency worsens if it concentrates traffic or triggers large transfers.
Disaggregate prefill and decode carefully
Prefill processes the prompt and creates KV state; decode generates subsequent tokens. They stress resources differently. A system can place these phases on different workers, then transfer the cache from the prefill worker to the decode worker. NVIDIA’s Dynamo architecture documentation describes a PrefillRouter choosing a worker using cache overlap and load, then using NIXL to move KV state over an available transport such as NVLink or InfiniBand/UCX. The transfer is non-blocking so GPU work can proceed during movement. [3]
Disaggregation is not free. It adds a data-transfer path, metadata handoff, worker coordination and failure cases. The transport must be fast enough relative to the computation it saves. If the context is short or cache overlap is low, routing complexity may not pay off. If the decode worker is overloaded or the fabric is congested, the transfer can become part of the critical path. Each deployment should compare an integrated baseline against disaggregated execution at realistic prompt sizes and concurrency.
A useful way to evaluate a cache tier
For each tier, measure four quantities: capacity cost, transfer bandwidth, transfer latency and probability that the state will be reused before eviction. GPU HBM is fastest and scarce. Coherent CPU memory can be a nearby expansion tier on systems that support it. Local SSD and shared storage offer more capacity but usually impose higher access costs and different failure or contention modes. The right choice is not “keep everything”; it is “retain the state whose expected recomputation cost exceeds its storage and retrieval cost.”
A simplified decision rule for one cache block is:
expected reuse value = reuse probability × avoided prefill cost
Move or retain the block when that value exceeds transfer cost, capacity opportunity cost and the latency risk of retrieving it later. This is an engineering model, not a claim that a deployed router uses this exact equation. It makes the tradeoff explicit and can guide workload experiments.
Operators should collect cache residency by tier, prefix overlap, block-transfer bytes and duration, recomputation time, evictions, route decisions and tail latency. Segment those measures by context length and agent workflow. A single aggregate cache-hit percentage cannot explain whether the system benefits.
The lower tiers trade latency for capacity in the same broad way described in our guide to running larger models with quantization and offloading. For a memory-heavy retrieval workload, see the RAG retrieval failure and migration cost explainer.
What the Rubin memory story does—and does not—say
NVIDIA’s recent co-design discussion reports a Vera Rubin HBM capacity per GPU similar to GB300 while describing higher bandwidth and a substantially higher throughput-per-megawatt result on a named agent benchmark. The post attributes the outcome to several changes across GPU, software, CPU and storage. It does not isolate the causal contribution of cache placement alone, nor does it guarantee the same ratio for another workload. [1]
The durable idea is broader than one rack: agentic inference turns memory into a moving systems resource. Cache placement and request routing are coupled. A design that preserves context can avoid repeated work, but only when its transfer path, scheduler and workload timing line up. Measure the full request lifecycle—including the wait for tools—before deciding whether a larger GPU pool, a new memory tier or better routing is the actual bottleneck.
Frequently asked questions
Why does an agent’s KV cache matter between tool calls?
A later turn may reuse attention state for the earlier prompt and conversation. Keeping that state in GPU memory avoids recomputation but consumes scarce HBM while the agent waits for a tool. Moving or evicting it trades memory capacity against transfer and reload latency.
Does KV-aware routing guarantee lower latency?
No. It can reduce repeated prefill when the selected worker has useful prefix blocks, but routing must also account for active load, block transfer cost, cache freshness and the cost of concentrating traffic on a warm worker.



/* Comments */
Comments are offline right now — we reconnect automatically, nothing is lost.