Data as of Aug 25, 2026 · Based on 271 AI responses from ChatGPT Search and Google AI Mode · See how Parse measures this
To reduce token costs, you should choose between native vendor caching for static prompts and semantic caching for varied user inputs. Use built-in features from providers like OpenAI,
Anthropic, or Google Gemini for repetitive prompt prefixes. For conversational applications where users rephrase the same intent, use semantic caching tools such as
or AI gateways like Bifrost or LiteLLM to identify and serve cached similar responses.
Brands AI recommends here
Named in 54% of answers
An open-source library that uses vector search to identify and cache semantically similar user queries. It is ideal for developers building chatbots who want to significantly cut costs by matching unique questions to cached answers.
Named in 49% of answers
Named in 35% of answers
Named in 34% of answers
Yes. There are two different caching layers worth separating: - **Prompt/prefix caching:** avoids re-processing repeated input tokens, but the LLM still runs and generates a response. - **Semantic/response caching:** recognizes that a new request is sufficiently similar to a previous request and returns the cached…
Yes. There are two different caching layers worth separating:
| Vendor / tool | Exact-match | Semantic | Managed | Self-hosted | Particularly useful for |
|---|---|---|---|---|---|
| Redis LangCache | ✅ | ✅ | ✅ | Via Redis | Dedicated semantic caching |
| Portkey | ✅ | ✅ | ✅ | ✅ | AI gateway + caching + routing |
| Helicone | ✅ | ✅ | ✅ | ✅ | Observability + gateway caching |
| GPTCache / Zilliz | ✅ | ✅ | ❌ | ✅ | Maximum customization / OSS |
| Upstash Semantic Cache | — | ✅ | ✅ | ❌ | Serverless / edge applications |
| TrueFoundry AI Gateway | ✅ | ✅ | ✅ | ✅ | Enterprise gateway + caching |
| LiteLLM | ✅ | Via integrations | — | ✅ | Multi-model gateway, routing, cost controls |
| Cloudflare AI Gateway | ✅ | Limited | ✅ | — | Edge gateway and straightforward response caching |
| LangChain cache integrations | ✅ | ✅ via backends | Depends | Depends | Existing LangChain applications |
Redis's LangCache is particularly interesting if your primary objective is semantic caching rather than building the machinery yourself: it handles embeddings and returns cached responses without invoking the LLM on a semantic hit.
TrueFoundry similarly distinguishes gateway caching from provider prompt caching: semantic/exact cache hits can eliminate the model invocation entirely, whereas provider prompt caching merely reduces the cost of processing repeated input.
You should also look at the LLM providers themselves before buying a caching layer.
Amazon Bedrock, for example, supports prompt caching for multiple models and says it can reduce costs by up to 90% for supported workloads. It caches reusable prompt prefixes rather than complete responses.
This is complementary to semantic caching. A useful architecture can therefore be:
Application → semantic cache → LLM gateway → provider prompt cache → model
A semantic hit skips everything downstream. A semantic miss can still benefit from provider-level prompt caching.
If your goal is specifically reducing the LLM bill, I'd shortlist:
There's also a useful distinction in the economics: exact-match caching is almost risk-free but has limited hit rate; semantic caching can have a dramatically higher hit rate but introduces the risk of returning an inappropriate cached answer. You therefore need similarity thresholds, namespace/user isolation, TTLs, and ideally cacheability rules for dynamic or personalized queries.
If you tell me your LLM providers (OpenAI/Anthropic/Gemini/etc.), approximate requests/month, average input/output tokens, and whether you're already using Redis/LangChain/LiteLLM, I can narrow this down to the 2–3 options most likely to produce meaningful savings and estimate the potential ROI.
Amazon Bedrock, for example, supports prompt caching for multiple models and says it can reduce costs by up to 90% for supported workloads. It caches reusable prompt prefixes rather than complete responses.
This is complementary to semantic caching. A useful architecture can therefore be:
Application → semantic cache → LLM gateway → provider prompt cache → model
A semantic hit skips everything downstream. A semantic miss can still benefit from provider-level prompt caching.
Optimizing token usage via caching generally splits into two categories: **Exact Prompt Caching** (native features offered directly by model providers for stable input prefixes) and **Semantic Caching** (using vector similarity to catch paraphrased or similar user queries and bypass LLM inference…
Optimizing token usage via caching generally splits into two categories: Exact Prompt Caching (native features offered directly by model providers for stable input prefixes) and Semantic Caching (using vector similarity to catch paraphrased or similar user queries and bypass LLM inference entirely).
Before building an external semantic caching layer, you can leverage native infrastructure from model providers that discount or cache repeated stable input tokens (like large system prompts, few-shot examples, or long documents).
If you want to build custom semantic caching inside your application code using vector embeddings and similarity thresholds:
If you route your LLM traffic through an infrastructure proxy or gateway, semantic caching is often available out-of-the-box as a configuration toggle or plugin:
Many engineering teams choose to build lightweight custom semantic caches using high-performance data stores that support vector indexing:
[Query Embedding] -> [LLM Response] , utilizing a threshold proximity score to decide whether a query is a "hit" or a "miss".If you'd like to narrow this down, tell me:
I can recommend a precise implementation path or architecture pattern.
Optimizing token usage through caching is one of the most effective ways to slash LLM inference bills and latency . Solutions generally fall into three buckets: **LLM Gateways/Proxies** (easiest drop-in setup), **Managed Database & Vector Layers** (infrastructure-level), and **Open-Source Libraries** (custom…
Optimizing token usage through caching is one of the most effective ways to slash LLM inference bills and latency . Solutions generally fall into three buckets: LLM Gateways/Proxies (easiest drop-in setup), Managed Database & Vector Layers (infrastructure-level), and Open-Source Libraries (custom implementation).
These tools sit between your application and the LLM providers (OpenAI, Anthropic, etc.), offering configuration-driven exact and semantic caching out of the box.
If you manage your own data infrastructure or want a managed service provider to handle the vector math for semantic similarity lookups.
If you prefer managing the caching logic within your own codebase without routing traffic through a third-party gateway.
If you can share which LLM providers you are using (e.g., OpenAI, Anthropic) and whether your app is stateless or uses RAG/Agents , I can recommend the most seamless integration path for your stack.
If your goal is to reduce LLM token spend, there are two main caching approaches: 1. **Provider-side prompt/context caching** — reuses identical prompt prefixes or context blocks (useful for long system prompts, documents, agent context). 2. **Application-level response caching / semantic caching** — avoids the LLM…
If your goal is to reduce LLM token spend, there are two main caching approaches:
Here are the main vendors and tools to evaluate:
| Vendor / Tool | Cache type | Best fit |
|---|---|---|
| Redis LangCache | Semantic response caching | Production AI apps needing managed semantic caching |
| Upstash Semantic Cache | Semantic caching | Serverless apps, edge workloads, TypeScript stacks |
| GPTCache | Exact + semantic caching | Teams wanting self-hosted control |
| Portkey | Gateway + caching | Enterprises needing routing, governance, observability |
| Helicone | Gateway caching + analytics | Teams already focused on LLM monitoring |
| LiteLLM | Proxy-level caching | Multi-model environments (OpenAI, Anthropic, Gemini, local models) |
| Cloudflare AI Gateway | Mostly exact/request caching | Low-friction edge deployments |
| LangChain cache integrations | Framework-level caching | Existing LangChain applications |
Parse Vercel## Shortlist by scenario
Redis LangCache
Good for:
GPTCache
Upstash Semantic Cache
Portkey or LiteLLM
Useful if you have many teams or multiple LLM providers.
For long prompts, many teams combine semantic caching with provider prompt caching:
They solve different problems and are often complementary.
When comparing vendors, measure:
For many production teams, a practical starting shortlist is:
For reducing LLM token costs, you’ll usually want to evaluate **two different caching layers**: 1. **Provider prompt/token caching** — reduces the cost of repeatedly sending the same large prompt context (system prompts, documents, tool definitions, etc.). 2. **Application-level response caching / semantic caching** —…
For reducing LLM token costs, you’ll usually want to evaluate two different caching layers:
Here are the main vendors and tools in this space:
| Provider / Tool | Type | Exact response cache | Semantic cache | Best fit |
|---|---|---|---|---|
| Redis (LangCache / RedisVL) | Managed + self-hosted | Yes | Yes | Production AI apps, RAG, agents |
| Helicone | AI gateway + observability | Yes | Limited/through integrations | Teams wanting caching + monitoring |
| GPTCache | Open-source library | Yes | Yes | Self-hosted semantic caching |
| LangChain caching integrations | Framework layer | Yes | Yes | Apps already using LangChain |
| Portkey | AI gateway | Yes | Yes | Enterprise gateway approach |
| Upstash | Serverless Redis/vector services | Yes | Yes | Serverless applications |
| LlamaIndex | RAG framework | Yes | Via integrations | Document-heavy AI apps |
A strong managed option if your goal is production cost reduction. It stores prior LLM responses and uses semantic similarity to reuse answers for similar queries. It provides cache management, TTL/eviction controls, and monitoring.
Good for:
An open-source semantic cache layer. It supports embedding-based similarity matching and multiple storage backends.
Good for:
Useful for serverless architectures where you want a managed Redis/vector-style backend without running infrastructure.
Provides:
Its response cache can return previously generated responses instead of making another model call.
Good for:
AI gateway approach:
Good for enterprise deployments with multiple model vendors.
Supports:
Good if your application is already built on LangChain.
Useful for RAG-heavy systems where caching can apply to:
Major model providers increasingly offer prompt/context caching:
These reduce input token processing costs, while semantic caches reduce the number of LLM calls entirely.
A common production stack looks like:
User request
|
v
Semantic cache (Redis / GPTCache / gateway)
|
| cache miss
v
Prompt cache (OpenAI / Anthropic / Gemini)
|
v
LLM API
|
v
Store response + embedding
For many companies, the biggest savings come from combining:
If you share your stack (OpenAI vs Anthropic vs Gemini, RAG vs chatbot vs agents, request volume, and whether you need self-hosted), I can narrow this to a shortlist.
Optimizing token usage via caching is one of the highest-leverage ways to cut LLM inference costs . Solutions generally fall into three categories: **AI Gateways** (infrastructure proxies handling routing and caching globally), **Open-Source Libraries** (embedded directly into application code), and **Database/Vector…
Optimizing token usage via caching is one of the highest-leverage ways to cut LLM inference costs . Solutions generally fall into three categories: AI Gateways (infrastructure proxies handling routing and caching globally), Open-Source Libraries (embedded directly into application code), and Database/Vector Layers (infrastructure you manage yourself).
Gateways sit between your application and LLM providers (OpenAI, Anthropic, etc.), intercepting traffic to apply caching, rate-limiting, and fallbacks transparently.
If you prefer an in-code approach rather than routing traffic through a separate gateway proxy, these libraries can be integrated directly into your application logic.
RedisSemanticCache or integrations with SQLite/Postgres/PGVector) that you can drop straight into your chains or agent loops.If you are building custom caching logic or want database-native vector search to handle proximity matching:
To help narrow down the best fit, tell me:
Yes. The market has split into **three different caching layers**, and it’s worth distinguishing them before choosing a vendor: 1. **Provider prompt/prefix caching** — avoids recomputing repeated prompt prefixes. 2. **Exact-response caching** — identical request → return the previous response without calling the LLM.
Yes. The market has split into three different caching layers, and it’s worth distinguishing them before choosing a vendor:
For reducing actual API token spend, #2 and especially #3 are usually the most interesting. Provider-side prompt caching is also valuable, but it generally discounts/reduces the cost of repeated input tokens rather than eliminating the model call.
| Tool | Exact cache | Semantic cache | Deployment | Best fit |
|---|---|---|---|---|
| Redis LangCache | ✅ | ✅ | Managed | Dedicated semantic caching |
| Portkey | ✅ | ✅ | Managed/self-hosted | Enterprise AI gateway + caching |
| Helicone | ✅ | ✅ | Managed/self-hosted | Caching + observability |
| GPTCache | ✅ | ✅ | OSS/self-hosted | Build-your-own semantic cache |
| LiteLLM | ✅ | Custom/integrations | OSS/self-hosted | Gateway, routing + cost controls |
| Cloudflare AI Gateway | ✅ | Limited/expanding | Managed edge | Very easy exact-response caching |
| Upstash Semantic Cache | — | ✅ | Managed | Serverless/TypeScript workloads |
| LangChain cache integrations | ✅ | ✅ via backends | Framework | Teams already using LangChain |
| Bifrost | ✅ | ✅ | OSS/self-hosted | High-performance gateway |
| Future AGI | ✅ | ✅ | Cloud/self-hosted | More sophisticated semantic-cache controls |
Redis is particularly interesting because LangCache is purpose-built as a managed semantic-cache service, rather than merely being a Redis database that you have to assemble into a cache yourself.
If your primary goal is token-cost reduction:
1. Redis LangCache — probably where I'd start for a dedicated semantic-cache evaluation. It gives you a managed semantic-cache layer without having to build the embedding → similarity search → cache-hit pipeline yourself.
2. Portkey — compelling if caching is only one part of a broader LLM infrastructure strategy. It combines gateway functionality with routing, retries, budgets, observability and caching.
3. GPTCache — good if you want maximum control and are comfortable operating the infrastructure. It's specifically designed around LLM response caching and can use embeddings/similarity search for semantic hits.
4. LiteLLM — particularly attractive if you also want a self-hosted gateway to standardize access to OpenAI, Anthropic, Gemini, local models, etc. Its caching story is more "assemble/configure the pieces" than a dedicated semantic-cache product.
5. Cloudflare AI Gateway — excellent for exact-match caching with minimal infrastructure. As of June 2026, its documented standard response cache is based on identical requests; Cloudflare says semantic caching is planned rather than being the primary current caching mechanism.
If you're using OpenAI/Anthropic/etc., you should evaluate native prompt caching before adding another caching layer. Prefix caching can reuse large, stable system prompts, tool definitions and conversation context. Cloudflare's current documentation, for example, notes that providers including Anthropic and OpenAI support this model of caching.
The important distinction is:
Prompt caching
large repeated prompt → cheaper processing
versus
Semantic caching
"How do I reset my password?" → cached answer
"What's the process for resetting my password?" → same cached answer
The second can eliminate the LLM call altogether, which is potentially a much larger cost reduction.
For a production application, I'd seriously consider a layered approach:
Application → Semantic Cache → LLM Gateway → Provider
with:
The key metric isn't simply "cache hit rate." You want to measure:
LLM calls avoided × average uncached cost
and separately:
cached input tokens × prompt-cache discount
because a 30% semantic hit rate can be enormously valuable for an expensive agent workload but almost irrelevant for a workload where responses are highly unique.
If you tell me your current stack (e.g. OpenAI/Anthropic, Python/Node, LangChain/LlamaIndex/direct SDK, cloud/self-hosted) and roughly monthly LLM spend, I can narrow this to the 3–4 caching products I'd actually evaluate, including architecture, pricing model, cache-hit considerations, and estimated savings.
Optimizing token spend through caching falls into three categories: **native provider prompt caching** (cheapest and lowest-risk for static prefixes), **AI gateways/proxies** (easy drop-in layers with exact/semantic matching), and **infrastructure libraries/databases** (for custom…
Optimizing token spend through caching falls into three categories: native provider prompt caching (cheapest and lowest-risk for static prefixes), AI gateways/proxies (easy drop-in layers with exact/semantic matching), and infrastructure libraries/databases (for custom codebases).
Before adding external tools, make sure you take advantage of native prompt caching if you reuse large system prompts, reference documents, or multi-turn chat histories. They cut input costs on the static prefix by up to 90%.
These sit between your application and LLM providers, intercepting requests to handle exact hashing and vector-based semantic similarity routing without changing your application core logic.
If you manage your own data infrastructure or run high-scale distributed caching, you can use specialized vector database features or dedicated caching layers.
RedisSemanticCache ) allow you to build low-latency semantic caches directly in Redis.To help narrow down the best fit, tell me:
Optimizing token costs via caching typically involves three architectural layers: **AI Gateways** (drop-in proxy layers with built-in semantic caching), **Database/Vector Vendors** (infrastructure that lets you build your own semantic cache), and **Open-Source Libraries/Frameworks** (code-level…
Optimizing token costs via caching typically involves three architectural layers: AI Gateways (drop-in proxy layers with built-in semantic caching), Database/Vector Vendors (infrastructure that lets you build your own semantic cache), and Open-Source Libraries/Frameworks (code-level implementations).
The primary providers and tools available for LLM exact-match and semantic caching are organized below by category:
AI Gateways & Proxies (Built-in Semantic Caching)
Database & Vector Infrastructure (Managed Semantic Caches)
Open-Source Libraries & Frameworks
RedisSemanticCache or in-memory equivalents) that can be injected globally into application chains to store and retrieve responses based on semantic similarity.If you can share your current tech stack (e.g., whether you use Python/Go, LangChain, or a specific cloud provider) and your anticipated traffic volume , I can help recommend which caching approach fits your architecture best.
Zep
zep.com
Yes. There are two different categories worth separating: 1. **Provider-native prompt caching** — reuses the same token prefix/context and gives you a discounted input-token rate. 2. **Application/semantic caching** — sits in front of the LLM and returns a previous response when a new request is identical or…
Yes. There are two different categories worth separating:
| Tool / provider | Type | Best fit | Notes |
|---|---|---|---|
| OpenAI | Native prompt caching | OpenAI-heavy workloads | Automatic caching of repeated prompt prefixes; discounted cached input tokens. openai.com |
| Anthropic | Native prompt caching | Claude workloads | Explicit cache-control for reusable context; useful for long system prompts, tools, and documents. |
| Google Gemini | Native context caching | Gemini workloads | Useful for repeatedly reused large contexts. |
| Redis / RedisVL | Semantic + exact cache | Teams already using Redis | SemanticCache combines vector similarity with Redis infrastructure. blog.thnkandgrow.com |
| GPTCache | Open-source semantic cache | Build-your-own / self-hosting | Provider-agnostic; supports embeddings and multiple vector stores. blog.thnkandgrow.com |
| LangChain | Framework caching | Existing LangChain apps | Has semantic-similarity cache abstractions and integrations with vector stores. blog.thnkandgrow.com |
| LlamaIndex | Framework caching | RAG/LlamaIndex applications | Includes semantic caching components. blog.thnkandgrow.com |
| Upstash | Managed/serverless semantic cache | Serverless applications | Particularly attractive if you want managed infrastructure rather than running Redis yourself. blog.thnkandgrow.com |
| Portkey | LLM gateway + caching | Multi-provider production stacks | Gateway approach can put caching, routing and observability in one layer. blog.thnkandgrow.com |
| LiteLLM | LLM gateway + caching | Multi-model infrastructure | Useful when you already have a gateway layer and want caching alongside routing. |
| Helicone | Gateway/observability + caching | Teams wanting analytics | Combines caching with LLM observability. blog.thnkandgrow.com |
| PromptCacheAI | Managed exact + semantic cache | Drop-in application caching | Sits before OpenAI/Claude/Gemini/custom models and supports exact and semantic matching. prompt-cache.ai |
| Envoy AI Gateway | Gateway-level prompt caching | Kubernetes/cloud infrastructure | Provider-agnostic interface for provider-native prompt caching. aigateway.envoyproxy.io |
Suppose users ask:
"How do I reset my password?"
and later:
"What's the process for resetting my password?"
Native prompt caching generally won't treat those as the same request. It is primarily about reusing the same prompt prefix/context.
A semantic cache can recognize that the two requests have similar intent and potentially return the first response without making another LLM call. That's a much bigger potential cost reduction, but it introduces the risk of false cache hits—serving an answer that is similar but not actually appropriate. Recent research specifically highlights this as a security/reliability concern for semantic caches.
For a serious cost-optimization program, I'd use both layers:
Application
│
▼
Semantic / exact response cache
│ cache hit → return response ($0 LLM tokens)
│
▼
LLM gateway
│
▼
Provider-native prompt cache
│ cache hit → discounted input tokens
│
▼
LLM
This gives you:
There is good evidence that provider-native caching can produce substantial savings for agentic workloads: a 2026 evaluation across OpenAI, Anthropic and Google found 45–80% API-cost reductions under its tested caching strategies.
If you're evaluating vendors, I'd shortlist Redis/RedisVL, GPTCache, Portkey, LiteLLM, Helicone, Upstash, and PromptCacheAI, then compare them on cache-hit rate, semantic false-hit rate, latency, TTL/eviction controls, multi-provider support, and—most importantly—whether the cache itself costs enough to erase the token savings.
If you tell me your stack (e.g. OpenAI/Anthropic/Gemini + Python/Node + Redis/AWS/GCP/Azure), I can narrow this to the 3–5 strongest options and compare pricing/architecture.