Skip to content
Apixo
Blog
news· 4 min read· via AWS Machine Learning

AWS Introduces Coding Agent Skill to Automate Distributed KV Caching on GPUs

AWS has launched an agent skill for its Agent Toolkit, helping developers diagnose, size, and deploy distributed KV caching with ElastiCache to cut LLM inference latency and costs.

AWS Introduces Coding Agent Skill to Automate Distributed KV Caching on GPUs

Running self-hosted large language models on dedicated GPU clusters offers teams tight control over privacy, latency, and operational expense. Yet, as context windows grow in agentic workflows, document retrieval, and conversational tools, GPU clusters often suffer from redundant computation. Because local GPU memory caches are isolated on individual nodes, servers frequently recompute key-value (KV) attention states from scratch—an expensive initial phase known as prefill. AWS is addressing this challenge by introducing a distributed KV caching skill within the Agent Toolkit for AWS, allowing developers to configure and manage shared memory layers using their coding agents.

Distributed KV caching pairs an inference fleet with an external shared tier powered by Amazon ElastiCache. By holding KV states across user sessions, routing reassignments, and server restarts, the architecture can lower self-hosted inference costs by up to 40% and cut time to first token (TTFT) by up to 80%.

How distributed KV caching reduces latency and compute

When a long-running conversation resumes—such as a legal assistant processing a 64,000-token case history—a freshly assigned GPU normally has none of that prior context in its local cache. Recomputing those attention states can delay the first generated token by seconds or even minutes. Distributed KV caching solves this by retaining the computed KV states in a shared Amazon ElastiCache cluster that GPU instances can access over high-speed networks.

The setup relies on GPU nodes with Elastic Fabric Adapter (EFA) Remote Direct Memory Access (RDMA) capabilities, such as AWS p5 instances. The system integrates the open-source LMCache connector (version 0.5.8rc1 or later) with serving runtimes such as vLLM (0.11.1 or later) or SGLang (0.5.13 or later), including orchestrators like llm-d and Ray Serve. On the caching side, the architecture utilizes ElastiCache for Valkey 9.1 or later hosted on cache.i8ge.48xlarge nodes. Through RDMA writes, nodes can retrieve and store KV states without putting computational strain back on the GPU.

Automated deployment via coding agents

The new skill in the Agent Toolkit for AWS works with AI coding assistants that support the Agent Skills specification, including Kiro, Claude Code, and OpenAI Codex. Instead of requiring engineers to manually architect the caching tier, the skill guides the agent through four primary workflows:

  1. Workload diagnosis: The agent inspects the fleet to identify whether latency stems from cold prefills. It verifies existing settings, such as prefix caching, and checks architectural considerations like multi-tenant isolation, ensuring sensitive workloads append tenant IDs to KV hashes or isolate cache clusters.
  2. Sizing and economic evaluation: For short prompts, loading KV states from cache can actually be slower than recomputing them on GPU. The agent identifies the cutover point where reading from cache becomes faster. To estimate cost viability, AWS provides KVTrace, a tool that records KV cache activity over a representative window without logging token IDs or prompt text. The agent evaluates the trace to ensure cache infrastructure costs are lower than the GPU compute saved.
  3. Cluster provisioning: With explicit developer confirmation, the agent builds the Valkey 9.1 cluster, creates security groups with EFA permissions, sets cache eviction policies, and stores credentials in AWS Secrets Manager.
  4. Troubleshooting: The skill assists in resolving deployment issues, such as diagnosing RDMA write failures (rdma_write_errors) caused by misconfigured security group rules blocking member-to-member EFA traffic.

What it means for developers

Managing self-hosted LLM infrastructure is notorious for operational overhead, from synchronizing hash mechanisms to tuning tensor-parallel environments. Providing an automated skill allows engineering teams to evaluate the economic and performance trade-offs of distributed caching before provisioning expensive hardware.

At the same time, maintaining dedicated p5 instances and caching clusters requires significant traffic volume to justify the setup. Teams that do not have the prompt volume to offset dedicated hardware, or those looking to avoid managing networking and node configurations, often prefer managed API endpoints. Developers can try top AI models cheaply through one API at https://apixoai.online to run models like Claude, GPT, and DeepSeek without infrastructure management.

For organizations that require self-hosted deployments for compliance, strict data isolation, or massive throughput, this agent skill provides a structured, automated path to eliminate redundant GPU prefill compute.


Source: Cut self-hosted LLM cost and latency with the distributed KV caching agent skill | Amazon Web Services — AWS Machine Learning. Written by the Apixo team from that report.

#ai-news#aws#llm#vllm#elasticache#gpu
Try it with your own tools

One key for Claude, GPT, GLM, DeepSeek and more. Pay per token with crypto.

Get your API key

Keep reading