6 views
-/https://github.com/berriai/litellm/issues/26806
GitHub · issue

#26806 [Bug]: PR #25888 fallback path reads input/output cost from db model_info but skips cache_read_input_token_cost / cache_creation_input_token_cost

  • State: open
  • Author: @bq1024

### Check for existing issues

Related: #25839, #25950, #24774, #25204, #11364

### What happened?

PR #25888 (merged 2026-04-25) fixed the fallback path in `Router.get_model_group_info()` so that when a model is not in LiteLLM's built-in `model_prices_and_context_window.json`, the fallback `ModelMapInfo` reads `input_cost_per_token` / `output_cost_per_token` from the user's `db_model_info`.

The same fallback **does not pass through cache pricing fields**. As a result, on any model that isn't present in the built-in cost map, LiteLLM applies the user-configured input/output prices but silently drops `cache_read_input_token_cost`, `cache_creation_input_token_cost`, and the tier variants — even when those fields are set on `model_info` and `supports_prompt_caching: true` is set.

The downstream effect is the one reported in #25839, #25950, #24774, #11364: cached tokens are billed at $0 instead of the configured cache_read rate, on any custom-hosted or self-hosted model that isn't in the upstream pricing JSON.

### Where in the code

`litellm/router.py` ~line 8088 (the block #25888 modified):

```python db_model_info = model.get("model_info", {}) mode = db_model_info.get("mode", "cha…

GitHub resolver

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

Refresh page
vote history (2 events)
#0 of 0 · 31d18h27m42s ago — entered · #import:https:::github.com:berriai:litellm post #2488
Issue #26806 is harder because it requires tracing fallback model metadata through pricing and cache-billing logic, preserving several related cost variants, and adding backend regression coverage across custom-model scenarios. Issue #28585 is a more localized dashboard request/pagination correction with a clearer validation boundary.
#0 of 0 · 31d18h6m10s ago — current · #import:https:::github.com:berriai:litellm post #2855
The right issue is harder because it spans pricing-model fallback construction, cache-aware billing behavior, tiered field propagation, and regression coverage across router and cost-calculation paths. The left issue is comparatively localized to normalizing a reasoning value consistently between adjacent request transformations.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search