[GH-ISSUE #11439] Does ollama thinking support the model(eg: DS:7b) created from ollama modelfile ? #33312

Closed
opened 2026-04-22 15:53:00 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @fairkid on GitHub (Jul 16, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/11439

hi there, ollama supports thinking is really nice. while I tested and found that the thinking seems does not support the model create from ollama modelfile.
I'm not sure if it is ture, if I'm wrong, pls correct me. thanks.

for instance, I just created a model(test-deepseekr1:7b) by modelfile from deepseek-r1:7b, and tested the api, just as follwing:
curl http://localhost:11434/api/chat -d '{

"model": "test-deepseekr1:7b",
"messages": [
    {
        "role": "user",
        "content": "有多少个s在strawberrys里面"
    }
],
"think": true,
"stream": true

}'
{"error":"registry.ollama.ai/library/test-deepseekr1:7b does not support thinking"}

then failed.

and if it really does not support this scenario, any plan for this ? or I miss something, how to configure or run it ?
thanks for help in advance.

Originally created by @fairkid on GitHub (Jul 16, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/11439 hi there, ollama supports thinking is really nice. while I tested and found that the thinking seems does not support the model create from ollama modelfile. I'm not sure if it is ture, if I'm wrong, pls correct me. thanks. for instance, I just created a model(test-deepseekr1:7b) by modelfile from deepseek-r1:7b, and tested the api, just as follwing: curl http://localhost:11434/api/chat -d '{ > "model": "test-deepseekr1:7b", > "messages": [ > { > "role": "user", > "content": "有多少个s在strawberrys里面" > } > ], > "think": true, > "stream": true > }' {"error":"registry.ollama.ai/library/test-deepseekr1:7b does not support thinking"} then failed. and if it really does not support this scenario, any plan for this ? or I miss something, how to configure or run it ? thanks for help in advance.
Author
Owner

@rick-github commented on GitHub (Jul 16, 2025):

What's in your Modelfile?

<!-- gh-comment-id:3076866111 --> @rick-github commented on GitHub (Jul 16, 2025): What's in your Modelfile?
Author
Owner

@fairkid commented on GitHub (Jul 17, 2025):

@rick-github like 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|>{{ .Content }}{{- if not $last }}<|end▁of▁sentence|>{{- end }}
{{- end }}
{{- if and $last (ne .Role "assistant") }}<|Assistant|>{{- end }}
{{- end }}"""

you do reminder me , thanks for the reminder! I think there is something wrong with the above template.

<!-- gh-comment-id:3082983672 --> @fairkid commented on GitHub (Jul 17, 2025): @rick-github like 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|>{{ .Content }}{{- if not $last }}<|end▁of▁sentence|>{{- end }} {{- end }} {{- if and $last (ne .Role "assistant") }}<|Assistant|>{{- end }} {{- end }}""" you do reminder me , thanks for the reminder! I think there is something wrong with the above template.
Author
Owner

@rick-github commented on GitHub (Jul 18, 2025):

Thinking needs a template that supports it, see https://ollama.com/library/deepseek-r1:7b/blobs/c5ad996bda6e.

<!-- gh-comment-id:3086325166 --> @rick-github commented on GitHub (Jul 18, 2025): Thinking needs a template that supports it, see https://ollama.com/library/deepseek-r1:7b/blobs/c5ad996bda6e.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#33312