litellm-rs: Skill for Claude Code

.claude/skills/caching-architecture/SKILL.md

caching-architecture is a skill for Claude Code from majiayu000/litellm-rs. It costs 98 tokens per session (1,875 once invoked), scanned A, original, MIT.

A guide to response caching in LiteLLM-RS, a Rust service that connects applications to language-model providers. It describes how identical non-streaming chat and embedding requests can reuse stored responses from memory or optional Redis storage.

In plain words
What is it for?
Use it when changing caching for chat completions or embeddings, adding cache administration, or reviewing cache lookup, storage, expiry, and statistics.
Why use it?
It helps avoid repeating the same provider requests and keeps cache keys, expiry, storage tiers, and request wiring consistent.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is majiayu000/litellm-rs's own configuration. It tells Claude Code how to work on litellm-rs itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything litellm-rs configures →

Reuse

Borrowing it

Nothing to install: this file belongs to majiayu000/litellm-rs. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/majiayu000/litellm-rs/main/.claude/skills/caching-architecture/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/majiayu000/litellm-rs

Made for: Claude Code.

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 caching-architecture

README.md
[![agentmods](https://agentmods.dev/badge/skills/majiayu000/litellm-rs/caching-architecture/github.svg)](https://agentmods.dev/skills/majiayu000/litellm-rs/caching-architecture)
Your own site
<a href="https://agentmods.dev/skills/majiayu000/litellm-rs/caching-architecture"><img src="https://agentmods.dev/badge/skills/majiayu000/litellm-rs/caching-architecture/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 caching-architecture

Your own site · 80×15
<a href="https://agentmods.dev/skills/majiayu000/litellm-rs/caching-architecture"><img src="https://agentmods.dev/badge/skills/majiayu000/litellm-rs/caching-architecture.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 98 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,875 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00098 $0.01875
Opus 5.5 $0.00039 $0.00750
Sonnet 5.5 $0.00020 $0.00375
Haiku 4.5 $0.00010 $0.00187

Measured 1mo ago against content hash 95abffd15ddc, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

caching-architecture 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 1mo 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.

.claude/skills/caching-architecture/SKILL.md · 132 lines

How it starts

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

Caching Architecture Guide

Overview

LiteLLM-RS ships exactly one wired caching subsystem: an exact-match response cache for non-streaming chat completions and embeddings. It is a two-tier read-through cache, not a three-tier stack — the former unwired semantic (vector) module has been removed from unreleased source.

Request (non-streaming /v1/chat/completions, /v1/embeddings)
     │ lookup_chat / lookup_embedding (src/server/routes/ai/response_cache.rs)
     ▼
┌────────────────────────────────────────────────────────────┐
│ LLMCache  (src/core/cache/llm_cache.rs)                    │
│   chat_cache:      DualCache<CachedChatResponse>           │
│   embedding_cache: DualCache<CachedEmbeddingResponse>      │
└────────────────────────────────────────────────────────────┘
     │ per-key get / set
     ▼
┌────────────────────────────────────────────────────────────┐
│ DualCache<T>  (src/core/cache/dual.rs)                     │
│   L1  InMemoryCache<T> — DashMap, TTL, sampled eviction    │
│   L2  RedisCache<T>    — optional, backed by RedisPool     │
│   Read: L1 miss → L2 hit → repopulate L1                   │
│   Write: both tiers; L2 failure logs a warning, not fatal  │
└────────────────────────────────────────────────────────────┘
     │ miss
     ▼
LLM Provider → response stored back into both tiers

What Is Wired vs Not

Capability Status
Exact-match response cache (chat + embeddings) Wired: AppState.response_cache, built by build_response_cache (src/server/state.rs:143)
Semantic similarity cache Removed: core::semantic_cache, cache.semantic_cache, and cache.similarity_threshold no longer exist in unreleased source; remove those config keys, including false/default values
Vector DB backends Storage-only: QdrantStore implemented; weaviate/pinecone declared but return "not implemented yet" (src/storage/vector/backend.rs:29). Nothing connects them to caching at runtime
Cloud object-storage caches core::cache::cloud (CloudCache trait; S3/GCS/Azure under feature s3) — not part of the request path

Read the full file on GitHub · 132 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. 1mo ago Changed · -2 lines 95abffd15ddc
  2. 2mo ago First seen · 134 lines · 98 tokens per session scan A c59cdb78fcf9

Subscribe to this mod's changes

caching-architecture is a skill published in the GitHub repository majiayu000/litellm-rs (123 stars, last pushed 2d ago), licensed MIT. It adds 98 tokens to every session and 1,875 once invoked, about $0.0004 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-08-30.

Related

caching-architecture compared with skills from other repositories

caching-architecture next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
caching-architecturemajiayu000/litellm-rsSkill1232d agoMITA98Claude Code
spring-cacheclaude-dev-suite/claude-dev-suiteSkill474d agoMITA114Claude Code
caching-strategiesclaude-dev-suite/claude-dev-suiteSkill474d agoMITA111Claude Code
redis-patternsRaNDoM6913/claude-code-superkitSkill3yesterdayMITA61Claude Code
caching-strategykhalilbenaz/claude-skills-collectionSkill272mo agoMITA103Claude Code, Codex
redis-patternskhalilbenaz/claude-skills-collectionSkill272mo agoMITA56Claude Code, Codex
caching-strategiesVersoXBT/claude-initial-setupSkill46mo agoMITA63Claude Code