distributed-kv-caching

distributed-kv-caching is a skill for Claude Code, Codex from aws/agent-toolkit-for-aws. It costs 198 tokens per session (5,226 once invoked), scanned A, original, Apache-2.0.

A shared second-level key-value cache for self-hosted large language model inference on AWS ElastiCache for Valkey. It stores the intermediate attention data for repeated prompt prefixes so GPU servers using vLLM or SGLang can reuse it.

In plain words
What is it for?
Use it with several GPU servers, long shared prompts, retrieval context, tool definitions, or multi-turn history. It helps connect an ElastiCache cache and LMCache to vLLM or SGLang deployments, including deployments under NVIDIA Dynamo or llm-d.
Why use it?
Repeated long prefixes otherwise make the inference system recompute the same work. Sharing the cached data across GPU servers can reduce first-token delay and free GPU capacity when the same prefixes return.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: reads .claude/ paths.

Good fit Use it with several GPU servers, long shared prompts, retrieval context, tool definitions, or multi-turn history. It helps connect an ElastiCache cache and LMCache to vLLM or SGLang deployments, including deployments under NVIDIA Dynamo or llm-d.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/aws/agent-toolkit-for-aws/distributed-kv-caching
About the project

Agent Toolkit for AWS is a collection of AWS-supported MCP servers, skills, plugins, commands, and hooks that help AI coding agents build, deploy, and manage applications on AWS. It is used by developers working with AWS services through agents such as Claude Code, Codex, Cursor, and Kiro. The catalogue entries are the toolkit's own agent extensions for AWS development and operations.

aws/agent-toolkit-for-aws · 3,609 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add aws/agent-toolkit-for-aws --skill distributed-kv-caching
Clone the repo
git clone --depth 1 https://github.com/aws/agent-toolkit-for-aws

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for distributed-kv-caching

README.md
[![agentmods](https://agentmods.dev/badge/skills/aws/agent-toolkit-for-aws/distributed-kv-caching/github.svg)](https://agentmods.dev/skills/aws/agent-toolkit-for-aws/distributed-kv-caching)
Your own site
<a href="https://agentmods.dev/skills/aws/agent-toolkit-for-aws/distributed-kv-caching"><img src="https://agentmods.dev/badge/skills/aws/agent-toolkit-for-aws/distributed-kv-caching/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for distributed-kv-caching

Your own site · 80×15
<a href="https://agentmods.dev/skills/aws/agent-toolkit-for-aws/distributed-kv-caching"><img src="https://agentmods.dev/badge/skills/aws/agent-toolkit-for-aws/distributed-kv-caching.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 198 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,226 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00198 $0.05226
Opus 5.5 $0.00079 $0.02090
Sonnet 5.5 $0.00040 $0.01045
Haiku 4.5 $0.00020 $0.00523

Measured 9d ago against content hash a2dc62729c81, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

distributed-kv-caching scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/specialized-skills/database-skills/distributed-kv-caching/SKILL.md · 182 lines

How it starts

The opening of the file, as written. The whole thing — 182 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Distributed KV Caching

Overview

During prefill, an inference engine computes attention key-value (KV) tensors for every prompt token. A shared L2 KV cache on Amazon ElastiCache keeps these tensors, so any GPU server in the fleet can load a returning prefix instead of computing it again. This decreases time-to-first-token (TTFT) and frees GPU time. The cache runs on cache.i8ge.48xlarge nodes with the valkey-large-object module; an LMCache server on each GPU server connects it to vLLM or SGLang over RDMA on Elastic Fabric Adapter (EFA).

The AWS MCP server is recommended for sandboxed execution and audit logging. Every step also works with the AWS CLI directly. Secret steps MUST NOT go through an AWS API tool (Security considerations).

When this skill applies

  • Self-hosted open-weight LLMs on GPUs (EC2, EKS, or similar) with vLLM or SGLang, directly or as vLLM workers under NVIDIA Dynamo or llm-d
  • Long shared prompt prefixes (system prompts, RAG context, tool definitions, multi-turn history)
  • Several GPU servers, changing routing, or GPU and host memory that evict prefixes before reuse
  • A goal of lower TTFT, more requests per GPU, or lower cost per request

TensorRT-LLM: No final TensorRT-LLM release includes the LMCache MP connector; pre-release builds do, and they work with this setup. This skill gives no TensorRT-LLM engine steps; the LMCache server and ElastiCache steps are the same for every engine. For the engine side, follow the TensorRT-LLM release notes and the LMCache docs. KVTrace records only vLLM and SGLang.

When this skill does not apply

  • Amazon Bedrock managed inference (no self-hosted GPUs): point the builder to Bedrock prompt caching.
  • Application caching (session stores, database query caching), LLM response caching, or semantic caching: route to the amazon-elasticache skill.
  • Short or never-repeated prompts (classification, translation, moderation), output-dominated work, or diffusion models.

Read the full file on GitHub · 182 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 182 lines · 198 tokens per session scan A a2dc62729c81

Subscribe to this mod's changes

distributed-kv-caching is a skill published in the GitHub repository aws/agent-toolkit-for-aws (3,609 stars, last pushed today), licensed Apache-2.0. It adds 198 tokens to every session and 5,226 once invoked, about $0.0008 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-21.

Related

distributed-kv-caching compared with skills from other repositories

distributed-kv-caching next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
distributed-kv-cachingaws/agent-toolkit-for-awsSkill3.6ktodayApache-2.0A198Claude Code, Codex
tensorrt-llmNousResearch/hermes-agentSkill267ktodayMITA18Claude Code, Codex
agent-platform-tuninggoogle/skillsSkill25ktodayApache-2.0A64Claude Code, Codex
google-cloud-solution-guided-gke-ai-migrationgoogle/skillsSkill25ktodayApache-2.0A157Claude Code, Codex
apigee-agent-gateway-governancegoogle/skillsSkill25ktodayApache-2.0A222Claude Code, Codex
agent-platform-endpoint-managementgoogle/skillsSkill25ktodayApache-2.0A64Claude Code, Codex
gke-inferencegoogle/skillsSkill25ktodayApache-2.0A119Claude Code, Codex