[GH-ISSUE #10473] Add support for enable_thinking=True #6887

Closed
opened 2026-04-12 18:45:12 -05:00 by GiteaMirror · 9 comments
Owner

Originally created by @lknik on GitHub (Apr 29, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/10473

In Qwen3, enable_thinking=True disables the part. It would be useful to allow its use in programmatic calls, without the need to include it in the prompt.

Specifically, I would suggest:

  1. Having a command line switch
  2. CLI command
  3. Make the examples below working:
import openai

client = openai.OpenAI( ... )

response = client.chat.completions.create(
    model="qwen3",
    messages=[{"role": "user", "content": "Hello"}],
    extra_body={"options": {"enable_thinking": False}}
)
import ollama

response = ollama.chat(
    model='qwen3',
    messages=[{'role': 'user', 'content': 'Hello'}],
    options={'enable_thinking': False}
)

Originally created by @lknik on GitHub (Apr 29, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/10473 In Qwen3, enable_thinking=True disables the <think> part. It would be useful to allow its use in programmatic calls, without the need to include it in the prompt. Specifically, I would suggest: 1) Having a command line switch 2) CLI command 3) Make the examples below working: ``` import openai client = openai.OpenAI( ... ) response = client.chat.completions.create( model="qwen3", messages=[{"role": "user", "content": "Hello"}], extra_body={"options": {"enable_thinking": False}} ) ``` ``` import ollama response = ollama.chat( model='qwen3', messages=[{'role': 'user', 'content': 'Hello'}], options={'enable_thinking': False} ) ```
GiteaMirror added the feature request label 2026-04-12 18:45:12 -05:00
Author
Owner

@hchasens commented on GitHub (Apr 29, 2025):

proper API support would be great.

<!-- gh-comment-id:2839148083 --> @hchasens commented on GitHub (Apr 29, 2025): proper API support would be great.
Author
Owner

@defaultsecurity commented on GitHub (May 12, 2025):

Yes, please allow this option.

<!-- gh-comment-id:2873934058 --> @defaultsecurity commented on GitHub (May 12, 2025): Yes, please allow this option.
Author
Owner

@rick-github commented on GitHub (May 30, 2025):

https://github.com/ollama/ollama/releases/tag/v0.9.0

<!-- gh-comment-id:2921919466 --> @rick-github commented on GitHub (May 30, 2025): https://github.com/ollama/ollama/releases/tag/v0.9.0
Author
Owner

@lknik commented on GitHub (Jun 2, 2025):

@rick-github

Thanks for the update. However:

I just tried:

$ ollama -v
ollama version is 0.9.0

$ curl http://localhost:11434/api/chat -d '{ "model": "qwen3:30b-a3b-q8_0", "messages": [ { "role": "user", "content": "Why is the sky blue?" } ], "think": true }'
{"error":"registry.ollama.ai/library/qwen3:30b-a3b-q8_0 does not support thinking"}

$ ollama run qwen3:30b-a3b-q8_0

a

Okay, the user just sent "a". That's it. No other text. Hmm, maybe they're testing the waters or just made a typo. I
should respond politely and ask how I can assist them. Let me make sure to keep it friendly and open-ended. Maybe say
something like, "Hello! How can I assist you today?" That should encourage them to provide more information if they
need help with something specific.

Hello! How can I assist you today? 😊

<!-- gh-comment-id:2930238085 --> @lknik commented on GitHub (Jun 2, 2025): @rick-github Thanks for the update. However: I just tried: $ ollama -v ollama version is 0.9.0 $ curl http://localhost:11434/api/chat -d '{ "model": "qwen3:30b-a3b-q8_0", "messages": [ { "role": "user", "content": "Why is the sky blue?" } ], "think": true }' {"error":"registry.ollama.ai/library/qwen3:30b-a3b-q8_0 does not support thinking"} $ ollama run qwen3:30b-a3b-q8_0 >>> a <think> Okay, the user just sent "a". That's it. No other text. Hmm, maybe they're testing the waters or just made a typo. I should respond politely and ask how I can assist them. Let me make sure to keep it friendly and open-ended. Maybe say something like, "Hello! How can I assist you today?" That should encourage them to provide more information if they need help with something specific. </think> Hello! How can I assist you today? 😊
Author
Owner

@rick-github commented on GitHub (Jun 2, 2025):

Re-pull the model.

<!-- gh-comment-id:2930284835 --> @rick-github commented on GitHub (Jun 2, 2025): Re-pull the model.
Author
Owner

@lknik commented on GitHub (Jun 2, 2025):

Ahh, right. Would the flag work for non-ollama models though?

<!-- gh-comment-id:2930315481 --> @lknik commented on GitHub (Jun 2, 2025): Ahh, right. Would the flag work for non-ollama models though?
Author
Owner

@rick-github commented on GitHub (Jun 2, 2025):

No, but you can merge the template from an ollama model with a non-ollama model to make a thinking non-ollama model: https://github.com/ollama/ollama/issues/10914#issuecomment-2926168350

<!-- gh-comment-id:2930327096 --> @rick-github commented on GitHub (Jun 2, 2025): No, but you can merge the template from an ollama model with a non-ollama model to make a thinking non-ollama model: https://github.com/ollama/ollama/issues/10914#issuecomment-2926168350
Author
Owner

@lknik commented on GitHub (Jun 2, 2025):

Thanks! It won't work with Python's openai library?

<!-- gh-comment-id:2930893645 --> @lknik commented on GitHub (Jun 2, 2025): Thanks! It won't work with Python's openai library?
Author
Owner

@elvizlai commented on GitHub (Jun 3, 2025):

OpenAI library can not worked with extra_body

<!-- gh-comment-id:2934614702 --> @elvizlai commented on GitHub (Jun 3, 2025): OpenAI library can not worked with extra_body
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#6887