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

#35229 [Bug]: Snowflake Claude provider drops cache_creation_input_tokens and cache_read_input_tokens from response usage

  • State: open
  • Author: @BizerNotNull
  • Labels: bug, SDK

### Check for existing issues

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

### What happened?

When using Snowflake as the provider, the usage field in the response does not contain cache-related fields.

It was found when I use litellm proxy, but the problem lies in the SDK.

The codes in `litellm/llms/snowflake/chat/transformation.py` 401-406 prove that the problem exists.

``` usage_data = response_json.get("usage", {}) usage = Usage( prompt_tokens=usage_data.get("input_tokens", 0), completion_tokens=usage_data.get("output_tokens", 0), total_tokens=usage_data.get("input_tokens", 0) + usage_data.get("output_tokens", 0), ) ```

### Steps to Reproduce

1. Use the configs for snowflake

``` - model_name: sf-claude-opus-4-5 litellm_params: model: snowflake/claude-opus-4-5 api_base: https://xxxx.snowflakecomputing.com/api/v2 api_key: pat/xxxx ```

2. Use the request body for proxy

``` { "cache_control": { "type": "ephemeral" }, "model": "sf-claude-opus-5", "max_tokens": 256, "messages": [ { "role": "user", "content": "longtext" } ], } ```

3. The responses usa…

GitHub resolver

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

Refresh page
vote history (1 events)
#0 of 0 · 31d18h7m34s ago — entered · #import:https:::github.com:berriai:litellm post #2718
Issue 31870 requires coordinated framework, configuration, and performance changes with broader compatibility and asynchronous regression testing; issue 35229 is a localized provider-response mapping fix with a narrower regression surface.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search