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

#30099 [Bug]: reasoning_tokens reported as 0 for redacted adaptive thinking (Claude Opus 4.7/4.8 on Vertex AI)

  • State: open
  • Author: @awschmeder
  • Labels: llm translation

## Summary

When Claude Opus 4.7 / 4.8 run with adaptive thinking (`thinking: {type: adaptive}` + `output_config: {effort: ...}`) on Vertex AI, the model performs extended thinking and Vertex reports the count in `usage.output_tokens_details.thinking_tokens`. However LiteLLM's response usage translation computes `reasoning_tokens` by counting tokens in the returned `reasoning_content` text. Opus 4.7/4.8 return a **redacted** thinking block (empty `thinking` text plus a `signature`), so the estimate is 0 and the OpenAI-shaped usage reports `completion_tokens_details.reasoning_tokens = 0` despite real reasoning having occurred.

This affects budget enforcement: LiteLLM miscalculates the true cost when billing thinking tokens, leading to incorrect spend tracking.

## Evidence

Raw Vertex response (abridged): ```json { "content": [ {"type": "thinking", "thinking": "", "signature": "Et0CCmUIDhAC..."}, {"type": "text", "text": "# Computing 17^23 mod 5 ..."} ], "usage": { "input_tokens": 25, "output_tokens": 577, "output_tokens_details": {"thinking_tokens": 125} } } ```

LiteLLM-translated usage (wrong): ``` completion_tokens=577, reasoning_tokens=0, text_token…

GitHub resolver

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

Refresh page
vote history (1 events)
#0 of 0 · 31d17h55m48s ago — entered · #import:https:::github.com:berriai:litellm post #3151
#33321 is harder because it spans several proxy authorization paths, requires consistent boundary semantics across scopes, and needs broad regression coverage; #30099 is comparatively localized to provider-response usage translation with a narrower compatibility fix.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search