Skills for Real Engineers. Straight from my .agents directory.
llm-caching
Agent skill fromBagelHole/DevOps-Security-Agent-Skills
Implement multi-layer LLM caching with exact match, semantic similarity, and provider-side prompt caching. Reduce API costs by 30–70%, cut latency, and improve throughput using Redis, GPTCache, and provider caching APIs.
How to install llm-caching
npx skills add BagelHole/DevOps-Security-Agent-Skills# or add only this skill to Claude Code: copy the folder
devops/ai/llm-caching/
# into
~/.claude/skills/llm-caching/ (all projects)
.claude/skills/llm-caching/ (one project)
1# LLM Caching23Cut LLM costs and latency with exact match, semantic, and provider-side caching layers.45## When to Use This Skill67Use this skill when:8- The same or similar queries are asked repeatedly (FAQ bots, support tools)9- LLM API costs are growing and you need immediate savings10- Serving high request volumes where repeated queries cause bottlenecks11- Implementing prompt caching for long system prompts (Anthropic/OpenAI)12- Building offline-capable AI features that need response persistence1314## Caching Layers1516```17Request → Exact Cache → Semantic Cache → Provider Cache → LLM API18 ↓ hit ↓ hit ↓ hit19 instant ~5ms 50-80% cheaper20```2122## Layer 1: Exact Match Cache (Redis)2324```python25import hashlib26import json27import redis28from openai import OpenAI2930r = redis.Redis(host="localhost", port=6379, decode_responses=True)31client = OpenAI()3233def build_cache_key(model: str, messages: list, temperature: float) -> str:34 """Deterministic key from request parameters."""35 payload = json.dumps({36 "model": model,37 "messages": messages,38 "temperature": temperature,39 }, sort_keys=True)40 return f"llm:exact:{hashlib.sha256(payload.encode()).hexdigest()}"4142def cached_completion(model: str, messages: list, temperature: float = 0.0,43 ttl: int = 3600) -> dict:44 key = build_cache_key(model, messages, temperature)4546 # Check cache47 if cached := r.get(key):48…
Excerpt shown under the repository's MIT license.
More skills in DevOps-Security-Agent-Skills
Similar skill repositories
An agentic skills framework & software development methodology that works.
A single CLAUDE.md file to improve Claude Code behavior, derived from Andrej Karpathy's observations on LLM coding pitfalls.
Public repository for Agent Skills
Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Production-grade engineering skills for AI coding agents.
