[GH-ISSUE #10456] how can i disable thinking mode? #6874

Closed
opened 2026-04-12 18:42:53 -05:00 by GiteaMirror · 27 comments
Owner

Originally created by @codeMonkey-shin on GitHub (Apr 29, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/10456

qwen3 has thinking mode but i dont need it..

how can i disable it?

Originally created by @codeMonkey-shin on GitHub (Apr 29, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/10456 qwen3 has thinking mode but i dont need it.. how can i disable it?
GiteaMirror added the feature request label 2026-04-12 18:42:53 -05:00
Author
Owner

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

Yeah, i don't need it either, its actually really annoying, just give the answer.

<!-- gh-comment-id:2837294769 --> @atoulmin commented on GitHub (Apr 29, 2025): Yeah, i don't need it either, its actually really annoying, just give the answer.
Author
Owner

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

I have the same requirement.

<!-- gh-comment-id:2837324472 --> @hepinggege commented on GitHub (Apr 29, 2025): I have the same requirement.
Author
Owner

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

I have the same requirment.

<!-- gh-comment-id:2837324971 --> @wuxingzhong commented on GitHub (Apr 29, 2025): I have the same requirment.
Author
Owner

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

/thinkor /no_think + you question

Image

<!-- gh-comment-id:2837325652 --> @wangsrGit119 commented on GitHub (Apr 29, 2025): `/think`or `/no_think` + you question ![Image](https://github.com/user-attachments/assets/d457aca6-5c7d-45ea-9359-d50043c6d088)
Author
Owner

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

The thing is i dont mind that is reasons, but can we keep that enabled and not put the "think" section in the response?

<!-- gh-comment-id:2837330966 --> @atoulmin commented on GitHub (Apr 29, 2025): The thing is i dont mind that is reasons, but can we keep that enabled and not put the "think" section in the response?
Author
Owner

@jeffrey-cwj commented on GitHub (Apr 29, 2025):

how can i disable it in api?

<!-- gh-comment-id:2837340369 --> @jeffrey-cwj commented on GitHub (Apr 29, 2025): how can i disable it in api?
Author
Owner

@seamo-sun commented on GitHub (Apr 29, 2025):

@codeMonkey-shin https://github.com/ollama/ollama/pull/8511

<!-- gh-comment-id:2837342838 --> @seamo-sun commented on GitHub (Apr 29, 2025): @codeMonkey-shin https://github.com/ollama/ollama/pull/8511
Author
Owner

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

how can i disable it in api?

I modified model template to add "/nothink" before each user input and it works fine in my translation browser extension (qwen3:8b).

First create a modelfile (qwen3n.mf in my case) and modify original template

FROM qwen3:latest
TEMPLATE """

...

{{- if eq .Role "user" }}
<|im_start|>user
/nothink {{ .Content }}<|im_end|> # change this line
{{ else if eq .Role "assistant" }}<|im_start|>assistant

...

"""

Then create a new model using the modelfile:

ollama create qwen3n -f .\qwen3n.mf

Now there's no need to add "/nothink" by hand in the terminal or api.

Image

<!-- gh-comment-id:2837486127 --> @Skythinker616 commented on GitHub (Apr 29, 2025): > how can i disable it in api? I modified model template to add "/nothink" before each user input and it works fine in my translation browser extension (qwen3:8b). First create a modelfile (`qwen3n.mf` in my case) and modify [original template](https://ollama.com/library/qwen3/blobs/eb4402837c78) ```text FROM qwen3:latest TEMPLATE """ ... {{- if eq .Role "user" }} <|im_start|>user /nothink {{ .Content }}<|im_end|> # change this line {{ else if eq .Role "assistant" }}<|im_start|>assistant ... """ ``` Then create a new model using the modelfile: ```bash ollama create qwen3n -f .\qwen3n.mf ``` Now there's no need to add "/nothink" by hand in the terminal or api. ![Image](https://github.com/user-attachments/assets/0a810575-a9af-4f73-ba03-3d66246eb94e)
Author
Owner

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

@Skythinker616
Are you asking to paste the entire template or just the modified parts?
My Modelfile content is causing an error when creating.
FROM qwen3:32b
TEMPLATE """

...

{{- if eq .Role "user" }}
<|im_start|>user
/nothink {{ .Content }}<|im_end|> # change this line
{{ else if eq .Role "assistant" }}<|im_start|>assistant

...

"""

Error
ef3:~/.ollama/models# ollama create qwen3n:32b -f ./Modelfile
gathering model components
Error: template error: template: :5: unexpected EOF

<!-- gh-comment-id:2837815251 --> @j820301 commented on GitHub (Apr 29, 2025): @Skythinker616 Are you asking to paste the entire template or just the modified parts? My Modelfile content is causing an error when creating. FROM qwen3:32b TEMPLATE """ ... {{- if eq .Role "user" }} <|im_start|>user /nothink {{ .Content }}<|im_end|> # change this line {{ else if eq .Role "assistant" }}<|im_start|>assistant ... """ Error ef3:~/.ollama/models# ollama create qwen3n:32b -f ./Modelfile gathering model components Error: template error: template: :5: unexpected EOF
Author
Owner

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

I covered the entire template, the problem is solved! Thank you for providing the solution!

<!-- gh-comment-id:2837827428 --> @j820301 commented on GitHub (Apr 29, 2025): I covered the entire template, the problem is solved! Thank you for providing the solution!
Author
Owner

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

@j820301 Yes, I pasted the full template and changed only the marked line. Glad to hear it works!

<!-- gh-comment-id:2837877814 --> @Skythinker616 commented on GitHub (Apr 29, 2025): @j820301 Yes, I pasted the full template and changed only the marked line. Glad to hear it works!
Author
Owner

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

get

<!-- gh-comment-id:2838022411 --> @ShuSongXiao commented on GitHub (Apr 29, 2025): get
Author
Owner

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

"/nothink" in the template does nothing, if you use just the original template it will still not use thinking and will show an empty <think> </think>

<!-- gh-comment-id:2838367916 --> @s4shstr commented on GitHub (Apr 29, 2025): "/nothink" in the template does nothing, if you use just the original template it will still not use thinking and will show an empty \<think> \</think>
Author
Owner

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

"/nothink" in the template does nothing, if you use just the original template it will still not use thinking and will show an empty

@s4shstr Thanks for pointing this out. I’ve did some tests across different model sizes:

  • 0.6b model outputs reasoning with the original template, adding "/no_think" (not "/nothink") is necessary to disable it.
  • 8b model has the issue you described: it does not reason with the original template, and you actually have to add "/think" in the template to enable it.
  • 30b model reasons with the original template, and adding both "/nothink" and "/no_think" effectively disable the reasoning.

While I’m not sure why these happened, it does seem that this approach can control the reasoning behavior.

<!-- gh-comment-id:2838669197 --> @Skythinker616 commented on GitHub (Apr 29, 2025): > "/nothink" in the template does nothing, if you use just the original template it will still not use thinking and will show an empty <think> </think> @s4shstr Thanks for pointing this out. I’ve did some tests across different model sizes: - 0.6b model outputs reasoning with the original template, adding "/no_think" (not "/nothink") is necessary to disable it. - 8b model has the issue you described: it does not reason with the original template, and you actually have to add "/think" in the template to enable it. - 30b model reasons with the original template, and adding both "/nothink" and "/no_think" effectively disable the reasoning. While I’m not sure why these happened, it does seem that this approach can control the reasoning behavior.
Author
Owner

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

@Skythinker616 Thank you for testing these options. Yeah, then it's strange that it works like this, I'm using 1.7b, and neither '/no_think', '/nothink' (they behave the same as the original template), nor even '/think' seem to be doing anything. But adding the original template fixed it for me, so thanks anyway for the tip

<!-- gh-comment-id:2840352975 --> @s4shstr commented on GitHub (Apr 29, 2025): @Skythinker616 Thank you for testing these options. Yeah, then it's strange that it works like this, I'm using 1.7b, and neither '/no_think', '/nothink' (they behave the same as the original template), nor even '/think' seem to be doing anything. But adding the original template fixed it for me, so thanks anyway for the tip
Author
Owner

@GreazySpoon commented on GitHub (Apr 30, 2025):

Do not change the template. because the / in ollama is a command. So to disable thinking by default, it shoud be changed somewhere in the api. In Qwen3 blog post, they didnt talk about a system prompt or any pre prompt to enable/disable it, instead they talked about a flag in the AutoTokenizer class.

<!-- gh-comment-id:2840565433 --> @GreazySpoon commented on GitHub (Apr 30, 2025): Do not change the template. because the / in ollama is a command. So to disable thinking by default, it shoud be changed somewhere in the api. In Qwen3 blog post, they didnt talk about a system prompt or any pre prompt to enable/disable it, instead they talked about a flag in the AutoTokenizer class.
Author
Owner

@wangsrGit119 commented on GitHub (Apr 30, 2025):

/thinkor /no_think + you question

Image

Note:
There must be an extra space in front of /think or /no_think, otherwise it will conflict with the commands of ollama.

<!-- gh-comment-id:2840583030 --> @wangsrGit119 commented on GitHub (Apr 30, 2025): > `/think`or `/no_think` + you question > > ![Image](https://github.com/user-attachments/assets/d457aca6-5c7d-45ea-9359-d50043c6d088) Note: **There must be an extra space in front of `/think` or `/no_think`, otherwise it will conflict with the commands of ollama.**
Author
Owner

@lllwenbearai commented on GitHub (Apr 30, 2025):

how can i disable it in api?

I modified model template to add "/nothink" before each user input and it works fine in my translation browser extension (qwen3:8b).

First create a modelfile (qwen3n.mf in my case) and modify original template

FROM qwen3:latest
TEMPLATE """

...

{{- if eq .Role "user" }}
<|im_start|>user
/nothink {{ .Content }}<|im_end|> # change this line
{{ else if eq .Role "assistant" }}<|im_start|>assistant

...

"""

Then create a new model using the modelfile:

ollama create qwen3n -f .\qwen3n.mf
Now there's no need to add "/nothink" by hand in the terminal or api.

Image

Could you provide the complete content?I didn't understand.

<!-- gh-comment-id:2840987203 --> @lllwenbearai commented on GitHub (Apr 30, 2025): > > how can i disable it in api? > > I modified model template to add "/nothink" before each user input and it works fine in my translation browser extension (qwen3:8b). > > First create a modelfile (`qwen3n.mf` in my case) and modify [original template](https://ollama.com/library/qwen3/blobs/eb4402837c78) > > ``` > FROM qwen3:latest > TEMPLATE """ > > ... > > {{- if eq .Role "user" }} > <|im_start|>user > /nothink {{ .Content }}<|im_end|> # change this line > {{ else if eq .Role "assistant" }}<|im_start|>assistant > > ... > > """ > ``` > > Then create a new model using the modelfile: > > ollama create qwen3n -f .\qwen3n.mf > Now there's no need to add "/nothink" by hand in the terminal or api. > > ![Image](https://github.com/user-attachments/assets/0a810575-a9af-4f73-ba03-3d66246eb94e) Could you provide the complete content?I didn't understand.
Author
Owner

@pcause commented on GitHub (Apr 30, 2025):

using qwen3:5b i was able to put /nothink at the end of my of my prompt and that seemed to work.

<!-- gh-comment-id:2843094005 --> @pcause commented on GitHub (Apr 30, 2025): using qwen3:5b i was able to put /nothink at the end of my of my prompt and that seemed to work.
Author
Owner

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

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

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

@dsfff45 commented on GitHub (Jul 25, 2025):

no think is completely ignored:

respond in single python file /no_think
Thinking...
Okay, the user wants a single Python file tha...

<!-- gh-comment-id:3117602752 --> @dsfff45 commented on GitHub (Jul 25, 2025): no think is completely ignored: >respond in single python file /no_think Thinking... Okay, the user wants a single Python file tha...
Author
Owner

@rootkink commented on GitHub (Jul 31, 2025):

respond in single python file /no_think

try /set nothink
it worked for me
https://ollama.com/blog/thinking

<!-- gh-comment-id:3140943262 --> @rootkink commented on GitHub (Jul 31, 2025): > > respond in single python file /no_think try `/set nothink` it worked for me https://ollama.com/blog/thinking
Author
Owner

@610yilingliu commented on GitHub (Oct 6, 2025):

In python prompt text, we can add \no_think before input. Make sure you use \ instead of \ otherwise you will get enter+o_hink

example:

    {
        "role": "user", 
        "content": f"\\no_think {text}"
    }
<!-- gh-comment-id:3370787291 --> @610yilingliu commented on GitHub (Oct 6, 2025): In python prompt text, we can add \no_think before input. Make sure you use \\ instead of \ otherwise you will get enter+o_hink example: { "role": "user", "content": f"\\no_think {text}" }
Author
Owner

@udjuraev-ipa commented on GitHub (Dec 15, 2025):

For some reason, whether I use the "\no_think" in the system prompt or in the regular chat in the shell, I am getting the entire reasoning out anyways.

<!-- gh-comment-id:3657106126 --> @udjuraev-ipa commented on GitHub (Dec 15, 2025): For some reason, whether I use the "\no_think" in the system prompt or in the regular chat in the shell, I am getting the entire reasoning out anyways.
Author
Owner

@wuxingzhong commented on GitHub (Dec 15, 2025):

来信收到。 我会尽快查看。。 

<!-- gh-comment-id:3657107908 --> @wuxingzhong commented on GitHub (Dec 15, 2025): 来信收到。 我会尽快查看。。 
Author
Owner

@peter-peter-22 commented on GitHub (Jan 19, 2026):

None of the answers are working, this feature was possibly removed or it works only on certain models.
Model name: qwen3:4b

I tried the following prompts:
"/no_think hello"
" /no_think hello"
"/nothink hello"
" /nothink hello"
"\no_think hello"
" \no_think hello"
"\nothink hello"
" \nothink hello"
" \no_think hello"
" \nothink hello"
"hello /no_think"
"hello /nothink"
"hello \no_think"
"hello \nothink"

All prompts resulted either in thinking or ollama command error.
I tried some of these prompts with the ollama python api, neither worked.

<!-- gh-comment-id:3770308782 --> @peter-peter-22 commented on GitHub (Jan 19, 2026): None of the answers are working, this feature was possibly removed or it works only on certain models. Model name: qwen3:4b I tried the following prompts: "/no_think hello" " /no_think hello" "/nothink hello" " /nothink hello" "\no_think hello" " \no_think hello" "\nothink hello" " \nothink hello" " \\no_think hello" " \\nothink hello" "hello /no_think" "hello /nothink" "hello \no_think" "hello \nothink" All prompts resulted either in thinking or ollama command error. I tried some of these prompts with the ollama python api, neither worked.
Author
Owner

@rick-github commented on GitHub (Jan 20, 2026):

qwen3:4b is not a hybrid model. For non-thinking, use qwen3:4b-instruct.

<!-- gh-comment-id:3770553791 --> @rick-github commented on GitHub (Jan 20, 2026): qwen3:4b is not a hybrid model. For non-thinking, use [qwen3:4b-instruct](https://ollama.com/library/qwen3:4b-instruct).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#6874