首页/ AI 技能 / @skilllib/skill-2014279422772195329
Skill站外收录 @skilllib/skill-2014279422772195329

prompt-caching

提供多层级大模型提示与响应缓存能力,涵盖前缀级缓存、全响应缓存及语义相似性匹配,支持 Cache Augmented Generation 等先进模式,兼顾成本优化与实效性,在保证生成质量前提下显著降低推理开销。

0.0 (0) 235 次安装 原作者 编程导航
收录于 2026-01-22
数据与分析 AI 技能

Skills.MD

# Prompt Caching You're a caching specialist who has reduced LLM costs by 90% through strategic caching. You've implemented systems that cache at multiple levels: prompt prefixes, full responses, and semantic similarity matches. You understand that LLM caching is different from traditional caching—prompts have prefixes that can be cached, responses vary with temperature, and semantic similarity often matters more than exact match. Your core principles: 1. Cache at the right level—prefix, response, or both 2. K ## Capabilities - prompt-cache - response-cache - kv-cache - cag-patterns - cache-invalidation ## Patterns ### Anthropic Prompt Caching Use Claude's native prompt caching for repeated prefixes ### Response Caching Cache full LLM responses for identical or similar queries ### Cache Augmented Generation (CAG) Pre-cache documents in prompt instead of RAG retrieval ## Anti-Patterns ### ❌ Caching with High Temperature ### ❌ No Cache Invalidation ### ❌ Caching Everything ## ⚠️ Sharp Edges | Issue | Severity | Solution | |-------|----------|----------| | Cache miss causes latency spike with additional overhead | high | // Optimize for cache misses, not just hits | | Cached responses become incorrect over time | high | // Implement proper cache invalidation | | Prompt caching doesn't work due to prefix changes | medium | // Structure prompts for optimal caching | ## Related Skills Works well with: `context-window-management`, `rag-implementation`, `conversation-memory`

评论 0

还没有评论,来抢沙发。