[GH-ISSUE #10912] deepseek-r1-8b-qwen3 support tool call #7177

Closed
opened 2026-04-12 19:10:29 -05:00 by GiteaMirror · 6 comments
Owner

Originally created by @K-O-T-W on GitHub (May 30, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/10912

What is the issue?

Image
Both the teacher model and the base model of this architecture support tool calls, and Hugging Face's chat_template documentation also mentions handling for tool calls. However, this specific template does not support it—I get an error when passing the tool parameter:
{"error":"registry.ollama.ai/library/deepseek-r1:8b-0528-qwen3-q8_0 does not support tools"}

Relevant log output


OS

No response

GPU

No response

CPU

No response

Ollama version

No response

Originally created by @K-O-T-W on GitHub (May 30, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/10912 ### What is the issue? ![Image](https://github.com/user-attachments/assets/8652d2c5-b34a-499b-8f82-f9b9c4fd2c5e) Both the teacher model and the base model of this architecture support tool calls, and Hugging Face's chat_template documentation also mentions handling for tool calls. However, this specific template does not support it—I get an error when passing the tool parameter: {"error":"registry.ollama.ai/library/deepseek-r1:8b-0528-qwen3-q8_0 does not support tools"} ### Relevant log output ```shell ``` ### OS _No response_ ### GPU _No response_ ### CPU _No response_ ### Ollama version _No response_
GiteaMirror added the bug label 2026-04-12 19:10:29 -05:00
Author
Owner

@Chanantho22 commented on GitHub (May 30, 2025):

What is the issue?

Image Both the teacher model and the base model of this architecture support tool calls, and Hugging Face's chat_template documentation also mentions handling for tool calls. However, this specific template does not support it—I get an error when passing the tool parameter: {"error":"registry.ollama.ai/library/deepseek-r1:8b-0528-qwen3-q8_0 does not support tools"}

Relevant log output

OS

No response

GPU

No response

CPU

No response

Ollama version

No response

<!-- gh-comment-id:2921742802 --> @Chanantho22 commented on GitHub (May 30, 2025): > ### What is the issue? > ![Image](https://github.com/user-attachments/assets/8652d2c5-b34a-499b-8f82-f9b9c4fd2c5e) Both the teacher model and the base model of this architecture support tool calls, and Hugging Face's chat_template documentation also mentions handling for tool calls. However, this specific template does not support it—I get an error when passing the tool parameter: {"error":"registry.ollama.ai/library/deepseek-r1:8b-0528-qwen3-q8_0 does not support tools"} > > ### Relevant log output > ### OS > _No response_ > > ### GPU > _No response_ > > ### CPU > _No response_ > > ### Ollama version > _No response_
Author
Owner

@Master-Pr0grammer commented on GitHub (Jun 1, 2025):

came here to say this, looks like it might just be a simple fix to the chat template. hopefully this gets updated soon.

<!-- gh-comment-id:2927847105 --> @Master-Pr0grammer commented on GitHub (Jun 1, 2025): came here to say this, looks like it might just be a simple fix to the chat template. hopefully this gets updated soon.
Author
Owner

@benhaotang commented on GitHub (Jun 1, 2025):

I also want to point out that although a template like this:https://ollama.com/okamototk/deepseek-r1:8b/blobs/e94a8ecb9327 do work, it also makes the model hallucinate a lot more and also much worse at instruction following.

<!-- gh-comment-id:2927853932 --> @benhaotang commented on GitHub (Jun 1, 2025): I also want to point out that although a template like this:https://ollama.com/okamototk/deepseek-r1:8b/blobs/e94a8ecb9327 do work, it also makes the model hallucinate a lot more and also much worse at instruction following.
Author
Owner

@tko commented on GitHub (Jul 1, 2025):

I suspect the problem with okamototks model is that the tokens/conventions used in the template (<|im_start|>assistant) don't match up with the params (<|Assistant|>)

I'd be inclined to try translate huggingface jinja2 template into ollama gotmpl format, though I've no idea which parts/tokens are significant and what's arbitrary.

<!-- gh-comment-id:3025246025 --> @tko commented on GitHub (Jul 1, 2025): I suspect the problem with `okamototk`s model is that the tokens/conventions used in the template (`<|im_start|>assistant`) don't match up with the params (`<|Assistant|>`) I'd be inclined to try translate [huggingface jinja2 template](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-32B?chat_template=default&format=true) into ollama gotmpl format, though I've no idea which parts/tokens are significant and what's arbitrary.
Author
Owner

@ParthSareen commented on GitHub (Jul 6, 2025):

I've spent a good amount of time trying to get this working. Template wise it's super simple to add but the model randomly misses tokens which are supposed to be there when doing tool calling. The distilled model's tokenizer and the parent model's tokenizers are different which could possibly cause the divergence. Found inadequate tool calling in other implementations as well – don't want to enable this if it's going to be a poor experience. Sorry for not communicating!

<!-- gh-comment-id:3040479108 --> @ParthSareen commented on GitHub (Jul 6, 2025): I've spent a good amount of time trying to get this working. Template wise it's super simple to add but the model randomly misses tokens which are supposed to be there when doing tool calling. The distilled model's tokenizer and the parent model's tokenizers are different which could possibly cause the divergence. Found inadequate tool calling in other implementations as well – don't want to enable this if it's going to be a poor experience. Sorry for not communicating!
Author
Owner

@tko commented on GitHub (Jul 6, 2025):

Oh, I see some of the deepseek-r1 model templates do include tools, for example deepseek-r1:671b

The web page is very unclear that the tools tag doesn't apply to all models. There's really no way of knowing from the list, you'd need to click through each model and look at its template. Adding a label on the list would help avoid the confusion, similar to how the Context and Input columns indicate what to expect.

<!-- gh-comment-id:3041134657 --> @tko commented on GitHub (Jul 6, 2025): Oh, I see _some_ of the deepseek-r1 model templates do include tools, for example [deepseek-r1:671b](https://ollama.com/library/deepseek-r1:671b) The web page is very unclear that the `tools` tag doesn't apply to all models. There's really no way of knowing from the list, you'd need to click through each model and look at its template. Adding a label on the list would help avoid the confusion, similar to how the Context and Input columns indicate what to expect.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#7177