Distributed KV caching is a shared cache tier beside a fleet of GPU servers running self-hosted large language models (LLMs), so any server can reuse the key-value (KV) attention state another server already computed instead of recomputing it. Self-hosted teams pay for that recomputation whenever a user returns to a long conversation or a coding agent resumes a thread. Amazon Web Services (AWS) says the shared tier can cut inference costs by up to 40% and time to first token (TTFT) by up to 80%, and it has published a coding-agent skill that evaluates, sets up and troubleshoots the cache. Whether those numbers apply to a given fleet depends on its workload — and the skill is built around measuring that before spending anything.
Why self-hosted LLMs redo the same work
Every token an LLM generates depends on the key and value tensors — the KV state — produced for earlier tokens. On each request the engine first runs prefill, computing KV state for every input token in parallel. Prefill is compute-bound and grows quadratically with prompt length. TTFT mainly reflects prefill latency: in tests AWS cites with B300 GPUs, prefill took seconds for a 32K-token prompt, tens of seconds for 100K tokens, and minutes beyond 250K tokens. Without cached KV state, the engine recomputes the whole prefill for a short new message, including the system prompt and all prior messages. Coding-agent traces cited by AWS show over 95% of prompt tokens are part of previously processed prefixes.
Without a shared cache tier, engines cache KV state locally. GPU memory, the L0 cache, holds up to 288 GB of HBM3e on current GPUs, shared between model weights and requests in flight; it is the fastest tier and the smallest, so long conversations age out quickly. Host memory and local NVMe, the L1 cache reached through an offload library such as LMCache, is larger but private to one server — a request on another server misses it entirely. AWS names three patterns where local tiers fail: returning sessions, routing shifts, and server failures that wipe local caches.
What distributed KV caching adds

The shared L2 tier complements L0 and L1. The engine checks local tiers in order and reads from L2 only on a miss; when it writes new KV state, the connector writes it to L2 for any GPU to reuse later. State can then be reused for days, across sessions, routing shifts and server failures, rather than routing each prompt to the server that holds its state.
The capability runs on Amazon ElastiCache for Valkey: cache.i8ge.48xlarge nodes in the same Availability Zone as the GPU fleet, ElastiCache for Valkey 9.1 or later, and the valkey-large-object module storing KV blocks in DRAM with colder blocks tiered to local NVMe. Data moves by Remote Direct Memory Access (RDMA) over Elastic Fabric Adapter (EFA) in production — TCP is for functional tests — at up to 220 Gbps per node; retrieving 1 GB as 128 eight-megabyte objects took 41.7 milliseconds at the median in AWS’s table. Engines connect through the open-source LMCache connector with a configuration change, according to AWS. The announcement names vLLM, SGLang and TensorRT-LLM, but the skill gives engine steps only for vLLM and SGLang — including vLLM workers under llm-d and Ray Serve — and states no final TensorRT-LLM release includes the LMCache multiprocess connector. KVTrace, the estimation tool below, records only vLLM and SGLang.
What AWS claims — and what decides the real saving
The headline is consistent across the announcement, the skill post and the ElastiCache documentation: up to 40% lower cost, up to 80% lower TTFT. AWS states the benefit depends on workload characteristics and cache hit rate. Its benchmarks tested coding agents, AI assistants and long-context question answering, and five 2026 LLMs from 250 billion to 1.6 trillion parameters, on two to six P6 servers with eight GPUs each running vLLM. Baselines used about 150 GB of L0 and 205 GB of L1, with one cache.i8ge.48xlarge node added in the same Availability Zone.
On shared-document question answering, each server handled twice the requests per second while meeting an interactivity objective of TTFT under five seconds and time per output token under 50 milliseconds, both at the 90th percentile — cutting cost per million output tokens by 40% after paying for the cache node. For coding agents and AI assistants, peak tokens per second rose 23% per server, and throughput rose up to 1.98 times and 1.61 times respectively within a 30-second 90th-percentile TTFT objective. In a failure test, the remaining server held 90th-percentile TTFT to 34.7 seconds — 43% lower — completed 1.48 times the requests, and the system recovered within 60 seconds versus up to 600 seconds without the cache.
Per cache hit, TTFT fell 55% to 93% across eight models. Full-attention models fell 80% or more at prompts as short as 10,000 tokens; hybrid models reached 84% past 100,000 tokens and 93% near one million. Every model AWS tested has a cutover point above which fetching beats recomputing, and every model tested cut over below 10,000 tokens (under 512 for a sparse model; 1,000–7,600 for hybrids). Below the cutover, loading KV state can cost more than recomputing it. The cutover point, prompt-repeat rate and hit rate decide whether the cache pays — and AWS notes freed GPU time becomes money only if the team runs fewer servers or serves more traffic on the same ones.
The agent skill: four conversations
The skill lives in the Agent Toolkit for AWS. A team describes the problem to its coding agent — for example, asking it to cut GPU-fleet cost and latency. It works with Kiro, Claude Code, OpenAI Codex and other coding agents supporting Agent Skills. The AWS post demonstrates it in four conversations.
Flow 1 diagnoses a slow first token: a vLLM fleet serving a legal assistant with 64,000-token contexts on p5 instances, where returning conversations take 13 seconds for the first token. The agent identifies cold prefill, checks fixes needing no new infrastructure, and asks for the model, tensor-parallel size, KV data type, replica count, routing and wait times rather than guessing the cache size. Flow 2 estimates savings: for eight p5 instances serving 64,000-token prompts for a multi-turn retrieval-augmented generation assistant, the agent looked up prices, derived prefill rate and KV size from benchmarks, and recommended two cache.i8ge.48xlarge nodes — then, with no hit rate supplied, recommended a KVTrace run. KVTrace records KV cache events from vLLM or SGLang, replays them offline against a shared cache of each candidate size, and reports hit rate, cost and TTFT estimates and a recommended cluster size. Its recorder never writes token IDs or prompt text; traces hold block hashes and token counts, and sensitive prompts need the --anonymize-key-file option. Recording runs on every GPU server for a representative window, such as a full business day.
Flow 3 sets the cache up. The agent first requests confirmation of the node count, Availability Zone and estimated price, then creates a security group with EFA permissions and a Valkey 9.1 cluster with a custom parameter group using caching eviction policies. LMCache gets its own cache user, with the password in AWS Secrets Manager. The agent prepares the GPU servers, starts one LMCache server per GPU server, verifies the cluster, confirms repeated prompts load KV state over RDMA, and checks the measured L2 share against the KVTrace prediction. Flow 4 troubleshoots a failed transfer: the LMCache server connects and BLOB.RDMA_HELLO succeeds, but transfers fail while rdma_write_errors climbs. The agent traces the pattern to a security group blocking EFA traffic between its own members and gives commands to check and fix the rule.
When it helps — and when it does not

The skill begins with a fit check before any spend: a read-only describe-instances call and a count of EFA interfaces, then questions only about what the agent cannot see — engine, model, tensor-parallel size, KV data type, server price and prompt-repeat rate. The economic test is whether the estimated saving covers the cluster’s cost: if it does not, the cache is not worth deploying.
It gives less lift where KV state fits in GPU memory, for single-call workloads with no reuse such as classification or translation, for long outputs from short prompts, and for diffusion models. Turning prefix caching back on, or a prefix-cache hit rate already above 90% with session affinity, can remove the need. Sharing has a privacy cost: a shared cache can let one tenant infer from response times whether another tenant sent the same text, so cases needing isolation get separate caches, and tenants sharing a cache add their own ID to the KV hash. The cache holds KV tensors derived from prompts, and the setup flow gives LMCache its own cache user, with the password held in AWS Secrets Manager.
Setting it up: prerequisites and guardrails
Prerequisites are a coding agent supporting Agent Skills, such as Kiro or Claude Code; GPU instances supporting EFA RDMA write, such as p5; LMCache 0.5.8rc1 or later with vLLM 0.11.1 or later, or SGLang 0.5.13 or later; and ElastiCache for Valkey 9.1 or later on cache.i8ge.48xlarge nodes for the cache itself. The skill states that where it disagrees with the authoritative LMCache, Valkey, vLLM, SGLang or ElastiCache documentation on versions, flags or limits, the documentation governs — re-check the floors at setup time. For transport, production should use RDMA; the TCP and blob-TCP transports are for functional tests.
Fleet consistency matters as much as the cluster: the agent adds the LMCache connector, keeps existing routing and settings, and sets all servers to one KV ID mechanism — hash and seed — and one explicit KV data type, and gives every LMCache adapter a non-empty key_prefix scoped to one model, model version, tensor-parallel layout and key type, avoiding key mismatches. Cluster, LMCache servers and GPU servers must share one Availability Zone. The cache is ephemeral, with no durability, replicas or snapshots. Guardrails are approval and verification: explicit approval for high-impact operations, confirmation of node count, zone and price before creation, and — before production traffic — emptying local tiers and checking that two cache-loaded runs give the same output, since a layout mismatch can produce healthy hit counters and wrong answers. Each node is charged per hour at standard ElastiCache pricing until deleted, with no same-Availability-Zone transfer charge; availability covers US East (N. Virginia), US East (Ohio), and US West (Oregon), Europe (Ireland, Frankfurt, Stockholm), and Asia Pacific (Mumbai, Tokyo, Singapore, Sydney, Hong Kong, Malaysia, Thailand).
Checking it works — and what to watch next
A running cache is not proof it helps. Verify with the two-run output check, the measured L2 share against the KVTrace prediction, and the economics check — fewer servers, or more traffic on the same ones.
“At Multiverse Computing, we help customers scale inference workloads with compressed models that cut costs and latency. We cut both even further and served more prompts on existing GPUs by adding distributed KV caching on ElastiCache for Valkey. With ElastiCache, we processed 50% more requests on the same GPUs within our one-second target for median time to first token. We achieved a 23% reduction in our median time to first token at normal traffic, and a 95% reduction at peak traffic.” — Ennio Pastore, Director of AI Platform at Multiverse Computing, quoted by AWS
That is one deployment’s experience, not a guarantee. For long, repeated, multi-server workloads, a shared L2 tier removes much prefill recomputation, with 55% to 93% TTFT savings per cache hit; fleet-level savings depend on hit rate, prompt length and routing. For short, single-use or small-scale workloads, the lift is small or absent. Still open, and deployment-specific: the current node price and break-even hit rate, whether version floors have moved since the November 2026 posts, whether a final TensorRT-LLM release has added the LMCache connector, and what KVTrace reports for the team’s own traces. Answer those on real traffic before committing to the cluster.












