
AWS adds an agent skill for distributed LLM KV caching
AWS has introduced a distributed KV caching skill in the Agent Toolkit for AWS. The skill evaluates workloads, prepares cache clusters for testing or production, and helps troubleshoot caching for large language model inference. AWS says distributed KV caching with Amazon ElastiCache can reduce self-hosted inference costs by up to 40% and time to first token by up to 80%. Those figures are stated upper bounds, not guaranteed results for every deployment.
Extending beyond GPU-local caches
Inference servers can keep KV state in GPU-local caches and reuse it when the relevant context remains available on the same server. Distributed KV caching adds a shared tier to that arrangement. Servers can therefore reuse KV state across sessions, after routing changes, and following server failures. The objective is to avoid recomputing context that has already been processed, including when the next request does not reach the original GPU server.
That architecture does not make caching beneficial in every case. Prompt length and prompt repetition determine whether the avoided computation covers the cost of using the shared cache. For short prompts, loading stored KV state can take longer than calculating it again. The percentages cited by AWS consequently cannot be applied automatically to every model, traffic pattern, prompt mix, or routing configuration.
Estimating value before deployment
The skill uses KVTrace to estimate workload-specific benefits from model and traffic data before infrastructure is deployed, at no additional charge. Its fit check makes a read-only describe-instances call to inspect the GPU fleet and count Elastic Fabric Adapter interfaces. It then asks the operator for workload details that the inspection cannot observe.
KVTrace records KV-cache events from vLLM or SGLang and replays them offline against candidate shared-cache sizes. The traces contain block hashes and token counts, rather than token IDs or prompt text. This allows alternative cache sizes to be assessed against the recorded workload profile before the target cache infrastructure is created.
The evaluation stage is important because the decision is workload-specific. Repeated, sufficiently long prompts offer a different reuse opportunity from short or rarely repeated prompts. The fit check and offline replay connect the infrastructure decision to the observable model and traffic data instead of treating a shared cache as an automatic optimization.
Connecting existing inference deployments
The agent can add the LMCache connector to an existing vLLM or SGLang deployment. In doing so, it preserves routing and inference-engine settings while aligning KV identifiers and data-type settings across inference servers. The skill works with Kiro, Claude Code, OpenAI Codex, and other coding agents that support Agent Skills.
The documented flows have specific prerequisites. They require an Agent Skills-compatible coding agent, GPU instances that support EFA RDMA write, and LMCache 0.5.8rc1 or later. The inference environment must use vLLM 0.11.1 or later or SGLang 0.5.13 or later. When the flow creates the cache, it also requires ElastiCache for Valkey 9.1 or later running on cache.i8ge.48xlarge nodes.
What the setup flow performs
The agent requests confirmation before it creates resources. After confirmation, it configures EFA security permissions and a Valkey 9.1 cluster, stores the LMCache user password in AWS Secrets Manager, and starts one LMCache server for each GPU server. It then tests loading KV state over RDMA by using a repeated prompt.
This workflow brings together several settings that must agree for reuse to function: inference-server KV identifiers and data types, the shared-cache service, EFA permissions, credentials, and the LMCache processes attached to the GPU servers. The repeated-prompt test checks the resulting data path rather than stopping after resource creation.
Troubleshooting the RDMA path
The skill also covers operational diagnosis. In the documented troubleshooting example, successful BLOB.RDMA_HELLO operations combined with a rising rdma_write_errors count are treated as likely evidence that a security group is blocking EFA traffic between its own members. This is presented as a likely cause for that particular symptom pattern, not a universally confirmed explanation for every RDMA error.
What operators should take from the release
The practical sequence is to evaluate the workload first, compare retrieval with recomputation, verify the required software versions and EFA support, and create resources only after confirmation. AWS presents substantial possible cost and latency reductions, while the same documented process explicitly tests whether the workload can benefit. Distributed KV caching is therefore a measurable infrastructure choice whose value depends on prompt length, repetition, and the surrounding inference configuration.