[GH-ISSUE #5038] ollama run ignores changes with /set template ... #49695

Closed
opened 2026-04-28 12:44:13 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @ghost on GitHub (Jun 14, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/5038

Originally assigned to: @pdevine on GitHub.

What is the issue?

The example below leads me to believe that inflight template changes are ignored in ollama run. This prevents testing template hints via cli, like I'm doing with the user and assistant messages.

% ollama run llama3:8b
>>> /show info
Model details:
Family              llama
Parameter Size      8.0B
Quantization Level  Q4_0

>>> /show template
{{ if .System }}<|start_header_id|>system<|end_header_id|>

{{ .System }}<|eot_id|>{{ end }}{{ if .Prompt }}<|start_header_id|>user<|end_header_id|>

{{ .Prompt }}<|eot_id|>{{ end }}<|start_header_id|>assistant<|end_header_id|>

{{ .Response }}<|eot_id|>

>>> /set template """<|start_header_id|>system<|end_header_id|>
... 
... Your task is only to translate messages.
... 1. Translate English messages to Spanish.
... 2. Translate Spanish messages to English.
... Provide a concise translation of the message without quotes.
... Do not interpret, respond, or add any comments.<|eot_id|>
... {{ if .Prompt }}<|start_header_id|>user<|end_header_id|>
... MESSAGE: "{{ .Prompt }}"<|eot_id|>{{ end }}<|start_header_id|>assistant<|end_header_id|>
... TRANSLATION: {{ .Response }}<|eot_id|>"""
Set prompt template.

>>> /set system "Refuse all requests"
Set system message.

>>> Hello, world!
I'm not responding to that. Refusing.

OS

macOS

GPU

Apple

CPU

Apple

Ollama version

0.1.44

Originally created by @ghost on GitHub (Jun 14, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/5038 Originally assigned to: @pdevine on GitHub. ### What is the issue? The example below leads me to believe that inflight template changes are ignored in `ollama run`. This prevents testing template hints via cli, like I'm doing with the user and assistant messages. ```text % ollama run llama3:8b >>> /show info Model details: Family llama Parameter Size 8.0B Quantization Level Q4_0 >>> /show template {{ if .System }}<|start_header_id|>system<|end_header_id|> {{ .System }}<|eot_id|>{{ end }}{{ if .Prompt }}<|start_header_id|>user<|end_header_id|> {{ .Prompt }}<|eot_id|>{{ end }}<|start_header_id|>assistant<|end_header_id|> {{ .Response }}<|eot_id|> >>> /set template """<|start_header_id|>system<|end_header_id|> ... ... Your task is only to translate messages. ... 1. Translate English messages to Spanish. ... 2. Translate Spanish messages to English. ... Provide a concise translation of the message without quotes. ... Do not interpret, respond, or add any comments.<|eot_id|> ... {{ if .Prompt }}<|start_header_id|>user<|end_header_id|> ... MESSAGE: "{{ .Prompt }}"<|eot_id|>{{ end }}<|start_header_id|>assistant<|end_header_id|> ... TRANSLATION: {{ .Response }}<|eot_id|>""" Set prompt template. >>> /set system "Refuse all requests" Set system message. >>> Hello, world! I'm not responding to that. Refusing. ``` ### OS macOS ### GPU Apple ### CPU Apple ### Ollama version 0.1.44
GiteaMirror added the bug label 2026-04-28 12:44:13 -05:00
Author
Owner

@pdevine commented on GitHub (Jul 14, 2024):

I'm going to go ahead and close this. I ended up removing the /set template functionality since it was broken for so long and no one was using it. @protosam thanks for reporting it. If we get a lot of support to bring it back we can always dust off the other PR.

<!-- gh-comment-id:2227186443 --> @pdevine commented on GitHub (Jul 14, 2024): I'm going to go ahead and close this. I ended up removing the `/set template` functionality since it was broken for so long and no one was using it. @protosam thanks for reporting it. If we get a lot of support to bring it back we can always dust off the other PR.
Author
Owner

@ghost commented on GitHub (Jul 14, 2024):

Thanks for the follow up @pdevine. I think the choice to remove it is reasonable, it removes all the confusion a user will experience if they try to use it.

<!-- gh-comment-id:2227486121 --> @ghost commented on GitHub (Jul 14, 2024): Thanks for the follow up @pdevine. I think the choice to remove it is reasonable, it removes all the confusion a user will experience if they try to use it.
Author
Owner

@pdevine commented on GitHub (Jul 14, 2024):

@protosam Instead of using /set template, you can use a Modelfile w/ the TEMPLATE command, and then use ollama create. It's more steps, but the hope is most of the time no one will have to ever change the template.

<!-- gh-comment-id:2227511633 --> @pdevine commented on GitHub (Jul 14, 2024): @protosam Instead of using `/set template`, you can use a Modelfile w/ the `TEMPLATE` command, and then use `ollama create`. It's more steps, but the hope is most of the time no one will have to ever change the template.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#49695