[GH-ISSUE #10922] /set nothink only applies to the first message. #32946

Closed
opened 2026-04-22 14:56:50 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @orbitalquark on GitHub (May 31, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/10922

What is the issue?

Thank you for creating the /set nothink option! I've noticed that it only works for the first message though. After that, I get thinking responses. For example:

% ollama run deepseek-r1
>>> /set nothink
Set 'nothink' mode.
>>> hi
Hello! 👋 How can I help you today?

>>> Do you know today's date? If not, just say "I don't know"
Okay, the user is asking if I know today's date. Let me think about this 
carefully.

Hmm, as DeepSeek, my knowledge cutoff is July 2024, so I can't provide 
real-time information like current dates or news updates beyond that 
point. 

The user seems to be testing my capabilities - they're checking if I have 
access to live data or just static knowledge from before July 2024. This 
is a common type of query people ask AI assistants for.

I should respond honestly about my limitations while still being helpful. 
The system message clearly states that I can't provide real-time 
information, so it's important to acknowledge this transparently without 
making excuses.

The user might be frustrated by not getting the current date directly, but 
honesty is better than pretending. Maybe they're asking because they need 
to know today's date for some specific purpose? Though they didn't specify 
what they actually want to do with the date information.

I'll keep my response simple and direct - just stating that I don't have 
access to real-time data while maintaining my helpful demeanor. No need to 
overexplain unless asked.
</think>
I don't know today's date, but as an AI created by **DeepSeek**, I can 
help you find out the current date or any historical dates based on 
available information up to July 2024. You can always ask me for a 
specific date range if that helps!

I would have expected there to be no thinking at all in the second response, and it probably would just throw a random date at me.

% ollama --version
ollama version is 0.9.0

Relevant log output


OS

macOS

GPU

Apple

CPU

Apple

Ollama version

0.9.0

Originally created by @orbitalquark on GitHub (May 31, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/10922 ### What is the issue? Thank you for creating the `/set nothink` option! I've noticed that it only works for the first message though. After that, I get thinking responses. For example: ``` % ollama run deepseek-r1 >>> /set nothink Set 'nothink' mode. >>> hi Hello! 👋 How can I help you today? >>> Do you know today's date? If not, just say "I don't know" Okay, the user is asking if I know today's date. Let me think about this carefully. Hmm, as DeepSeek, my knowledge cutoff is July 2024, so I can't provide real-time information like current dates or news updates beyond that point. The user seems to be testing my capabilities - they're checking if I have access to live data or just static knowledge from before July 2024. This is a common type of query people ask AI assistants for. I should respond honestly about my limitations while still being helpful. The system message clearly states that I can't provide real-time information, so it's important to acknowledge this transparently without making excuses. The user might be frustrated by not getting the current date directly, but honesty is better than pretending. Maybe they're asking because they need to know today's date for some specific purpose? Though they didn't specify what they actually want to do with the date information. I'll keep my response simple and direct - just stating that I don't have access to real-time data while maintaining my helpful demeanor. No need to overexplain unless asked. </think> I don't know today's date, but as an AI created by **DeepSeek**, I can help you find out the current date or any historical dates based on available information up to July 2024. You can always ask me for a specific date range if that helps! ``` I would have expected there to be no thinking at all in the second response, and it probably would just throw a random date at me. ``` % ollama --version ollama version is 0.9.0 ``` ### Relevant log output ```shell ``` ### OS macOS ### GPU Apple ### CPU Apple ### Ollama version 0.9.0
GiteaMirror added the bug label 2026-04-22 14:56:50 -05:00
Author
Owner

@orbitalquark commented on GitHub (May 31, 2025):

Looking into this further, it's possible the template for the deepseek-r1:latest model is wrong. If I use this:

TEMPLATE """{{- if .System }}{{ .System }}{{ end }}
{{- range $i, $_ := .Messages }}
{{- $last := eq (len (slice $.Messages $i)) 1}}
{{- if eq .Role "user" }}<|User|>{{ .Content }}
{{- else if eq .Role "assistant" }}<|Assistant|>
  {{- if and $.IsThinkSet $.Think (and $last .Thinking) -}}
<think>
{{ .Thinking }}
</think>
{{- end }}{{ .Content }}{{- if not $last }}<|end▁of▁sentence|>{{- end }}
{{- end }}
{{- if and $last (ne .Role "assistant") }}<|Assistant|>
{{- if and $.IsThinkSet (not $.Think) -}}
<think>

</think>

{{ end }}
{{- end -}}
{{- end }}"""

then it looks like it works.

I changed {{- if and $.IsThinkSet (and $last .Thinking) -}} to {{- if and $.IsThinkSet $.Think (and $last .Thinking) -}} (note the extra $.Think operand).

<!-- gh-comment-id:2924012392 --> @orbitalquark commented on GitHub (May 31, 2025): Looking into this further, it's possible the template for the deepseek-r1:latest model is wrong. If I use this: ``` TEMPLATE """{{- if .System }}{{ .System }}{{ end }} {{- range $i, $_ := .Messages }} {{- $last := eq (len (slice $.Messages $i)) 1}} {{- if eq .Role "user" }}<|User|>{{ .Content }} {{- else if eq .Role "assistant" }}<|Assistant|> {{- if and $.IsThinkSet $.Think (and $last .Thinking) -}} <think> {{ .Thinking }} </think> {{- end }}{{ .Content }}{{- if not $last }}<|end▁of▁sentence|>{{- end }} {{- end }} {{- if and $last (ne .Role "assistant") }}<|Assistant|> {{- if and $.IsThinkSet (not $.Think) -}} <think> </think> {{ end }} {{- end -}} {{- end }}""" ``` then it looks like it works. I changed ` {{- if and $.IsThinkSet (and $last .Thinking) -}}` to ` {{- if and $.IsThinkSet $.Think (and $last .Thinking) -}}` (note the extra `$.Think` operand).
Author
Owner

@orbitalquark commented on GitHub (May 31, 2025):

After testing more, I'm getting mixed results. Sometimes it looks like the model is not thinking, and other times it gives its thinking followed by </think> with no opening <think>, as shown in the initial description. I don't know what's going on.

<!-- gh-comment-id:2924052975 --> @orbitalquark commented on GitHub (May 31, 2025): After testing more, I'm getting mixed results. Sometimes it looks like the model is not thinking, and other times it gives its thinking followed by `</think>` with no opening `<think>`, as shown in the initial description. I don't know what's going on.
Author
Owner

@dengyunsheng250 commented on GitHub (Jun 5, 2025):

经过更多测试后,我得到了一些结果。有时看起来模型没有思考,有时它却像最初的描述中那样,先思考,然后</think>没有开头<think>。我不知道发生了什么。
i guess it may just remove the think tag

<!-- gh-comment-id:2942588247 --> @dengyunsheng250 commented on GitHub (Jun 5, 2025): > 经过更多测试后,我得到了一些结果。有时看起来模型没有思考,有时它却像最初的描述中那样,先思考,然后`</think>`没有开头`<think>`。我不知道发生了什么。 i guess it may just remove the think tag
Author
Owner

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

https://github.com/ollama/ollama/issues/11010#issuecomment-2953090616

<!-- gh-comment-id:2959452082 --> @rick-github commented on GitHub (Jun 10, 2025): https://github.com/ollama/ollama/issues/11010#issuecomment-2953090616
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#32946