[GH-ISSUE #15269] Gemma4:e2b missing template structure #35526

Closed
opened 2026-04-22 20:05:38 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @zamiere on GitHub (Apr 3, 2026).
Original GitHub issue: https://github.com/ollama/ollama/issues/15269

What is the issue?

ollama show gemma3:4b --modelfile

The current template part is:
TEMPLATE {{ .Prompt }}
There is no complete example at https://ollama.com/library/gemma4
In previous versions we were able to mod template parts, now written that "Note that Ollama already handles the complexities of the chat template for you." - It is not explained in detail what this is about.
Complete template is necessary to disable thinking behaviour with removing <|think|> part.

Relevant log output


OS

No response

GPU

No response

CPU

No response

Ollama version

0.20.0

Originally created by @zamiere on GitHub (Apr 3, 2026). Original GitHub issue: https://github.com/ollama/ollama/issues/15269 ### What is the issue? ollama show gemma3:4b --modelfile The current template part is: TEMPLATE {{ .Prompt }} There is no complete example at https://ollama.com/library/gemma4 In previous versions we were able to mod template parts, now written that "Note that Ollama already handles the complexities of the chat template for you." - It is not explained in detail what this is about. Complete template is necessary to disable thinking behaviour with removing <|think|> part. ### Relevant log output ```shell ``` ### OS _No response_ ### GPU _No response_ ### CPU _No response_ ### Ollama version 0.20.0
GiteaMirror added the bug label 2026-04-22 20:05:38 -05:00
Author
Owner

@rick-github commented on GitHub (Apr 3, 2026):

Most new models do not use TEMPLATE, the parser and renderer are in code because it's easier. You can remove the RENDERER and PARSER elements from the Modelfile and add your own TEMPLATE by translating the Jinja template to Go template.

<!-- gh-comment-id:4183079057 --> @rick-github commented on GitHub (Apr 3, 2026): Most new models do not use TEMPLATE, the parser and renderer are in [code](https://github.com/ollama/ollama/blob/main/model/renderers/gemma4.go) because it's easier. You can remove the RENDERER and PARSER elements from the Modelfile and add your own TEMPLATE by translating the [Jinja template](https://huggingface.co/google/gemma-4-31B-it/blob/main/chat_template.jinja) to [Go template](https://github.com/ollama/ollama/blob/main/docs/modelfile.mdx#template).
Author
Owner

@zamiere commented on GitHub (Apr 3, 2026):

Unfortunately, it doesn’t take the Go-converted template into account when the renderer/parser is disabled.

<!-- gh-comment-id:4183161601 --> @zamiere commented on GitHub (Apr 3, 2026): Unfortunately, it doesn’t take the Go-converted template into account when the renderer/parser is disabled.
Author
Owner

@zamiere commented on GitHub (Apr 3, 2026):

"/set nothink" works well on terminal in chat mode, but there is no equivalent option in Ollama app.

<!-- gh-comment-id:4183247932 --> @zamiere commented on GitHub (Apr 3, 2026): "/set nothink" works well on terminal in chat mode, but there is no equivalent option in Ollama app.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#35526