Skip to main content
LiteLLM

AI GATEWAY / OBSERVABILITY

Prompt Caching Alerts

Find the models that need attention.

2 low-cache models · 1 regressionCache read / input tokensMODELHIT RATE0%50%100%Google Geminidocument-agentLow cache3.0%OpenAIrepo-assistantLow cache14.6%Anthropicsupport-agentDrop48.1%Amazon Bedrockknowledge-search65.4%20% alert thresholdUSAGE / PROMPT CACHINGILLUSTRATIVE MODEL USAGE
2 low-cache models · 1 regressionGoogle Geminidocument-agent3.0%OpenAIrepo-assistant14.6%Anthropicsupport-agent48.1%65.7 pp dropAmazon Bedrockknowledge-search65.4%20% alert threshold0%100%ILLUSTRATIVE MODEL USAGE

Your agent can keep returning answers while you pay to reprocess its shared prompt prefix. Across several models, a healthy fleet average can hide one deployment with low cache reuse.

Prompt Caching Alerts in LiteLLM put model cache hit rates, daily trends, and low-cache warnings on the Usage page. Open a flagged model to inspect its recorded usage and available virtual keys, then check your provider's caching requirements.

Release availability

Available from source on LiteLLM main after PR #55251. Check the release notes before upgrading a packaged deployment.

Who is this for?​

AI platform teams operating LiteLLM AI Gateway across several models and providers. If you maintain an agent with shared system prompts or tool definitions, use this view to check its cache reuse.

The problem​

You ship a new prompt template, move an agent to another model, or add dynamic context ahead of a shared prefix. Requests still succeed. Cache reuse can fall while your uncached input volume rises.

Use individual responses to debug a request. To compare a model across two weeks of traffic, you need a view of its cache-read share over time.

In the demo below, document-agent has low reuse from its first active days. For support-agent, daily cache share falls from 82% to 14%. Its average across the selected period is 48.1%, but its later-half hit rate is 65.7 percentage points below the earlier half. Inspect the model's callers to investigate that change.

Prompt Caching tab showing low-hit-rate models, a newly active model, a regression, and daily cache trends

Actual LiteLLM components with 14 days of synthetic usage. Model aliases and amounts are examples. Framed in Xnapper.

View full size.

Use LiteLLM AI Gateway to find cache regressions​

Open Usage and choose a date range​

Start on Usage → Overview. The warning lists models below the low-cache threshold or with a hit-rate drop. Select Open Prompt Caching to compare them.

The Prompt Caching tab shows cached input share, flagged models, uncached prompt tokens, and estimated missed savings. Switch between model groups and models to match the view you use to operate the gateway.

Hit rate means cache-read input tokens divided by total prompt tokens. A model with 800,000 cached input tokens out of 1 million prompt tokens has an 80% hit rate. This is a token-weighted measure, not the share of requests with any cache hit.

Set a threshold and compare models​

The low-cache threshold starts at 20%. Drag the threshold control on the model chart, or choose a preset above the tab. The chart colors, warning chips, and flagged count update together. The threshold applies to the current page session and resets on reload.

Use Flagged to narrow the table, then compare the daily trend. LiteLLM flags a regression when cache read share drops by at least 20 percentage points between the earlier and later halves of the selected data window, with usage in both halves. A regression can remain flagged even when its overall hit rate exceeds the low-cache threshold.

New identifies models first active near the end of the selected usage window. It does not mean the provider released a new model.

The same prompt caching charts after raising the low-cache threshold to 40 percent

At 40%, the demo's 35% code-review model falls below the cutoff. The 48.1% support-agent stays flagged for its regression.

View full size.

Inspect a model and its callers​

Select a model bar, warning chip, table row, or Inspect. The popup shows cache-read share, cache-write tokens, request count, and available virtual keys ranked by uncached input volume.

Model popup with recorded cache usage, available virtual key aliases, and a link to prompt caching setup docs

Inspect the same demo model before changing its application or deployment. The daily API caps the available key breakdown to highest-spend keys, so this is not an exhaustive caller list.

View full size.

Use the key aliases to find the application owner. Check whether the application reuses a stable prefix, meets the provider's minimum input length, and uses the right cache configuration for its model. The popup links to the prompt caching setup docs.

After making a change, return to the same model and inspect subsequent daily usage. Compare cache-read share and uncached token volume over a period with enough traffic for your workload.

Read the numbers in context​

These are dashboard warnings based on recorded daily usage in the selected range. This feature does not send Slack or email notifications. LiteLLM needs recorded cache-token metrics to show the analysis; missing provider metrics can limit what you see.

Estimated missed savings uses the gateway's observed blended net cache-savings rate. Use it to prioritize investigation. It is not a quote or a guarantee that every uncached token can be cached.

Key takeaways​

  • Compare cache-read share per model instead of relying on a fleet average.
  • Review low-cache models and regressions, then inspect available callers.
  • Verify provider requirements before changing your application or deployment.

FAQ​

Does a low hit rate prove caching is misconfigured?​

No. Short prompts, changing prefixes, traffic patterns, and provider requirements can affect reuse. The tab shows measured usage; it does not inspect deployment settings or diagnose a root cause.

Do these alerts change requests or enable caching?​

The tab helps you investigate recorded usage. It does not change routing, add cache directives, or modify requests.

Does this require LiteLLM Enterprise?​

The tab has no additional Enterprise license requirement. Existing gateway permissions determine the usage you can see. Check release availability above before upgrading.

Start with a model that changed​

Use the next prompt or model rollout as a checkpoint. Compare its cache-read share and uncached input volume before and after the change.

For help operating your production AI Gateway, talk to the LiteLLM team.