Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

llm-caching

Skill by sickn33

Implements multi-layer LLM caching with exact match, semantic similarity, and provider-side prompt caching. Aimed at teams that want to cut repeated LLM API costs and latency.

  • Score 88
  • 50k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install llm-caching

Built from the published package, never by AI.

git clone --depth 1 https://github.com/sickn33/agentic-awesome-skills /tmp/agentic-awesome-skills && mkdir -p ~/.claude/skills && cp -r /tmp/agentic-awesome-skills/skills/llm-caching ~/.claude/skills/llm-caching

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install llm-caching in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

This skill explains how to cut LLM costs and latency by adding caching layers in front of an LLM API. It covers an exact match cache built on Redis, a semantic cache that matches similar queries using embeddings, and provider-side prompt caching for Anthropic and OpenAI. Requests pass through the layers in order, and a hit at any layer skips the LLM call.

The skill also covers a gateway-level semantic cache option, cache warming, and Prometheus metrics for hit and savings tracking. It stresses that cache keys must include tenant or user scope, model, prompts and parameters, because similar queries should not share privileged answers. It is written for developers and platform teams running AI features at high request volume. The source is documentation only, with helper scripts and templates not bundled.

Written from the project's SKILL.md and checked against it.

What it can do

  • Exact match cacheRedis cache keyed by a hash of model, messages, and temperature.
  • Semantic cacheEmbedding-based lookup in Qdrant with a similarity threshold, plus a GPTCache example.
  • Gateway semantic cacheDescribes caching at the gateway level with LiteLLM cache or Bifrost's semantic_cache plugin.
  • Provider prompt cachingShows Anthropic cache_control blocks and OpenAI automatic prefix caching.
  • Cache warmingPre-populates the cache with frequent queries on startup.
  • Cache metricsPrometheus counters for cache hits, misses, and estimated savings.
  • Redis tuningredis.conf settings for maxmemory and allkeys-lru eviction.

What you need

  • Python
  • Redis
  • Qdrant for the semantic cache examples
  • OpenAI API key or Anthropic API key
  • Sentence-transformers embedding model for the custom semantic cache

Try asking

  • Add an exact match Redis cache in front of my OpenAI chat calls.
  • Set up Anthropic prompt caching for a long system prompt.
  • Show me how to track LLM cache hits and savings with Prometheus.

Good to know

  • Similarity thresholds, latencies and savings are examples, not calibrated guarantees.
  • Hashing prompts is not encryption, so stored queries and results need restriction or encryption.
  • Temperature 0 does not guarantee deterministic output.
  • Cache warming is paid generation and needs bounded concurrency and budget.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: skills/llm-caching/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md13 KB

Alternatives to llm-caching

All alternatives →

Compare with agent-reproduce-align, google_contacts or m06-error-handling

llm-caching: common questions

Can the semantic cache return the same answer to different users?

The source says not to serve a privileged cached answer across users just because queries are similar. Cache entries should be partitioned by tenant or user access scope.

Does OpenAI prompt caching need code changes?

The source says OpenAI caches repeated prefixes of at least 1,024 tokens automatically, with no code change needed.

Which cache layers does this skill cover?

It covers an exact match Redis cache, a semantic similarity cache using Qdrant or GPTCache, and provider-side prompt caching for Anthropic and OpenAI.

How do I install llm-caching?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is llm-caching free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is llm-caching safe to use?

It scores 88 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to llm-caching?

Similar skills: agent-reproduce-align, google_contacts, m06-error-handling, caveman.

llm-caching Install

Add to stack

Loading.