[GH-ISSUE #12593] <think> tags omitted from qwen3 models #70416

Closed
opened 2026-05-04 21:27:52 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @dovvnloading on GitHub (Oct 13, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/12593

What is the issue?

Im noticing across multiple applications I've built that the reasoning COT is not showing up in the output after the most recent update.

This issue has occurred a few weeks back and was fixed—Now its back again! This time I havent seen anyone else talking about it... yet.

Relevant log output

N/A

OS

Windows

GPU

Nvidia

CPU

AMD

Ollama version

No response

Originally created by @dovvnloading on GitHub (Oct 13, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/12593 ### What is the issue? Im noticing across multiple applications I've built that the reasoning COT is not showing up in the output after the most recent update. This issue has occurred a few weeks back and was fixed—Now its back again! This time I havent seen anyone else talking about it... yet. ### Relevant log output ```shell N/A ``` ### OS Windows ### GPU Nvidia ### CPU AMD ### Ollama version _No response_
GiteaMirror added the bug label 2026-05-04 21:27:52 -05:00
Author
Owner

@rick-github commented on GitHub (Oct 13, 2025):

0.12.5 automatically enables thinking for thinking-capable models if not set in the API call, which means that the thinking output is in the thinking field and no longer in the response field.

0.12.0:

$ curl -s localhost:11434/api/generate -d '{"model":"qwen3:4b","prompt":"hello","stream":false}' | jq "del(.context)"
{
  "model": "qwen3:4b",
  "created_at": "2025-10-13T11:02:46.789762108Z",
  "response": "<think>\nOkay, the user said \"hello\". I need to respond appropriately. Let me think.\n\nFirst, \"hello\" is a greeting, so I should respond in a friendly and welcoming way. Maybe start with a simple \"Hello! How can I assist you today?\" That sounds good.\n\nWait, I should check if there's any context I'm missing. The user just said \"hello\", so probably no prior context. I don't want to assume anything else.\n\nAlso, make sure the response is in English since the user wrote in English. The user might be testing if I can handle basic greetings.\n\nI should keep it concise but friendly. Maybe add a smiley emoji to make it warmer. Like \"😊 Hello! How can I assist you today?\"\n\nYes, that's a good response. Let me confirm there's no need for more complex language here. The user is just greeting, so a simple reply is best.\n\nNo need to overcomplicate. Just a standard greeting response. Alright, I think that's it.\n</think>\n\nHello! 😊 How can I assist you today?",
  "done": true,
  "done_reason": "stop",
  "total_duration": 3841130075,
  "load_duration": 1739744011,
  "prompt_eval_count": 9,
  "prompt_eval_duration": 328424659,
  "eval_count": 223,
  "eval_duration": 1770720349
}

0.12.5 without setting think:

$ curl -s localhost:11434/api/generate -d '{"model":"qwen3:4b","prompt":"hello","stream":false}' | jq "del(.context)"
{
  "model": "qwen3:4b",
  "created_at": "2025-10-13T11:02:09.409154003Z",
  "response": "Hello! 😊 How can I help you today?",
  "thinking": "Okay, the user said \"hello\". I need to respond in a friendly and helpful way. Let me think about how to structure this.\n\nFirst, I should greet them back. Maybe something like \"Hello! How can I help you today?\" That's standard but friendly.\n\nWait, maybe they want to start a conversation. I should keep it open-ended so they can ask anything. Let me check if there's a specific context here. The user just said \"hello\", so no prior context.\n\nHmm, should I add an emoji to make it more friendly? Like a smiley. But maybe not too many. A single one might be good. Like 😊.\n\nLet me put it all together: \"Hello! 😊 How can I help you today?\"\n\nThat sounds good. It's friendly, opens the door for them to ask questions, and the emoji adds a bit of warmth without being over the top.\n\nWait, the user might be testing if I'm working. But since they just said hello, the response should be straightforward. No need to overcomplicate.\n\nI think that's a solid response. Let me make sure there's no cultural issues with the emoji. In most contexts, 😊 is safe and friendly.\n\nYeah, this should work. Let me write that response.\n",
  "done": true,
  "done_reason": "stop",
  "total_duration": 2199099381,
  "load_duration": 130160524,
  "prompt_eval_count": 9,
  "prompt_eval_duration": 20935795,
  "eval_count": 277,
  "eval_duration": 1980005069
}

0.12.5 setting think to false:

$ curl -s localhost:11434/api/generate -d '{"model":"qwen3:4b","prompt":"hello","think":false,"stream":false}' | jq "del(.context)"
{
  "model": "qwen3:4b",
  "created_at": "2025-10-13T11:05:40.064833812Z",
  "response": "<think>\nOkay, the user said \"hello\". I need to respond appropriately. Let me think.\n\nFirst, I should greet them back. Since it's a simple hello, maybe a friendly and welcoming response. I should check if they need help or have a question.\n\nWait, the user might be testing if I'm working. So I should be polite and offer assistance.\n\nLet me draft a response: \"Hello! How can I assist you today?\"\n\nYes, that's good. It's friendly and opens the door for them to ask questions or get help.\n\nI should make sure there's no markdown. Just plain text.\n\nLet me confirm: The user said \"hello\", so the response should be in English. The previous instructions said to respond in the same language as the user. The user wrote in English, so respond in English.\n\nNo need for extra formatting. Just the greeting and offer of help.\n\nDouble-checking: The response should be concise but helpful. \"Hello! How can I assist you today?\" is perfect.\n\nNo markdown, so just the text.\n\nAlright, that's the response.\n</think>\n\nHello! How can I assist you today? 😊",
  "done": true,
  "done_reason": "stop",
  "total_duration": 3011915665,
  "load_duration": 1267803776,
  "prompt_eval_count": 9,
  "prompt_eval_duration": 15115860,
  "eval_count": 237,
  "eval_duration": 1678421088
}
<!-- gh-comment-id:3397038469 --> @rick-github commented on GitHub (Oct 13, 2025): 0.12.5 automatically enables thinking for thinking-capable models if not set in the API call, which means that the thinking output is in the `thinking` field and no longer in the `response` field. 0.12.0: ```console $ curl -s localhost:11434/api/generate -d '{"model":"qwen3:4b","prompt":"hello","stream":false}' | jq "del(.context)" { "model": "qwen3:4b", "created_at": "2025-10-13T11:02:46.789762108Z", "response": "<think>\nOkay, the user said \"hello\". I need to respond appropriately. Let me think.\n\nFirst, \"hello\" is a greeting, so I should respond in a friendly and welcoming way. Maybe start with a simple \"Hello! How can I assist you today?\" That sounds good.\n\nWait, I should check if there's any context I'm missing. The user just said \"hello\", so probably no prior context. I don't want to assume anything else.\n\nAlso, make sure the response is in English since the user wrote in English. The user might be testing if I can handle basic greetings.\n\nI should keep it concise but friendly. Maybe add a smiley emoji to make it warmer. Like \"😊 Hello! How can I assist you today?\"\n\nYes, that's a good response. Let me confirm there's no need for more complex language here. The user is just greeting, so a simple reply is best.\n\nNo need to overcomplicate. Just a standard greeting response. Alright, I think that's it.\n</think>\n\nHello! 😊 How can I assist you today?", "done": true, "done_reason": "stop", "total_duration": 3841130075, "load_duration": 1739744011, "prompt_eval_count": 9, "prompt_eval_duration": 328424659, "eval_count": 223, "eval_duration": 1770720349 } ``` 0.12.5 without setting `think`: ```console $ curl -s localhost:11434/api/generate -d '{"model":"qwen3:4b","prompt":"hello","stream":false}' | jq "del(.context)" { "model": "qwen3:4b", "created_at": "2025-10-13T11:02:09.409154003Z", "response": "Hello! 😊 How can I help you today?", "thinking": "Okay, the user said \"hello\". I need to respond in a friendly and helpful way. Let me think about how to structure this.\n\nFirst, I should greet them back. Maybe something like \"Hello! How can I help you today?\" That's standard but friendly.\n\nWait, maybe they want to start a conversation. I should keep it open-ended so they can ask anything. Let me check if there's a specific context here. The user just said \"hello\", so no prior context.\n\nHmm, should I add an emoji to make it more friendly? Like a smiley. But maybe not too many. A single one might be good. Like 😊.\n\nLet me put it all together: \"Hello! 😊 How can I help you today?\"\n\nThat sounds good. It's friendly, opens the door for them to ask questions, and the emoji adds a bit of warmth without being over the top.\n\nWait, the user might be testing if I'm working. But since they just said hello, the response should be straightforward. No need to overcomplicate.\n\nI think that's a solid response. Let me make sure there's no cultural issues with the emoji. In most contexts, 😊 is safe and friendly.\n\nYeah, this should work. Let me write that response.\n", "done": true, "done_reason": "stop", "total_duration": 2199099381, "load_duration": 130160524, "prompt_eval_count": 9, "prompt_eval_duration": 20935795, "eval_count": 277, "eval_duration": 1980005069 } ``` 0.12.5 setting `think` to false: ```console $ curl -s localhost:11434/api/generate -d '{"model":"qwen3:4b","prompt":"hello","think":false,"stream":false}' | jq "del(.context)" { "model": "qwen3:4b", "created_at": "2025-10-13T11:05:40.064833812Z", "response": "<think>\nOkay, the user said \"hello\". I need to respond appropriately. Let me think.\n\nFirst, I should greet them back. Since it's a simple hello, maybe a friendly and welcoming response. I should check if they need help or have a question.\n\nWait, the user might be testing if I'm working. So I should be polite and offer assistance.\n\nLet me draft a response: \"Hello! How can I assist you today?\"\n\nYes, that's good. It's friendly and opens the door for them to ask questions or get help.\n\nI should make sure there's no markdown. Just plain text.\n\nLet me confirm: The user said \"hello\", so the response should be in English. The previous instructions said to respond in the same language as the user. The user wrote in English, so respond in English.\n\nNo need for extra formatting. Just the greeting and offer of help.\n\nDouble-checking: The response should be concise but helpful. \"Hello! How can I assist you today?\" is perfect.\n\nNo markdown, so just the text.\n\nAlright, that's the response.\n</think>\n\nHello! How can I assist you today? 😊", "done": true, "done_reason": "stop", "total_duration": 3011915665, "load_duration": 1267803776, "prompt_eval_count": 9, "prompt_eval_duration": 15115860, "eval_count": 237, "eval_duration": 1678421088 } ```
Author
Owner

@dovvnloading commented on GitHub (Oct 13, 2025):

0.12.5 automatically enables thinking for thinking-capable models if not set in the API call, which means that the thinking output is in the thinking field and no longer in the response field.

0.12.0:

$ curl -s localhost:11434/api/generate -d '{"model":"qwen3:4b","prompt":"hello","stream":false}' | jq "del(.context)"
{
"model": "qwen3:4b",
"created_at": "2025-10-13T11:02:46.789762108Z",
"response": "\nOkay, the user said "hello". I need to respond appropriately. Let me think.\n\nFirst, "hello" is a greeting, so I should respond in a friendly and welcoming way. Maybe start with a simple "Hello! How can I assist you today?" That sounds good.\n\nWait, I should check if there's any context I'm missing. The user just said "hello", so probably no prior context. I don't want to assume anything else.\n\nAlso, make sure the response is in English since the user wrote in English. The user might be testing if I can handle basic greetings.\n\nI should keep it concise but friendly. Maybe add a smiley emoji to make it warmer. Like "😊 Hello! How can I assist you today?"\n\nYes, that's a good response. Let me confirm there's no need for more complex language here. The user is just greeting, so a simple reply is best.\n\nNo need to overcomplicate. Just a standard greeting response. Alright, I think that's it.\n\n\nHello! 😊 How can I assist you today?",
"done": true,
"done_reason": "stop",
"total_duration": 3841130075,
"load_duration": 1739744011,
"prompt_eval_count": 9,
"prompt_eval_duration": 328424659,
"eval_count": 223,
"eval_duration": 1770720349
}
0.12.5 without setting think:

$ curl -s localhost:11434/api/generate -d '{"model":"qwen3:4b","prompt":"hello","stream":false}' | jq "del(.context)"
{
"model": "qwen3:4b",
"created_at": "2025-10-13T11:02:09.409154003Z",
"response": "Hello! 😊 How can I help you today?",
"thinking": "Okay, the user said "hello". I need to respond in a friendly and helpful way. Let me think about how to structure this.\n\nFirst, I should greet them back. Maybe something like "Hello! How can I help you today?" That's standard but friendly.\n\nWait, maybe they want to start a conversation. I should keep it open-ended so they can ask anything. Let me check if there's a specific context here. The user just said "hello", so no prior context.\n\nHmm, should I add an emoji to make it more friendly? Like a smiley. But maybe not too many. A single one might be good. Like 😊.\n\nLet me put it all together: "Hello! 😊 How can I help you today?"\n\nThat sounds good. It's friendly, opens the door for them to ask questions, and the emoji adds a bit of warmth without being over the top.\n\nWait, the user might be testing if I'm working. But since they just said hello, the response should be straightforward. No need to overcomplicate.\n\nI think that's a solid response. Let me make sure there's no cultural issues with the emoji. In most contexts, 😊 is safe and friendly.\n\nYeah, this should work. Let me write that response.\n",
"done": true,
"done_reason": "stop",
"total_duration": 2199099381,
"load_duration": 130160524,
"prompt_eval_count": 9,
"prompt_eval_duration": 20935795,
"eval_count": 277,
"eval_duration": 1980005069
}
0.12.5 setting think to false:

$ curl -s localhost:11434/api/generate -d '{"model":"qwen3:4b","prompt":"hello","think":false,"stream":false}' | jq "del(.context)"
{
"model": "qwen3:4b",
"created_at": "2025-10-13T11:05:40.064833812Z",
"response": "\nOkay, the user said "hello". I need to respond appropriately. Let me think.\n\nFirst, I should greet them back. Since it's a simple hello, maybe a friendly and welcoming response. I should check if they need help or have a question.\n\nWait, the user might be testing if I'm working. So I should be polite and offer assistance.\n\nLet me draft a response: "Hello! How can I assist you today?"\n\nYes, that's good. It's friendly and opens the door for them to ask questions or get help.\n\nI should make sure there's no markdown. Just plain text.\n\nLet me confirm: The user said "hello", so the response should be in English. The previous instructions said to respond in the same language as the user. The user wrote in English, so respond in English.\n\nNo need for extra formatting. Just the greeting and offer of help.\n\nDouble-checking: The response should be concise but helpful. "Hello! How can I assist you today?" is perfect.\n\nNo markdown, so just the text.\n\nAlright, that's the response.\n\n\nHello! How can I assist you today? 😊",
"done": true,
"done_reason": "stop",
"total_duration": 3011915665,
"load_duration": 1267803776,
"prompt_eval_count": 9,
"prompt_eval_duration": 15115860,
"eval_count": 237,
"eval_duration": 1678421088
}


Thanks for pointing that out! I changed the code around and it worked based on your highlight


            # CORRECTED LOGIC
            message_obj = response.get('message', {})
            main_content = message_obj.get('content', '')
            thinking_content = message_obj.get('thinking') # <-- THIS IS THE FIX

            final_answer, thoughts, commands = self._parse_and_clean_response(main_content, thinking_content)
            return self._format_response(final_answer), thoughts, commands
<!-- gh-comment-id:3397132152 --> @dovvnloading commented on GitHub (Oct 13, 2025): > 0.12.5 automatically enables thinking for thinking-capable models if not set in the API call, which means that the thinking output is in the `thinking` field and no longer in the `response` field. > > 0.12.0: > > $ curl -s localhost:11434/api/generate -d '{"model":"qwen3:4b","prompt":"hello","stream":false}' | jq "del(.context)" > { > "model": "qwen3:4b", > "created_at": "2025-10-13T11:02:46.789762108Z", > "response": "<think>\nOkay, the user said \"hello\". I need to respond appropriately. Let me think.\n\nFirst, \"hello\" is a greeting, so I should respond in a friendly and welcoming way. Maybe start with a simple \"Hello! How can I assist you today?\" That sounds good.\n\nWait, I should check if there's any context I'm missing. The user just said \"hello\", so probably no prior context. I don't want to assume anything else.\n\nAlso, make sure the response is in English since the user wrote in English. The user might be testing if I can handle basic greetings.\n\nI should keep it concise but friendly. Maybe add a smiley emoji to make it warmer. Like \"😊 Hello! How can I assist you today?\"\n\nYes, that's a good response. Let me confirm there's no need for more complex language here. The user is just greeting, so a simple reply is best.\n\nNo need to overcomplicate. Just a standard greeting response. Alright, I think that's it.\n</think>\n\nHello! 😊 How can I assist you today?", > "done": true, > "done_reason": "stop", > "total_duration": 3841130075, > "load_duration": 1739744011, > "prompt_eval_count": 9, > "prompt_eval_duration": 328424659, > "eval_count": 223, > "eval_duration": 1770720349 > } > 0.12.5 without setting `think`: > > $ curl -s localhost:11434/api/generate -d '{"model":"qwen3:4b","prompt":"hello","stream":false}' | jq "del(.context)" > { > "model": "qwen3:4b", > "created_at": "2025-10-13T11:02:09.409154003Z", > "response": "Hello! 😊 How can I help you today?", > "thinking": "Okay, the user said \"hello\". I need to respond in a friendly and helpful way. Let me think about how to structure this.\n\nFirst, I should greet them back. Maybe something like \"Hello! How can I help you today?\" That's standard but friendly.\n\nWait, maybe they want to start a conversation. I should keep it open-ended so they can ask anything. Let me check if there's a specific context here. The user just said \"hello\", so no prior context.\n\nHmm, should I add an emoji to make it more friendly? Like a smiley. But maybe not too many. A single one might be good. Like 😊.\n\nLet me put it all together: \"Hello! 😊 How can I help you today?\"\n\nThat sounds good. It's friendly, opens the door for them to ask questions, and the emoji adds a bit of warmth without being over the top.\n\nWait, the user might be testing if I'm working. But since they just said hello, the response should be straightforward. No need to overcomplicate.\n\nI think that's a solid response. Let me make sure there's no cultural issues with the emoji. In most contexts, 😊 is safe and friendly.\n\nYeah, this should work. Let me write that response.\n", > "done": true, > "done_reason": "stop", > "total_duration": 2199099381, > "load_duration": 130160524, > "prompt_eval_count": 9, > "prompt_eval_duration": 20935795, > "eval_count": 277, > "eval_duration": 1980005069 > } > 0.12.5 setting `think` to false: > > $ curl -s localhost:11434/api/generate -d '{"model":"qwen3:4b","prompt":"hello","think":false,"stream":false}' | jq "del(.context)" > { > "model": "qwen3:4b", > "created_at": "2025-10-13T11:05:40.064833812Z", > "response": "<think>\nOkay, the user said \"hello\". I need to respond appropriately. Let me think.\n\nFirst, I should greet them back. Since it's a simple hello, maybe a friendly and welcoming response. I should check if they need help or have a question.\n\nWait, the user might be testing if I'm working. So I should be polite and offer assistance.\n\nLet me draft a response: \"Hello! How can I assist you today?\"\n\nYes, that's good. It's friendly and opens the door for them to ask questions or get help.\n\nI should make sure there's no markdown. Just plain text.\n\nLet me confirm: The user said \"hello\", so the response should be in English. The previous instructions said to respond in the same language as the user. The user wrote in English, so respond in English.\n\nNo need for extra formatting. Just the greeting and offer of help.\n\nDouble-checking: The response should be concise but helpful. \"Hello! How can I assist you today?\" is perfect.\n\nNo markdown, so just the text.\n\nAlright, that's the response.\n</think>\n\nHello! How can I assist you today? 😊", > "done": true, > "done_reason": "stop", > "total_duration": 3011915665, > "load_duration": 1267803776, > "prompt_eval_count": 9, > "prompt_eval_duration": 15115860, > "eval_count": 237, > "eval_duration": 1678421088 > } --- Thanks for pointing that out! I changed the code around and it worked based on your highlight ``` # CORRECTED LOGIC message_obj = response.get('message', {}) main_content = message_obj.get('content', '') thinking_content = message_obj.get('thinking') # <-- THIS IS THE FIX final_answer, thoughts, commands = self._parse_and_clean_response(main_content, thinking_content) return self._format_response(final_answer), thoughts, commands ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#70416