QwQ-32B doesn't stream properly in case of the <think> tag

Hi, I’m reaching out because the QwQ-32B model doesn’t stream properly in case of the <think> tag.
Many frontend chat clients expect the server (when a thinking model is used) to stream the <think> tag in the beginning chunk of the sse response,
so that the client can display it in a different way to the user.
But your server returns the </think> tag only in the last chunk of the thinking process,
the first chunk which should contain the <think> tag is missing.

I’ve attached the code to reproduce the issue. However the problem only occurs when the model is QwQ-32B. DeepSeek-R1 works fine.

curl -H "Authorization: Bearer <key>" \
     -H "Content-Type: application/json" \
     -d '{
        "stream": true,
        "model": "QwQ-32B",
        "messages": [
                {
                        "role": "system",
                        "content": "You are a helpful assistant"
                },
                {
                        "role": "user",
                        "content": "Why is the sky blue? Answer in one sentence."
                }
        ]
        }' \
     -X POST https://api.sambanova.ai/v1/chat/completions

And the response is:

data: {"choices":[{"delta":{"content":"","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796264,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796264,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"Okay, ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796264,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"the user is asking why the ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796264,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"sky ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796264,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"is blue, ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796264,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"and they ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796264,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"want the answer in one ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796264,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"sentence. Let ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796264,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"me ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796264,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"recall what I know ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796264,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"about ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796264,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"this. The ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796264,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"sky appears blue ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796264,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"because ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796264,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"of ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796264,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"Rayleigh ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796264,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"scattering. ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796264,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"Sunlight ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796264,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"reaches Earth's ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796264,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"atmosphere and is ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796264,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"scattered in all directions ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796264,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"by ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796264,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"gases ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796264,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"and particles. ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796264,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"The ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796264,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"shorter ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796264,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"wavelengths, like ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796264,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"blue and ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796264,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"violet, ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796264,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"scatter ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796264,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"more. ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"But ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"wait, ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"why ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"don't we ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"see ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"violet ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"then? ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"Oh right, ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"because our eyes ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"are more sensitive ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"to ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"blue ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"and ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"the ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"sun emits more blue light. ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"So ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"the ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"main reason ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"is the scattering ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"of sunlight ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"by ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"the atmosphere, ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"which scatters blue ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"light ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"more. ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"Need ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"to ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"phrase ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"that ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"concisely. Maybe: \"The sky appears ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"blue due ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"to Rayleigh ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"scattering, where ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"shorter ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"blue ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"light wavelengths are scattered more ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"by ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"the atmosphere, ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"making the sky appear ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"blue ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"to ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"observers.\" Let me check if ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"that's ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"accurate ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"and within one ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"sentence. Yep, ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"that ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"should work.\n","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"\u003c/think\u003e\n\n","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"The sky appears blue ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"because shorter ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"blue and violet ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"light wavelengths are scattered more by ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"the ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"atmosphere, and our eyes are more ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"sensitive to ","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"blue light.","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":"","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: {"choices":[{"delta":{"content":""},"finish_reason":"stop","index":0,"logprobs":null}],"created":1741796265,"id":"855da38c-117a-403c-b6d4-ed073dde1baf","model":"QwQ-32B","object":"chat.completion.chunk","system_fingerprint":"fastcoe"}

data: [DONE]
1 Like

@orsonvale Thank you for joining the community and for bringing this to our attention. I will duplicate it and engage back end engineering as required.

-Coby

Hey there - this is actually expected behavior from QwQ 32B Model

If you checked the chat template the authors don’t have in the beginning and only add it at the end of reasoning tokens. So you should always assume that anything before tag is reasoning tokens.

Check the official documentations of QwQ for more details: