AI Tools Developer Tools

Distributed KV Caching for Self-Hosted LLMs: What the New AWS Agent Skill Does

AWS says distributed KV caching with Amazon ElastiCache can cut self-hosted LLM costs by up to 40%, and an agent skill now guides the setup.

Illustration of GPU servers sharing a central cache, representing distributed KV caching for self-hosted LLMs
AI-generated editorial illustration.

A lawyer returns to a long AI conversation after lunch and waits minutes for the first word of a reply. The delay comes from the server redoing work it already did. Distributed KV caching stores that work in a shared memory tier so any GPU server can reuse it, and AWS now offers an agent skill that helps a coding assistant evaluate and set it up.

AWS says the approach can cut self-hosted LLM inference costs by up to 40% and time to first token by up to 80%. Those are vendor figures, and the actual result depends on the workload.

What problem does distributed KV caching solve?

When an LLM reads a prompt, it computes internal values for every token, called key-value (KV) attention states. This step, known as prefill, must finish before the model writes anything. Time to first token (TTFT) is the wait between sending a request and seeing the first word of the answer.

AWS explains that self-hosted setups often waste GPU time here. Each server keeps a small, isolated cache, so a request routed to a different server finds none of the earlier history. That server recomputes everything. AWS names resumed coding agents, agentic assistants, and document Q&A tools as workloads with the same pattern.

Distributed KV caching adds a shared tier next to the GPU fleet.

What is the agent skill, and what does it do?

An agent skill is a packaged set of instructions that a coding assistant follows to complete a specialized task. AWS describes a distributed KV caching skill in its Agent Toolkit for AWS. The skill guides the assistant through three jobs: checking whether a workload benefits, setting up a cache cluster for testing or production, and troubleshooting inference caching. AWS says it works with Kiro, Claude Code, OpenAI Codex, and other coding agents that support Agent Skills.

AWS walks through four conversations: diagnosing a slow first token, sizing and pricing the cache, setting it up, and fixing a failed transfer.

A fit check before any spend

AWS says the agent first reads the GPU fleet with a read-only call and counts Elastic Fabric Adapter (EFA) interfaces, which are high-speed network connections. It then asks only for details it cannot see: inference engine, model, tensor-parallel size, KV data type, server price, and how often prompts repeat. When something does not fit, AWS says the agent stops and explains why.

Numbers drawn from the workload

For short prompts, loading stored KV state can take longer than recomputing it. Above a certain prompt length, called the cutover point, reading from the cache wins. AWS says that cutover, together with how often prompts repeat, decides whether the cache is worth its price. The agent estimates savings from the workload’s own figures.

For this estimate, AWS points to KVTrace, a tool that records KV cache events from a running vLLM or SGLang fleet. AWS says it runs before any infrastructure is deployed and carries no additional charge.

What infrastructure sits underneath?

The ElastiCache documentation describes a fully managed service built on ElastiCache for Valkey. It runs on node-based clusters of the cache.i8ge.48xlarge node type with Valkey 9.1 or later, using a module designed for large objects. Each node stores data in memory and on local NVMe storage. Clients move data using remote direct memory access (RDMA) over EFA, or over standard TCP.

The documentation says the approach works with open-weight, fine-tuned, or self-trained models, provided the inference engine and LMCache support them. It lists families such as Qwen, DeepSeek, Gemma, GLM, and GPT-OSS.

Cost, access, and regions

Per the documentation, billing follows standard ElastiCache node pricing, charged per cache.i8ge.48xlarge node per hour until the cluster is deleted. Data transfer between GPU hosts and the cluster within the same Availability Zone carries no charge, and reserved nodes are available. Current prices sit on the ElastiCache pricing page.

The feature is listed in these regions:

  • North America: US East (N. Virginia), US East (Ohio), US West (Oregon)
  • Europe: Ireland, Frankfurt, Stockholm
  • Asia Pacific: Mumbai, Tokyo, Singapore, Sydney, Hong Kong, Malaysia, Thailand

Which workloads benefit, and which do not?

The documentation says distributed KV caching suits long-running or multi-turn sessions, workloads with shared or repeated context, and spiky traffic spread across many GPU servers. Listed examples include coding agents, multi-turn chat, shared system prompts, and long-context or retrieval-augmented generation (RAG) workloads.

It gives little benefit for short or never-repeated prompts, such as classification, translation, or moderation. It also helps little when output generation takes most of the time, and it does not apply to diffusion models.

How does it compare with other approaches?

The default for most self-hosted setups is the GPU-local cache each inference server keeps. It is free to use but isolated, so context cannot move between servers. AWS positions the shared tier as an extension of that local cache, not a replacement. The documentation also mentions LMCache, a layer that connects inference engines to external cache storage, as a dependency for model support.

The sources do not compare this service against other vendors’ caching products, so no such comparison is made here.

A realistic workflow

Consider a team running a coding assistant on a GPU fleet, where long sessions resume unpredictably on different servers. Following the documented flow, the team would ask its coding agent to run the fit check, supplying the engine, model, tensor-parallel size, server price, and repeat rate when asked. The agent would estimate whether the cutover point and repeat rate justify the cache’s hourly cost. If the numbers hold, the team asks the agent to create a test cluster, then returns to the agent if a transfer fails. The team could separately run KVTrace against its own fleet to cross-check the estimate before paying for nodes.

This is an illustration built from the documented steps, not a reported customer case.

Both the 40% and 80% figures are stated as upper bounds, and AWS notes that results depend on model, traffic pattern, and prompt routing. The cache runs only on one large node type, so a small fleet with short prompts may find the hourly node cost hard to recover. Teams should confirm current documentation for supported engines and models, and treat KVTrace output as an estimate rather than a guarantee.

The open question

The remaining question is how often real production traffic repeats context at the lengths where reading beats recomputing. AWS’s own tooling suggests that answer, not the headline percentages, determines whether the shared cache pays for itself.

Sources