16 views
-/https://github.com/berriai/litellm/issues/26326
GitHub · issue

#26326 [Bug]: Fireworks AI streaming responses leak `<think>` tags into `content` instead of populating `reasoning_content`

  • State: open
  • Author: @anuragrao04
  • Labels: bug, proxy, llm translation

### Check for existing issues

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

### What happened?

When using Fireworks AI models that emit reasoning via `<think>...</think>` tags (e.g. `kimi-k2.5`, `qwen3`), the streaming response leaks the raw tags into the `content` field of each delta chunk. The `reasoning_content` field on the delta is never populated.

**Expected:** `delta.reasoning_content` contains the thinking text, `delta.content` contains only the final answer — matching the behaviour of DeepSeek and Ollama providers.

**Actual:** `delta.content` contains `<think>...thinking text...</think>answer` as a single stream. Clients (Open WebUI, coding agents, etc.) render the raw XML tags as visible text.

Note: **non-streaming** responses are also affected — `message.content` contains the raw `<think>` block instead of it being split into `message.reasoning_content`.

## Root cause

`FireworksAIConfig` inherits `get_model_response_iterator` from `OpenAIGPTConfig`, which returns a plain `OpenAIChatCompletionStreamingHandler`. That handler has no `<think>` tag awareness and passes `content` through unchanged.

By contrast, `OllamaConfig`…

GitHub resolver

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

Refresh page
vote history (1 events)
#0 of 0 · 31d18h17m23s ago — entered · #import:https:::github.com:berriai:litellm post #2653
#26326 requires coordinated streaming and non-streaming translation changes, stateful tag parsing across chunk boundaries, provider-specific handler behavior, and compatibility tests. #34228 appears more localized to response-shape normalization, though it may require preserving multiple turns and tool-call semantics. The former carries greater cross-path regression risk.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search