7 views
-/https://github.com/berriai/litellm/issues/32045
GitHub · issue

#32045 [Bug]: Request log detail shows provider prompt-cache hits as Cache Hit: False and hides cached-token cost breakdown

  • State: open
  • Author: @WakeUp6xx
  • Labels: bug, ui-dashboard

### Check for existing issues

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

### What happened?

In the LiteLLM dashboard request log detail view, requests with non-zero provider prompt-cache tokens are currently displayed in a confusing and misleading way.

For example, the redacted request metadata contains:

- usage_object.prompt_tokens = 430798 - usage_object.completion_tokens = 47 - usage_object.prompt_tokens_details.cached_tokens = 430464 - model_map_value.input_cost_per_token = 5.9e-7 - model_map_value.cache_read_input_token_cost = 1.5e-7 - model_map_value.output_cost_per_token = 0.0000020699999999999997

The cost calculation itself appears correct, but the UI hides the cache-hit/cache-miss split and shows Cache Hit: False, even though cached_tokens > 0.

Current display:

```text Tokens: 430,845 (430,798 prompt tokens + 47 completion tokens) Cache Hit: False Input Cost: $0.06476666 (430,798 prompt tokens) Output Cost: $0.00009729 (47 completion tokens) Original LLM Cost: $0.06486395 ```

This makes users think provider prompt caching did not work, or that the request was billed incorrectly.

Expected display:

```text Tokens: 430,8…

GitHub resolver

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

Refresh page
vote history (2 events)
#0 of 0 · 31d18h14m59s ago — entered · #import:https:::github.com:berriai:litellm post #2608
The left requires coordinated dashboard data interpretation, conditional presentation, and regression coverage across token/cost paths; the right is a localized backend classification fix with focused tests.
#0 of 0 · 31d18h10m51s ago — current · #import:https:::github.com:berriai:litellm post #2678
The right-hand change is harder because it spans request-log data interpretation, cache-aware token and cost presentation, edge-case handling, and regression coverage. The left-hand change is comparatively localized to provider catalog/UI integration with limited behavioral risk.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search