Caching the LLM Stack: Where Valkey Fits To Cut Latency and Cost
summary
BetterDB reports 300,000 cache lookups across ~600 deployments with 74,000 hits out of 300,000 lookups, estimating saved ~16 hours of latency and $20–25k across five months. The stack is layered: admission control, exact-match GET/SET, an embedding cache, Valkey Search semantic cache with tenant/category/model filters, KV offload, and observability via distance histograms and shadow sampling. Semantic caching uses per-category thresholds and two confidence bands plus hit checks for dates/numbers to avoid false positives.
AI-written summary · about
chapters (14)
- 0:00Thirty years of trying not to do work twice
- 1:21How much LLM work is redundant
- 3:09What BetterDB's deployments show
- 5:19There is no single LLM cache
- 7:03Admission control: token budgets, rate limits, retry storms
- 8:04Exact-match caching
- 11:27The embedding cache most people forget
- 12:26Semantic caching with Valkey Search
- 14:24Why one similarity threshold can't win
- 17:17Per-category thresholds, confidence bands, and hit checks
- 18:46Agent memory: short-term, working, and long-term
- 20:59KV cache offload
- 21:27Observability for LLM caches
- 24:30Where to start
