GPU Servers

AWS ElastiCache Distributed KV Caching: Up to 40% Cheaper Self-Hosted LLM Inference — If Your Prompts Repeat

11 min read

AWS ElastiCache Distributed KV Caching: Up to 40% Cheaper Self-Hosted LLM Inference — If Your Prompts Repeat

The Short Answer

AWS is now selling a shared memory tier for self-hosted LLM fleets: distributed KV caching with Amazon ElastiCache for Valkey 9.1 on cache.i8ge.48xlarge nodes, paired with an agent skill in the Agent Toolkit for AWS that evaluates and sets it up from your coding agent. AWS claims up to 40% lower inference cost and up to 80% lower time to first token (TTFT) — figures verified today, November 28, 2026, on both the AWS Machine Learning Blog launch post and the ElastiCache pricing page. The catch is in the fine print AWS itself publishes: the win depends on long, repeated prompts, EFA-capable GPU instances, and actually shrinking your GPU fleet or serving more traffic with it. Below: what shipped, the worked pricing example with real dollars, who should adopt it, and who should skip it.

The Problem It Solves: Paying Twice for the Same Context

When you self-host an LLM on GPUs — with vLLM or SGLang, the two engines AWS targets — every server keeps its own small KV cache in GPU memory. The KV cache stores the attention key-value states for tokens already processed, so the model does not recompute them for every output token. The trouble starts when a conversation resumes on a different server, or after a pause long enough for the local cache to be evicted. That server has none of the history, so it recomputes the KV states for the entire context — a step called prefill — before generating a single word.

AWS’s launch post uses a legal AI assistant as the example: hundreds of thousands of tokens of case history per thread, a lawyer returning after lunch, and a first token that takes minutes because the GPU redoes all the prefill work. The same pattern hits resumed coding agents, document Q&A with retrieval-augmented generation (RAG), and any multi-turn assistant where users come back minutes or hours later. At 64K-token contexts — the size in AWS’s own worked example — prefill is not a rounding error; it is the bill.

Distributed KV caching extends the GPU-local cache with a shared tier beside the fleet. Any GPU server can load previously computed KV state from ElastiCache instead of recomputing it, across sessions, routing changes, and server failures. If you are new to this hardware tier, our explainer on what a GPU server is covers why GPU memory, not CPU or disk, is where this fight happens.

What AWS Actually Shipped

Two things, and it helps to keep them separate.

The cache capability itself. Distributed KV caching runs on ElastiCache for Valkey 9.1 or later, on cache.i8ge.48xlarge nodes. Per the pricing page checked today, there is no additional charge for the distributed KV cache beyond the standard node-hour price, and no data transfer charge between ElastiCache and GPU or accelerator instances in the same Availability Zone. Transfers ride Remote Direct Memory Access (RDMA) over Elastic Fabric Adapter (EFA), which is why the GPU side needs EFA RDMA write support — AWS names p5 instances as the example.

The agent skill. The November 20, 2026 Machine Learning Blog post walks through a distributed KV caching skill in the Agent Toolkit for AWS, usable from Kiro, Claude Code, OpenAI Codex, and other coding agents that support Agent Skills. The skill runs four flows: a fit check before any spend, a savings estimate using the free KVTrace tool, the setup itself, and troubleshooting. It adds an LMCache connector to your existing vLLM or SGLang deployment — including vLLM workers under llm-d or Ray Serve — and pins the fleet to one KV ID mechanism (hash and seed) and an explicit KV data type, because mismatched settings make servers write KV state the others cannot find.

The prerequisites, per AWS, are specific: a coding agent that supports Agent Skills; GPU instances supporting EFA RDMA write such as p5; LMCache 0.5.8rc1 or later; 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. This is not a feature you bolt onto a single-GPU VPS — it is fleet infrastructure for operators already running multiple large GPU instances. For the opposite end of the spectrum, see how AWS Lambda on GPUs removes server management entirely; distributed KV caching assumes you manage servers and want them cheaper.

The Math: AWS’s Own Worked Example

AWS publishes a full pricing example (Example 9 on the ElastiCache pricing page, read today), and it is worth taking seriously because every input is stated. The scenario: a coding assistant on three p6-b300.48xlarge instances in US East (N. Virginia) at $142.4160 per hour each, serving requests of about 60K input tokens and 600 output tokens, with targets of p95 TTFT under 10 seconds and time per output token under 100 ms. The three instances serve 2,400 requests per hour. Peak traffic is 4,320 requests per hour.

Option GPU servers Cache nodes Total $/hour Requests/hour Cost per million tokens
Baseline (3 GPUs, no cache) 3 × p6-b300.48xlarge 0 $427.25 2,400 $2.9376
Add more GPUs 6 × p6-b300.48xlarge 0 $854.50 4,320 $3.2640
Add distributed KV cache 3 × p6-b300.48xlarge 1 × cache.i8ge.48xlarge ($32.1209/hr) $459.37 4,320 $1.7547

Read it the way a buyer should. Adding three more GPU servers doubles the hourly bill to $854.50 and actually raises cost per million tokens to $3.2640, because the new GPUs spend their time recomputing the same long contexts. Adding one cache node at $32.1209 per hour — about 7.5% on top of the GPU bill — lets the original three servers handle the same 4,320 requests per hour, at $1.7547 per million total tokens. That is the 40.3% saving AWS headlines: ($2.9376 − $1.7547) ÷ $2.9376. Serving the peak costs $459.37 per hour instead of $854.50.

Two honest caveats. First, this is AWS’s scenario with AWS’s inputs — 60K-token contexts with heavy repetition are close to the best case for KV reuse. Second, the cache node is not cheap in absolute terms: $32.12 per hour is roughly $23,400 per month if left running. The economics work because a p6-b300.48xlarge costs $142.42 per hour; one cache node displacing three of them is an easy trade. Scale the same logic down to small GPU instances and the trade inverts — which is exactly why AWS built the fit check.

The Fit Check Is the Real Product

The most valuable part of the launch is not the cache; it is the discipline AWS wraps around it. Before provisioning anything, the skill reads your GPU fleet with a read-only describe-instances call, counts EFA interfaces, and asks for what it cannot see: engine, model, tensor-parallel size, KV data type, server price, and how often prompts repeat. It stops and explains when the workload does not fit.

Three gates matter:

Prompt length cutover. For short prompts, loading KV state over the network can take longer than recomputing it. Above a certain length, the read wins. Your cutover point — a function of model, network, and cache distance — decides whether the cache helps at all. Chatbots with 500-token prompts will never cross it; 64K-token RAG and agent threads cross it easily.

Repeat rate. KVTrace, which AWS offers at no additional charge, records KV cache events from vLLM or SGLang and replays them offline against candidate cache sizes, recommending the smallest capacity that reaches 90% of the savings ceiling. The recorder stores block hashes and token counts, never token IDs or prompt text — and AWS advises passing an anonymize key file when prompts are sensitive. If your traffic rarely repeats a prefix, KVTrace will tell you before you spend.

The dollars test. AWS states it plainly: freed GPU time becomes a financial saving only if you run fewer servers or serve more traffic on the same fleet. A cache that makes three servers 40% faster but leaves all three running at the same request volume saves latency, not money. That distinction is the difference between a cost project and a performance project — both legitimate, but only one shows up on the bill.

AWS also flags two simpler fixes to try first: if prefix caching is turned off, turning it back on speeds up back-to-back turns for free; and if your GPU prefix-cache hit rate is already above 90% with session affinity, a shared cache may add nothing. And one security note worth repeating: a shared KV cache can leak timing signals between tenants — one tenant may infer from response times that another sent the same text. AWS’s guidance is separate caches for cases that must stay isolated, or tenant IDs folded into the KV hash for shared ones.

Setup, in Brief

Once you confirm the proposed node count and estimated price, the skill creates a security group with EFA permissions, a Valkey 9.1 cluster with a custom parameter group using caching eviction policies, and a dedicated LMCache cache user whose password lives in AWS Secrets Manager. It prepares each GPU server, starts one LMCache server per GPU server, verifies the cluster with a small test object, and confirms repeated prompts load KV state over RDMA. Before production traffic, it empties the local tiers and checks that two cache-loaded runs produce identical output — because a layout mismatch can show healthy hit counters while returning wrong answers. The troubleshooting flow covers the classic failure: the RDMA handshake succeeds but transfers fail, usually a security group missing its self-referencing EFA egress rule.

For context on where this sits in the market: Google’s A5X Vera Rubin machines attack the same bottleneck from the hardware side — more local SSD, more network bandwidth, KV offload beyond HBM — while AWS is attacking it with a shared cache tier on existing fleets. Both moves say the same thing: for long-context inference, memory movement now binds before raw GPU compute does.

Who Should Care, and Who Should Skip It

Care if you self-host open-weight models on multiple EFA-capable GPU instances (p5-class or larger), serve long repeated contexts — RAG over large documents, coding agents with resumed sessions, legal or support assistants with long threads — and can either retire GPU servers or absorb growth without buying them. Run KVTrace first; it is free, and its answer is the purchase decision.

Skip it if you run a single GPU server, serve short prompts, already see above-90% prefix-cache hit rates with session affinity, or rent GPU capacity by the hour from smaller providers where EFA and cache.i8ge.48xlarge nodes are not on the menu. For those setups, the same money buys more GPU time than cache nodes. And if you do not self-host at all, this launch changes nothing for you today — though it is a useful signal that per-token costs for long-context API workloads should keep falling as providers adopt the same trick internally.

What to Watch Next

  1. Independent benchmarks. AWS’s 40% and 80% are “up to” figures from its own tests. Third-party TTFT and cost-per-token results on real agent traffic will show where the typical workload lands.
  2. Smaller cache nodes. Today the capability is tied to cache.i8ge.48xlarge. A smaller entry node would open the math to mid-size fleets.
  3. Engine support. vLLM and SGLang via LMCache are covered; watch whether other serving stacks get first-class connectors.
  4. Provider response. Google and the hourly GPU market will answer with their own KV-tiering offers; compare total cost per million tokens, not headline percentages.

FAQ

What is distributed KV caching in Amazon ElastiCache?
A shared cache tier — ElastiCache for Valkey 9.1 on cache.i8ge.48xlarge nodes — that stores the KV attention states self-hosted LLM inference engines compute, so any GPU server in the fleet can reuse them instead of recomputing prefill. AWS claims up to 40% lower inference cost and up to 80% lower time to first token.

How much does it cost?
Per AWS’s pricing page checked November 28, 2026: no additional charge beyond the standard cache.i8ge.48xlarge node-hour price, and no data transfer charge between ElastiCache and GPU instances in the same Availability Zone. In AWS’s worked example the cache node is $32.1209 per hour, against $142.4160 per hour for each p6-b300.48xlarge GPU server.

What do I need to run it?
GPU instances with EFA RDMA write support (such as p5), LMCache 0.5.8rc1 or later, vLLM 0.11.1 or later or SGLang 0.5.13 or later, ElastiCache for Valkey 9.1 or later on cache.i8ge.48xlarge nodes, and — for the guided setup — a coding agent that supports Agent Skills, such as Kiro or Claude Code.

When does it NOT save money?
When prompts are short (loading KV state takes longer than recomputing), when prompts rarely repeat, when your GPU prefix-cache hit rate already exceeds 90% with session affinity, or when you keep the same GPU fleet at the same traffic — freed GPU time only becomes dollars if you run fewer servers or serve more requests.

The Bottom Line

Distributed KV caching is a real, well-priced answer to a real cost: long-context self-hosted inference spends a large share of its GPU hours recomputing history it has seen before. AWS’s own math — one $32.12/hour cache node letting three $142.42/hour GPU servers do the work of six, at 40% lower cost per million tokens — is compelling for fleets serving repeated 60K-token contexts, and the free KVTrace fit check means you can verify your own numbers before spending anything. For everyone else, treat the launch as a market signal: the bottleneck in AI serving has moved from compute to memory, and every major provider is now pricing that shift. Run the fit check before you buy the cache.

Sources: AWS Machine Learning Blog, “Cut self-hosted LLM cost and latency with the distributed KV caching agent skill” (aws.amazon.com/blogs/machine-learning/cut-self-hosted-llm-cost-and-latency-with-the-distributed-kv-caching-agent-skill/); Amazon ElastiCache Pricing, including Example 9 (aws.amazon.com/elasticache/pricing/) — both checked November 28, 2026.

Leave a Reply

Your email address will not be published. Required fields are marked *