Caching (LLM Caching)
Storing and reusing AI model responses for identical or semantically similar inputs to reduce latency and cost. Exact-match caching returns stored responses when the same prompt is received again. Semantic caching uses embeddings to match similar (but not identical) queries to cached responses. LLM caching can reduce inference costs by 30–60% for agents that handle repetitive queries—common in support, FAQ, and classification workloads.
Example
A support agent receives 50 variations of 'how do I reset my password?' per day. Semantic caching recognizes these as equivalent and returns the cached response instantly—saving 50 LLM calls and reducing response time from 2 seconds to under 100ms.
Frequently asked questions
- When should you NOT cache LLM responses?
- Avoid caching when the response depends on real-time data (account status, inventory levels), when personalization matters (the response should differ per user), or when the task requires reasoning over unique inputs (code review, contract analysis). Cache static, factual, and repetitive responses.