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.
curl -O https://raw.githubusercontent.com/majiayu000/litellm-rs/main/.claude/skills/caching-architecture/SKILL.mdgit clone --depth 1 https://github.com/majiayu000/litellm-rsWrote 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.
[](https://agentmods.dev/skills/majiayu000/litellm-rs/caching-architecture)<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.
<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>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once 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 |
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.
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 |
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.
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.
- 1mo ago Changed · -2 lines 95abffd15ddc
- 2mo ago First seen · 134 lines · 98 tokens per session scan A c59cdb78fcf9
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.
caching-architecture compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| caching-architecturemajiayu000/litellm-rs | Skill | 123 | 2d ago | MIT | A | 98 | Claude Code |
| spring-cacheclaude-dev-suite/claude-dev-suite | Skill | 47 | 4d ago | MIT | A | 114 | Claude Code |
| caching-strategiesclaude-dev-suite/claude-dev-suite | Skill | 47 | 4d ago | MIT | A | 111 | Claude Code |
| redis-patternsRaNDoM6913/claude-code-superkit | Skill | 3 | yesterday | MIT | A | 61 | Claude Code |
| caching-strategykhalilbenaz/claude-skills-collection | Skill | 27 | 2mo ago | MIT | A | 103 | Claude Code, Codex |
| redis-patternskhalilbenaz/claude-skills-collection | Skill | 27 | 2mo ago | MIT | A | 56 | Claude Code, Codex |
| caching-strategiesVersoXBT/claude-initial-setup | Skill | 4 | 6mo ago | MIT | A | 63 | Claude Code |