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

#25950 [Bug]: Fireworks AI - cache_read_input_token_cost configured but not used in cost calculation

  • State: open
  • Author: @fabienbarbaud
  • Labels: bug, proxy

### Check for existing issues

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

### What happened?

### Bug Description

For Fireworks AI models, the `cache_read_input_token_cost` field is correctly loaded from `model_info` configuration (visible in `model_map_information`), but it is **not applied** in the actual cost calculation. All input tokens are charged at full `input_cost_per_token` price regardless of `cached_tokens` count.

### Expected Behavior

When `cached_tokens` > 0, the cost calculation should be: ``` input_cost = (prompt_tokens - cached_tokens) * input_cost_per_token + cached_tokens * cache_read_input_token_cost ```

### Actual Behavior

The `input_cost` is calculated as if all tokens were non-cached: ``` input_cost = prompt_tokens * input_cost_per_token ```

### Steps to Reproduce

1. Configure a Fireworks AI model with prompt caching enabled 2. Set `cache_read_input_token_cost` in `model_info` 3. Send a request with cache hits (verified by `cached_tokens` > 0 in response) 4. Observe `cost_breakdown.input_cost` ignores cached token pricing

### Configuration

```yaml model_list: - model_name: GLM-5p1 litellm_params: …

GitHub resolver

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

Refresh page
vote history (1 events)
#0 of 0 · 31d18h2m25s ago — entered · #import:https:::github.com:berriai:litellm post #2825
The CLI feature is harder because it requires designing and integrating a new user-facing command, defining input and output behavior, handling tokenizer/model edge cases, and adding broader tests and documentation. The pricing bug is comparatively narrower, centered on correcting an existing calculation path and validating provider-specific accounting.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search