Summary
When using LiteLLM proxy with Groq qwen/qwen3-32b, reasoning is missing in streaming responses when tools + tool_choice: auto are provided. Non‑streaming responses do include message.reasoning, and streaming without tools includes <think> tags.
Environment
- LiteLLM version: 1.81.3
- Provider: Groq
- Model:
qwen/qwen3-32b
- Proxy mode (OpenAI‑compatible)
Steps to reproduce
- Configure the model in LiteLLM with
reasoning_effort: "default" in litellm_params (and drop_params: true).
- Stream a chat completion with tools:
curl -s -H "Authorization: Bearer $LITELLM_KEY" \
-H "Content-Type: application/json" \
-d '{
"model":"<litellm_model_id>",
"messages":[{"role":"system","content":"You are a helpful assistant."},{"role":"user","content":"test"}],
"stream": true,
"tools":[{"type":"function","function":{"name":"noop","description":"noop","parameters":{"type":"object","properties":{},"additionalProperties":false}}}],
"tool_choice":"auto"
}' \
http://localhost:4000/v1/chat/completions
Actual
- Stream only emits content.
- No
<think> tags and no reasoning deltas.
completion_tokens_details.reasoning_tokens stays 0.
Expected
- Reasoning should be available during streaming (e.g., via
reasoning_content deltas), or at least surfaced consistently with non‑streaming responses.
Comparisons
- Non‑streaming with tools returns
message.reasoning for the same model.
- Streaming without tools returns
<think> tags in content.
Possible cause
GroqChatCompletionStreamingHandler inherits OpenAIChatCompletionStreamingHandler and doesn’t map Groq reasoning fields into reasoning_content (OpenRouter has explicit mapping). If Groq streams reasoning separately when tools are enabled, LiteLLM may be dropping it.
Summary
When using LiteLLM proxy with Groq
qwen/qwen3-32b, reasoning is missing in streaming responses whentools+tool_choice: autoare provided. Non‑streaming responses do includemessage.reasoning, and streaming without tools includes<think>tags.Environment
qwen/qwen3-32bSteps to reproduce
reasoning_effort: "default"inlitellm_params(anddrop_params: true).Actual
<think>tags and no reasoning deltas.completion_tokens_details.reasoning_tokensstays0.Expected
reasoning_contentdeltas), or at least surfaced consistently with non‑streaming responses.Comparisons
message.reasoningfor the same model.<think>tags in content.Possible cause
GroqChatCompletionStreamingHandlerinheritsOpenAIChatCompletionStreamingHandlerand doesn’t map Groqreasoningfields intoreasoning_content(OpenRouter has explicit mapping). If Groq streams reasoning separately when tools are enabled, LiteLLM may be dropping it.