Home / Companies / Braintrust / Blog / Post Details
Content Deep Dive

LLM gateway caching: how it works and when to use it

Blog post from Braintrust

Post Details
Company
Date Published
Author
Braintrust Team
Word Count
1,512
Company Posts That Month
26
Language
English
Hacker News Points
-
Post removed?
No
Summary

LLM gateway caching can reduce model costs and latency by serving reusable responses or prompt computations before a full generation is required, with savings determined by cache hit rates, bypassed token volume, and expiration settings. Exact-match caching returns a complete stored response only when request content, model, and generation parameters match, making it suited to deterministic prompts, evaluations, CI runs, and repeated API requests; Braintrust Gateway provides this approach with configurable modes, TTLs, cache-status headers, encryption, and optional sharing controls. Semantic caching uses embeddings and similarity thresholds to reuse answers for paraphrased requests, potentially increasing hit rates but introducing a risk of incorrect matches and requiring supporting embedding and vector-store infrastructure. Provider prompt caching instead reuses computation for repeated prompt prefixes while still processing variable input and generating new output, reducing input costs without eliminating output-token charges. Selecting a method depends on whether requests, meanings, or prompt prefixes repeat, while volatile information such as prices, inventory, permissions, and account state requires short TTLs or cache bypasses. Effective production use also depends on including current context in requests, evaluating cache behavior before deployment, monitoring stale or inaccurate responses after launch, and distinguishing cached responses from fresh model generations.

Trends Found in this Post
Trend Post Mentions Total Month Mentions Posts Companies MoM
LLM 13 5,068 1,020 229 -34%
Vector Search 6 2,358 371 127 +5%
Observability 1 3,175 737 186 -24%
Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.