clear-kv-cache-tiers-in-llm-d-deployment

clear-kv-cache-tiers-in-llm-d-deployment is a skill for Claude Code, Codex from llm-d-incubation/llm-d-skills. It costs 112 tokens per session (5,234 once invoked), scanned C, original, Apache-2.0.

A cache-reset procedure for vLLM, the software serving language models, in an llm-d deployment running on Kubernetes. It clears cached model-request data across GPU, CPU, and file-storage layers.

In plain words
What is it for?
Flushing vLLM caches across all pods before a test run, including separate pods that handle prompt processing and token generation.
Why use it?
Old cached data can affect test results or keep a deployment from starting in a clean state. This provides a reset without restarting pods when possible.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Flushing vLLM caches across all pods before a test run, including separate pods that handle prompt processing and token generation.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/llm-d-incubation/llm-d-skills/clear-kv-cache-tiers-in-llm-d-deployment
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 llm-d-incubation/llm-d-skills --skill clear-kv-cache-tiers-in-llm-d-deployment
Clone the repo
git clone --depth 1 https://github.com/llm-d-incubation/llm-d-skills

Made for: Claude Code, Codex.

Its marketplace also offers this one on its own, as the plugin clear-kv-cache-tiers-in-llm-d-deployment/plugin install clear-kv-cache-tiers-in-llm-d-deployment after adding the marketplace above.

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 clear-kv-cache-tiers-in-llm-d-deployment

README.md
[![agentmods](https://agentmods.dev/badge/skills/llm-d-incubation/llm-d-skills/clear-kv-cache-tiers-in-llm-d-deployment/github.svg)](https://agentmods.dev/skills/llm-d-incubation/llm-d-skills/clear-kv-cache-tiers-in-llm-d-deployment)
Your own site
<a href="https://agentmods.dev/skills/llm-d-incubation/llm-d-skills/clear-kv-cache-tiers-in-llm-d-deployment"><img src="https://agentmods.dev/badge/skills/llm-d-incubation/llm-d-skills/clear-kv-cache-tiers-in-llm-d-deployment/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 clear-kv-cache-tiers-in-llm-d-deployment

Your own site · 80×15
<a href="https://agentmods.dev/skills/llm-d-incubation/llm-d-skills/clear-kv-cache-tiers-in-llm-d-deployment"><img src="https://agentmods.dev/badge/skills/llm-d-incubation/llm-d-skills/clear-kv-cache-tiers-in-llm-d-deployment.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 112 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,234 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 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.00112 $0.05234
Opus 5 $0.00056 $0.02617
Sonnet 5 $0.00022 $0.01047
Haiku 4.5 $0.00011 $0.00523

Measured 12d ago against content hash 79db4d63f5dc, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade C, and why

clear-kv-cache-tiers-in-llm-d-deployment scanned grade C with 2 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 12d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/check-dev-mode.sh, scripts/reset-prefix-cache.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

Re-derives the `root_dir` per pod (self-contained) and deletes everything under it. `find … -mindepth 1 -delete` removes subdirectories and dotfiles (vLLM writes per-model subdirs, which a `rm -rf $p/*` glob would leave

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

| **RBAC / exec error** | Try port-forward: `kubectl port-forward pod/$POD -n $NAMESPACE 18000:$VLLM_PORT &`, then curl `http://localhost:18000/reset_prefix_cache?...`. |
skills/clear-kv-cache-tiers-in-llm-d-deployment/SKILL.md · 280 lines

How it starts

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

Reset vLLM Cache in llm-d

Purpose

Clear the KV / prefix cache on all vLLM pods in an llm-d deployment so the next run starts from a clean state. Prefers non-restart methods; falls back to pod restart when necessary.


Step 1: Ask for Namespace and Deployment

  1. Detect the current namespace and related options:
CURRENT_NS=$(oc project -q 2>/dev/null || kubectl config view --minify -o jsonpath='{..namespace}' 2>/dev/null || echo "")
SUGGESTED_NS=$(kubectl get namespaces -o jsonpath='{.items[*].metadata.name}' 2>/dev/null \
  | tr ' ' '\n' | grep -iE "llm-d|inference|serving|benchmark" | grep -v "^$CURRENT_NS$" | head -5)

Ask the user:

"Which namespace? 1. <CURRENT_NS> (current context) 2–N. <SUGGESTED_NS> (or type any namespace)"

Set NAMESPACE to the user's answer. If the user just confirms without specifying, use CURRENT_NS — the namespace they are currently working in.

  1. List llm-d deployments (the ROLE column reveals a disaggregated setup):
kubectl get deployments -n $NAMESPACE -l app.kubernetes.io/part-of=llm-d \
  -o custom-columns="NAME:.metadata.name,ROLE:.spec.template.metadata.labels.llm-d\.ai/role,READY:.status.readyReplicas,DESIRED:.spec.replicas"
# If empty, broaden:
kubectl get deployments -n $NAMESPACE | grep -iE "llm-d|vllm"
  • One result → use automatically, inform the user.
  • Multiple → ask: "Which deployment? (or 'all' to reset every vLLM pod in the namespace)"
  • Disaggregated prefill/decode — you see both a …-prefill and a …-decode deployment (or ROLE=prefill / ROLE=decode): both must be reset. Prefill pods hold KV cache too, so clearing only decode leaves stale prefill KV. Reset every role — the all selector below covers both in one pass, or run Steps 2–4 once per deployment.

Set DEPLOYMENT_NAME to the chosen deployment (used by the specific-deployment selector and the restart/patch steps). Skip it when the user picked all. For P/D, also capture both role names — used in Step 4:

DEPLOYMENT_NAME=<chosen deployment>
# P/D only — read the two role deployment names from the Step 1 listing:
PREFILL_DEPLOYMENT=$(kubectl get deployments -n $NAMESPACE -l llm-d.ai/role=prefill -o jsonpath='{.items[0].metadata.name}')
DECODE_DEPLOYMENT=$(kubectl get deployments -n $NAMESPACE -l llm-d.ai/role=decode -o jsonpath='{.items[0].metadata.name}')

Read the full file on GitHub · 280 lines

Files

What ships with it

2 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. 12d ago First seen · 280 lines · 112 tokens per session scan C 79db4d63f5dc

Subscribe to this mod's changes

clear-kv-cache-tiers-in-llm-d-deployment is a skill published in the GitHub repository llm-d-incubation/llm-d-skills (6 stars, last pushed 29d ago), licensed Apache-2.0. It adds 112 tokens to every session and 5,234 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it C with 2 findings (recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

agent-platform-rag-engine-management

Manage and query Agent Platform RAG Engine Corpora and retrieve grounded contexts using the Google GenAI SDK. Use when listing RAG corpora or files, inspecting a corpus, retrieving contexts, or generating content grounded in a RAG corpus. Do not use for standard database queries (use SQL/Spanner skills), Google…

google/skills · 85 tokens

agent-platform-model-registry

Agent Platform Model Registry Management. Use when you need to upload, list, describe, update, or delete machine learning models (and their versions) in the Agent Platform Model Registry. Don't use for model training, model deployment to endpoints, or managing non-Agent Platform models.

google/skills · 60 tokens

foundry-config-setup

Resolve missing setup caused by a hardcoded Foundry project endpoint or model in a sample. Use when a sample fails because it uses a placeholder/hardcoded projectendpoint (for example "https://your-project.services.ai.azure.com") or a hardcoded model instead of reading them from the environment.

microsoft/agent-framework · 65 tokens

google-cloud-solution-agentic-analytics-spark-knowledge-catalog

Discovers requirements and generates guidance to design and deploy a governed, secure agentic-analytics solution for data that's distributed across Google Cloud, other cloud providers, or on-premises. Data that's outside Google Cloud (such as data from Databricks, Snowflake, Salesforce, SAP, or Oracle systems) is…

google/skills · 138 tokens

training-check

Interactively monitor training metrics from the current Codex session, periodically checking WandB or fallback logs for NaN, divergence, plateaus, and broken runs.

wanshuiyin/Auto-claude-code-research-in-sleep · 35 tokens

nemo-automodel-launcher-config

Configure NeMo AutoModel job launches for interactive runs, Slurm clusters, and SkyPilot cloud execution.

NVIDIA/skills · 30 tokens