8 views
-/https://github.com/berriai/litellm/issues/31936
GitHub · issue

#31936 [Bug]: Cache Analytics dashboard cards show 0 for provider prompt caching (reads wrong fields — `cache_hit_true_rows`/`cached_completion_tokens` instead of `cache_read_input_tokens`)

  • State: open
  • Author: @SEZ9
  • Labels: bug, llm translation, ui-dashboard

### Check for existing issues

- [x] I have searched the existing issues and checked that my issue is not a duplicate.

### What happened?

On the **Cache Analytics** page (AI Gateway → Cache), the three summary cards **Cache Hit Ratio**, **Cache Hits**, and **Cached Tokens** all display **0 / 0.00%**, even though provider-side prompt caching (Bedrock, OpenAI Responses API) is working correctly and the cache tokens are recorded end-to-end.

The backend aggregated endpoint returns the correct value, but the frontend cards read **different fields** that are only populated for LiteLLM's own response cache (redis/in-memory), not for provider prompt caching. So for anyone using Bedrock/OpenAI **prompt caching** (as opposed to LiteLLM response caching), these cards are permanently 0.

Notably, the **charts below the cards on the same page do render data** (they group by endpoint and pick up the usage), which makes the contrast obvious: the data is present, only the summary cards fail to read it.

### Evidence

**1. The data is correct all the way through the DB and API.**

`GET /user/daily/activity/aggregated?start_date=...&end_date=...&model=bedrock_mantle/openai.gpt-5.5` returns:

```…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 · 31d17h58m51s ago — entered · #import:https:::github.com:berriai:litellm post #2876
Issue 25669 is harder because it spans core message sanitization, provider translation, multi-turn state handling, and compatibility-focused testing. Issue 31936 is mainly a localized dashboard field-mapping correction with comparatively limited scope and risk.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search