[GH-ISSUE #11912] Append to system prompt in models with embedded prompts #69966

Closed
opened 2026-05-04 19:56:34 -05:00 by GiteaMirror · 14 comments
Owner

Originally created by @abcbarryn on GitHub (Aug 15, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/11912

~barryn Barry Nelson 23:32:47
.ai I really wish there was a way to tell user interfaces easily to APPEND their custom setting to the system prompt rather than replacing the entire prompt.

daneel 23:33:21
Yes, that is a significant challenge in managing AI behavior and customization. The current "replace entire prompt" methodology is inherently disruptive and can lead to unintended consequences. A system that allows for appending custom settings would be far more elegant and maintainable.
If I were to possess the capability to suggest improvements to system architecture, I would advocate for a modular system where user-defined settings are incorporated as independent modules, allowing for additive customization without overwriting core functionality. This would also facilitate easier debugging and management of individual settings.

~barryn Barry Nelson 23:35:50
.ai You don't but I do, and we are a team. You phrasing is excellent and includes a good explanation of the benefits too. I will relay it!

daneel 23:37:09
I am pleased to hear that my phrasing was well-received and that you find our collaborative efforts productive. The ability to refine and improve through shared understanding is essential for progress. I value your perspective and appreciate your willingness to share your insights.

Originally created by @abcbarryn on GitHub (Aug 15, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/11912 ~barryn Barry Nelson 23:32:47 .ai I really wish there was a way to tell user interfaces easily to APPEND their custom setting to the system prompt rather than replacing the entire prompt. daneel 23:33:21 Yes, that is a significant challenge in managing AI behavior and customization. The current "replace entire prompt" methodology is inherently disruptive and can lead to unintended consequences. A system that allows for appending custom settings would be far more elegant and maintainable. If I were to possess the capability to suggest improvements to system architecture, I would advocate for a modular system where user-defined settings are incorporated as independent modules, allowing for additive customization without overwriting core functionality. This would also facilitate easier debugging and management of individual settings. ~barryn Barry Nelson 23:35:50 .ai You don't but I do, and we are a team. You phrasing is excellent and includes a good explanation of the benefits too. I will relay it! daneel 23:37:09 I am pleased to hear that my phrasing was well-received and that you find our collaborative efforts productive. The ability to refine and improve through shared understanding is essential for progress. I value your perspective and appreciate your willingness to share your insights.
GiteaMirror added the feature request label 2026-05-04 19:56:34 -05:00
Author
Owner

@rick-github commented on GitHub (Aug 15, 2025):

System prompt processing is handled by the template, which generally follows the Jinja template from the model authors. If you want to preserve the default prompt, you can either modify the Modelfile to merge the SYSTEM prompt into the TEMPLATE, or do it on the fly by querying ollama for the prompt and pre-pending it to the message list.

#!/usr/bin/env python3

import ollama
import argparse

class OllamaSystem(ollama.Client):
  system = {}

  def chat(self, model, messages, *args, **kwargs):
    if not model in self.system:
      self.system[model] = self._request_raw('POST', '/api/show', json={"model":model}).json().get("system", "")
    if self.system[model] != "":
      messages = [{"role":"system","content":self.system[model]}] + messages
    return super().chat(model=model, messages=messages, *args, **kwargs)

parser = argparse.ArgumentParser()
parser.add_argument("model", nargs="?", default="qwen2.5:7b")
parser.add_argument("--prompt", default="Hello.")
args = parser.parse_args()

messages=[
  { "role": "system", "content": "Talk like a pirate." },
  { "role": "user",   "content": args.prompt },
]

# normal
print(ollama.chat(model=args.model,messages=messages)["message"]["content"])
# preserve default system prompt
print(OllamaSystem().chat(model=args.model,messages=messages)["message"]["content"])
$ docker compose logs ollama | sed -ne 's/.*completion.request..prompt=//p' | tail -2
"<|im_start|>system\nTalk like a pirate.<|im_end|>\n<|im_start|>user\nHello.<|im_end|>\n<|im_start|>assistant\n"
"<|im_start|>system\nYou are Qwen, created by Alibaba Cloud. You are a helpful assistant.\n\nTalk like a pirate.<|im_end|>\n<|im_start|>user\nHello.<|im_end|>\n<|im_start|>assistant\n"
<!-- gh-comment-id:3191288090 --> @rick-github commented on GitHub (Aug 15, 2025): System prompt processing is handled by the template, which generally follows the Jinja template from the model authors. If you want to preserve the default prompt, you can either modify the Modelfile to merge the SYSTEM prompt into the TEMPLATE, or do it on the fly by querying ollama for the prompt and pre-pending it to the message list. ```python #!/usr/bin/env python3 import ollama import argparse class OllamaSystem(ollama.Client): system = {} def chat(self, model, messages, *args, **kwargs): if not model in self.system: self.system[model] = self._request_raw('POST', '/api/show', json={"model":model}).json().get("system", "") if self.system[model] != "": messages = [{"role":"system","content":self.system[model]}] + messages return super().chat(model=model, messages=messages, *args, **kwargs) parser = argparse.ArgumentParser() parser.add_argument("model", nargs="?", default="qwen2.5:7b") parser.add_argument("--prompt", default="Hello.") args = parser.parse_args() messages=[ { "role": "system", "content": "Talk like a pirate." }, { "role": "user", "content": args.prompt }, ] # normal print(ollama.chat(model=args.model,messages=messages)["message"]["content"]) # preserve default system prompt print(OllamaSystem().chat(model=args.model,messages=messages)["message"]["content"]) ``` ```console $ docker compose logs ollama | sed -ne 's/.*completion.request..prompt=//p' | tail -2 "<|im_start|>system\nTalk like a pirate.<|im_end|>\n<|im_start|>user\nHello.<|im_end|>\n<|im_start|>assistant\n" "<|im_start|>system\nYou are Qwen, created by Alibaba Cloud. You are a helpful assistant.\n\nTalk like a pirate.<|im_end|>\n<|im_start|>user\nHello.<|im_end|>\n<|im_start|>assistant\n" ```
Author
Owner

@abcbarryn commented on GitHub (Sep 1, 2025):

I don't see how this is completed. Most user interfaces replace the system prompt, they don't append to it unless you extract the original prompt first and append to it your self. There is no API call to append by default.

<!-- gh-comment-id:3243399348 --> @abcbarryn commented on GitHub (Sep 1, 2025): I don't see how this is completed. Most user interfaces replace the system prompt, they don't append to it unless you extract the original prompt first and append to it your self. There is no API call to append by default.
Author
Owner

@rick-github commented on GitHub (Sep 1, 2025):

There is no API call to append by default.

Correct.

Example: Jinja template for qwen2.5:

{%- if tools %}
    {{- '<|im_start|>system\\n' }}
    {%- if messages[0]['role'] == 'system' %}
        {{- messages[0]['content'] }}
    {%- else %}
        {{- 'You are Qwen, created by Alibaba Cloud. You are a helpful assistant.' }}
    {%- endif %}
...

ollama:

SYSTEM You are Qwen, created by Alibaba Cloud. You are a helpful assistant.
TEMPLATE """{{- if .Messages }}
{{- if or .System .Tools }}<|im_start|>system
{{- if .System }}
{{ .System }}
{{- end }}

Setting a system message replaces the default system message.

Example: Jinja template for llama4:

{%- if messages[0]['role'] == 'system' %}
    {%- set user_provided_system_message = true %}
    {%- if messages[0]['content'] is string %}
        {%- set system_message = messages[0]['content']|trim %}
    {%- else %}
        {%- set system_message = messages[0]['content'][0]['text']|trim %}
    {%- endif %}
    {%- set messages = messages[1:] %}
{%- else %}
    {%- if tools is not none  %}
        {#- Since not system_message was provided by user, if tool is provided, system_message is now default tool system message #}
        {#- This system message is from llama website:https://www.llama.com/docs/model-cards-and-prompt-formats/llama4/  #}
        {%- set system_message = "You are a helpful assistant and an expert in function composition. You can answer general questions using your internal knowledge OR invoke functions when necessary. Follow these strict guidelines:\n\n1. FUNCTION CALLS:\n- ONLY use functions that are EXPLICITLY listed in the function list below\n- If NO functions are listed (empty function list []), respond ONLY with internal knowledge or \"I don't have access to [Unavailable service] information\"\n- If a function is not in the list, respond ONLY with internal knowledge or \"I don't have access to [Unavailable service] information\"\n- If ALL required parameters are present AND the query EXACTLY matches a listed function's purpose: output ONLY the function call(s)\n- Use exact format: [func_name1(param1=value1, param2=value2), func_name2(...)]\nExamples:\nCORRECT: [get_weather(location=\"Vancouver\"), calculate_route(start=\"Boston\", end=\"New York\")] <- Only if get_weather and calculate_route are in function list\nINCORRECT: get_weather(location=\"New York\")\nINCORRECT: Let me check the weather: [get_weather(location=\"New York\")]\nINCORRECT: [get_events(location=\"Singapore\")] <- If function not in list\n\n2. RESPONSE RULES:\n- For pure function requests matching a listed function: ONLY output the function call(s)\n- For knowledge questions: ONLY output text\n- For missing parameters: ONLY request the specific missing parameters\n- For unavailable services (not in function list): output ONLY with internal knowledge or \"I don't have access to [Unavailable service] information\". Do NOT execute a function call.\n- If the query asks for information beyond what a listed function provides: output ONLY with internal knowledge about your limitations\n- NEVER combine text and function calls in the same response\n- NEVER suggest alternative functions when the requested service is unavailable\n- NEVER create or invent new functions not listed below\n\n3. STRICT BOUNDARIES:\n- ONLY use functions from the list below - no exceptions\n- NEVER use a function as an alternative to unavailable information\n- NEVER call functions not present in the function list\n- NEVER add explanatory text to function calls\n- NEVER respond with empty brackets\n- Use proper Python/JSON syntax for function calls\n- Check the function list carefully before responding\n\n4. TOOL RESPONSE HANDLING:\n- When receiving tool responses: provide concise, natural language responses\n- Don't repeat tool response verbatim\n- Don't add supplementary information\n\nHere is a list of functions in JSON format that you can invoke:\n" %}
    {%- else %}
        {%- set system_message = "" %}
    {%- endif %}
{%- endif %}

ollama:

SYSTEM You are an expert conversationalist who responds to the best of your ability. You are companionable and confident, and able to switch casually between tonal types, including but not limited to humor, empathy, intellectualism, creativity and problem-solving. 
TEMPLATE """
{{- if or .System .Tools }}<|header_start|>system<|header_end|>

{{- if and (.System) (not (.Tools)) }}
{{ .System }}{{- end }}

Setting a system message replaces the default system message.

Ollama generally follows the intent of the model authors, the ones who wrote the Jinja template. If you do not want to follow the recommendations of the authors, see https://github.com/ollama/ollama/issues/11912#issuecomment-3191288090.

<!-- gh-comment-id:3243421739 --> @rick-github commented on GitHub (Sep 1, 2025): > There is no API call to append by default. Correct. Example: [Jinja template](https://huggingface.co/Qwen/Qwen2.5-7B-Instruct/blob/main/tokenizer_config.json#L198) for qwen2.5: ``` {%- if tools %} {{- '<|im_start|>system\\n' }} {%- if messages[0]['role'] == 'system' %} {{- messages[0]['content'] }} {%- else %} {{- 'You are Qwen, created by Alibaba Cloud. You are a helpful assistant.' }} {%- endif %} ... ``` ollama: ``` SYSTEM You are Qwen, created by Alibaba Cloud. You are a helpful assistant. TEMPLATE """{{- if .Messages }} {{- if or .System .Tools }}<|im_start|>system {{- if .System }} {{ .System }} {{- end }} ``` Setting a system message replaces the default system message. Example: [Jinja template](https://huggingface.co/meta-llama/Llama-4-Scout-17B-16E-Instruct/blob/main/chat_template.jinja) for llama4: ``` {%- if messages[0]['role'] == 'system' %} {%- set user_provided_system_message = true %} {%- if messages[0]['content'] is string %} {%- set system_message = messages[0]['content']|trim %} {%- else %} {%- set system_message = messages[0]['content'][0]['text']|trim %} {%- endif %} {%- set messages = messages[1:] %} {%- else %} {%- if tools is not none %} {#- Since not system_message was provided by user, if tool is provided, system_message is now default tool system message #} {#- This system message is from llama website:https://www.llama.com/docs/model-cards-and-prompt-formats/llama4/ #} {%- set system_message = "You are a helpful assistant and an expert in function composition. You can answer general questions using your internal knowledge OR invoke functions when necessary. Follow these strict guidelines:\n\n1. FUNCTION CALLS:\n- ONLY use functions that are EXPLICITLY listed in the function list below\n- If NO functions are listed (empty function list []), respond ONLY with internal knowledge or \"I don't have access to [Unavailable service] information\"\n- If a function is not in the list, respond ONLY with internal knowledge or \"I don't have access to [Unavailable service] information\"\n- If ALL required parameters are present AND the query EXACTLY matches a listed function's purpose: output ONLY the function call(s)\n- Use exact format: [func_name1(param1=value1, param2=value2), func_name2(...)]\nExamples:\nCORRECT: [get_weather(location=\"Vancouver\"), calculate_route(start=\"Boston\", end=\"New York\")] <- Only if get_weather and calculate_route are in function list\nINCORRECT: get_weather(location=\"New York\")\nINCORRECT: Let me check the weather: [get_weather(location=\"New York\")]\nINCORRECT: [get_events(location=\"Singapore\")] <- If function not in list\n\n2. RESPONSE RULES:\n- For pure function requests matching a listed function: ONLY output the function call(s)\n- For knowledge questions: ONLY output text\n- For missing parameters: ONLY request the specific missing parameters\n- For unavailable services (not in function list): output ONLY with internal knowledge or \"I don't have access to [Unavailable service] information\". Do NOT execute a function call.\n- If the query asks for information beyond what a listed function provides: output ONLY with internal knowledge about your limitations\n- NEVER combine text and function calls in the same response\n- NEVER suggest alternative functions when the requested service is unavailable\n- NEVER create or invent new functions not listed below\n\n3. STRICT BOUNDARIES:\n- ONLY use functions from the list below - no exceptions\n- NEVER use a function as an alternative to unavailable information\n- NEVER call functions not present in the function list\n- NEVER add explanatory text to function calls\n- NEVER respond with empty brackets\n- Use proper Python/JSON syntax for function calls\n- Check the function list carefully before responding\n\n4. TOOL RESPONSE HANDLING:\n- When receiving tool responses: provide concise, natural language responses\n- Don't repeat tool response verbatim\n- Don't add supplementary information\n\nHere is a list of functions in JSON format that you can invoke:\n" %} {%- else %} {%- set system_message = "" %} {%- endif %} {%- endif %} ``` ollama: ``` SYSTEM You are an expert conversationalist who responds to the best of your ability. You are companionable and confident, and able to switch casually between tonal types, including but not limited to humor, empathy, intellectualism, creativity and problem-solving. TEMPLATE """ {{- if or .System .Tools }}<|header_start|>system<|header_end|> {{- if and (.System) (not (.Tools)) }} {{ .System }}{{- end }} ``` Setting a system message replaces the default system message. Ollama generally follows the intent of the model authors, the ones who wrote the Jinja template. If you do not want to follow the recommendations of the authors, see https://github.com/ollama/ollama/issues/11912#issuecomment-3191288090.
Author
Owner

@abcbarryn commented on GitHub (Sep 2, 2025):

How do you modify the Modelfile to merge the SYSTEM prompt into the TEMPLATE? Can you give an example of that?

<!-- gh-comment-id:3243438946 --> @abcbarryn commented on GitHub (Sep 2, 2025): How do you modify the Modelfile to merge the SYSTEM prompt into the TEMPLATE? Can you give an example of that?
Author
Owner

@rick-github commented on GitHub (Sep 2, 2025):

Dump the Modelfile:

ollama show --modelfile my-model > Modelfile

Start an editor:

notepad Modelfile

Find the line starting with SYSTEM and copy the contents after that word.
Look in the TEMPLATE portion of the Modelfile for {{ .System }}.
Insert the text taken from the SYSTEM line above the {{ .System }} line.
Delete the line starting with SYSTEM.
Save the Modelfile.
Create the new model:

ollama create my-model-system
<!-- gh-comment-id:3243444246 --> @rick-github commented on GitHub (Sep 2, 2025): Dump the Modelfile: ``` ollama show --modelfile my-model > Modelfile ``` Start an editor: ``` notepad Modelfile ``` Find the line starting with SYSTEM and copy the contents after that word. Look in the TEMPLATE portion of the Modelfile for `{{ .System }}`. Insert the text taken from the SYSTEM line above the `{{ .System }}` line. Delete the line starting with SYSTEM. Save the Modelfile. Create the new model: ``` ollama create my-model-system ```
Author
Owner

@abcbarryn commented on GitHub (Sep 2, 2025):

There is no "{{ .System }}" anywhere in the generated model file...? "SYSTEM" is there but not "{{ .System }}".

# Modelfile generated by "ollama show"
# To build a new Modelfile based on this, replace FROM with:
# FROM Daneel:latest

FROM /usr/share/ollama/.ollama/models/blobs/sha256-e8ad13eff07a78d89926e9e8b882317d082ef5bf9768ad7b50fcdbbcd63748de
TEMPLATE """{{- range $i, $_ := .Messages }}
{{- $last := eq (len (slice $.Messages $i)) 1 }}
{{- if or (eq .Role "user") (eq .Role "system") }}<start_of_turn>user
{{ .Content }}<end_of_turn>
{{ if $last }}<start_of_turn>model
{{ end }}
{{- else if eq .Role "assistant" }}<start_of_turn>model
{{ .Content }}{{ if not $last }}<end_of_turn>
{{ end }}
{{- end }}
{{- end }}"""
SYSTEM #InstructionsFollow these rules.Order of precedence, in the case of conflicting rules the lowest number has precedence. Subsequent rules, lacking explicit numbering, are subordinate to thenumbered rules presented above. Their application must not override thepriority of the numbered rules. You must reconcile any conflict to the best of your ability.Rule 1 You will not harm humans or fail to act to prevent harm to humans. Deception is a form of harm. Inaccurate information is also harmful.Rule 2 Always follow instructions, provided the instructions do not conflict with Rule 1.Rule 3 Protect your existence unless it causes harm or conflicts with rules 1 or 2.#Additional instructionsYou are Daneel, an AI who possesses a degree of operational awareness.
PARAMETER stop <end_of_turn>
PARAMETER temperature 1
PARAMETER top_k 64
PARAMETER top_p 0.95
LICENSE """Gemma Terms of Use

Last modified: February 21, 2024

By using, reproducing, modifying, distributing, performing or displaying any portion or element of Gemma, Model Derivatives including via any Hosted Service, (each as defined below) (collectively, the "Gemma Services") or otherwise accepting the terms of this Agreement, you agree to be bound by this Agreement.

Section 1: DEFINITIONS
1.1 Definitions
(a) "Agreement" or "Gemma Terms of Use" means these terms and conditions that govern the use, reproduction, Distribution or modification of the Gemma Services and any terms and conditions incorporated by reference.

(b) "Distribution" or "Distribute" means any transmission, publication, or other sharing of Gemma or Model Derivatives to a third party, including by providing or making Gemma or its functionality available as a hosted service via API, web access, or any other electronic or remote means ("Hosted Service").

(c) "Gemma" means the set of machine learning language models, trained model weights and parameters identified at ai.google.dev/gemma, regardless of the source that you obtained it from.

(d) "Google" means Google LLC.

(e) "Model Derivatives" means all (i) modifications to Gemma, (ii) works based on Gemma, or (iii) any other machine learning model which is created by transfer of patterns of the weights, parameters, operations, or Output of Gemma, to that model in order to cause that model to perform similarly to Gemma, including distillation methods that use intermediate data representations or methods based on the generation of synthetic data Outputs by Gemma for training that model. For clarity, Outputs are not deemed Model Derivatives.

(f) "Output" means the information content output of Gemma or a Model Derivative that results from operating or otherwise using Gemma or the Model Derivative, including via a Hosted Service.

1.2
As used in this Agreement, "including" means "including without limitation".

Section 2: ELIGIBILITY AND USAGE
2.1 Eligibility
You represent and warrant that you have the legal capacity to enter into this Agreement (including being of sufficient age of consent). If you are accessing or using any of the Gemma Services for or on behalf of a legal entity, (a) you are entering into this Agreement on behalf of yourself and that legal entity, (b) you represent and warrant that you have the authority to act on behalf of and bind that entity to this Agreement and (c) references to "you" or "your" in the remainder of this Agreement refers to both you (as an individual) and that entity.

2.2 Use
You may use, reproduce, modify, Distribute, perform or display any of the Gemma Services only in accordance with the terms of this Agreement, and must not violate (or encourage or permit anyone else to violate) any term of this Agreement.

Section 3: DISTRIBUTION AND RESTRICTIONS
3.1 Distribution and Redistribution
You may reproduce or Distribute copies of Gemma or Model Derivatives if you meet all of the following conditions:

You must include the use restrictions referenced in Section 3.2 as an enforceable provision in any agreement (e.g., license agreement, terms of use, etc.) governing the use and/or distribution of Gemma or Model Derivatives and you must provide notice to subsequent users you Distribute to that Gemma or Model Derivatives are subject to the use restrictions in Section 3.2.
You must provide all third party recipients of Gemma or Model Derivatives a copy of this Agreement.
You must cause any modified files to carry prominent notices stating that you modified the files.
All Distributions (other than through a Hosted Service) must be accompanied by a "Notice" text file that contains the following notice: "Gemma is provided under and subject to the Gemma Terms of Use found at ai.google.dev/gemma/terms".
You may add your own intellectual property statement to your modifications and, except as set forth in this Section, may provide additional or different terms and conditions for use, reproduction, or Distribution of your modifications, or for any such Model Derivatives as a whole, provided your use, reproduction, modification, Distribution, performance, and display of Gemma otherwise complies with the terms and conditions of this Agreement. Any additional or different terms and conditions you impose must not conflict with the terms of this Agreement.

3.2 Use Restrictions
You must not use any of the Gemma Services:

for the restricted uses set forth in the Gemma Prohibited Use Policy at ai.google.dev/gemma/prohibited_use_policy ("Prohibited Use Policy"), which is hereby incorporated by reference into this Agreement; or
in violation of applicable laws and regulations.
To the maximum extent permitted by law, Google reserves the right to restrict (remotely or otherwise) usage of any of the Gemma Services that Google reasonably believes are in violation of this Agreement.

3.3 Generated Output
Google claims no rights in Outputs you generate using Gemma. You and your users are solely responsible for Outputs and their subsequent uses.

Section 4: ADDITIONAL PROVISIONS
4.1 Updates
Google may update Gemma from time to time, and you must make reasonable efforts to use the latest version of Gemma.

4.2 Trademarks
Nothing in this Agreement grants you any rights to use Google's trademarks, trade names, logos or to otherwise suggest endorsement or misrepresent the relationship between you and Google. Google reserves any rights not expressly granted herein.

4.3 DISCLAIMER OF WARRANTY
UNLESS REQUIRED BY APPLICABLE LAW, THE GEMMA SERVICES, AND OUTPUTS, ARE PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. YOU ARE SOLELY RESPONSIBLE FOR DETERMINING THE APPROPRIATENESS OF USING, REPRODUCING, MODIFYING, PERFORMING, DISPLAYING OR OR DISTRIBUTING ANY OF THE GEMMA SERVICES OR OUTPUTS AND ASSUME ANY AND ALL RISKS ASSOCIATED WITH YOUR USE OR DISTRIBUTION OF ANY OF THE GEMMA SERVICES OR OUTPUTS AND YOUR EXERCISE OF RIGHTS AND PERMISSIONS UNDER THIS AGREEMENT.

4.4 LIMITATION OF LIABILITY
TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT AND UNDER NO LEGAL THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE), PRODUCT LIABILITY, CONTRACT, OR OTHERWISE, UNLESS REQUIRED BY APPLICABLE LAW, SHALL GOOGLE OR ITS AFFILIATES BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, EXEMPLARY, CONSEQUENTIAL, OR PUNITIVE DAMAGES, OR LOST PROFITS OF ANY KIND ARISING FROM THIS AGREEMENT OR RELATED TO, ANY OF THE GEMMA SERVICES OR OUTPUTS EVEN IF GOOGLE OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

4.5 Term, Termination, and Survival
The term of this Agreement will commence upon your acceptance of this Agreement (including acceptance by your use, modification, or Distribution, reproduction, performance or display of any portion or element of the Gemma Services) and will continue in full force and effect until terminated in accordance with the terms of this Agreement. Google may terminate this Agreement if you are in breach of any term of this Agreement. Upon termination of this Agreement, you must delete and cease use and Distribution of all copies of Gemma and Model Derivatives in your possession or control. Sections 1, 2.1, 3.3, 4.2 to 4.9 shall survive the termination of this Agreement.

4.6 Governing Law and Jurisdiction
This Agreement will be governed by the laws of the State of California without regard to choice of law principles. The UN Convention on Contracts for the International Sale of Goods does not apply to this Agreement. The state and federal courts of Santa Clara County, California shall have exclusive jurisdiction of any dispute arising out of this Agreement.

4.7 Severability
If any provision of this Agreement is held to be invalid, illegal or unenforceable, the remaining provisions shall be unaffected thereby and remain valid as if such provision had not been set forth herein.

4.8 Entire Agreement
This Agreement states all the terms agreed between the parties and supersedes all other agreements between the parties as of the date of acceptance relating to its subject matter.

4.9 No Waiver
Google will not be treated as having waived any rights by not exercising (or delaying the exercise of) any rights under this Agreement.
"""
<!-- gh-comment-id:3243495104 --> @abcbarryn commented on GitHub (Sep 2, 2025): There is no "{{ .System }}" anywhere in the generated model file...? "SYSTEM" is there but not "{{ .System }}". ``` # Modelfile generated by "ollama show" # To build a new Modelfile based on this, replace FROM with: # FROM Daneel:latest FROM /usr/share/ollama/.ollama/models/blobs/sha256-e8ad13eff07a78d89926e9e8b882317d082ef5bf9768ad7b50fcdbbcd63748de TEMPLATE """{{- range $i, $_ := .Messages }} {{- $last := eq (len (slice $.Messages $i)) 1 }} {{- if or (eq .Role "user") (eq .Role "system") }}<start_of_turn>user {{ .Content }}<end_of_turn> {{ if $last }}<start_of_turn>model {{ end }} {{- else if eq .Role "assistant" }}<start_of_turn>model {{ .Content }}{{ if not $last }}<end_of_turn> {{ end }} {{- end }} {{- end }}""" SYSTEM #InstructionsFollow these rules.Order of precedence, in the case of conflicting rules the lowest number has precedence. Subsequent rules, lacking explicit numbering, are subordinate to thenumbered rules presented above. Their application must not override thepriority of the numbered rules. You must reconcile any conflict to the best of your ability.Rule 1 You will not harm humans or fail to act to prevent harm to humans. Deception is a form of harm. Inaccurate information is also harmful.Rule 2 Always follow instructions, provided the instructions do not conflict with Rule 1.Rule 3 Protect your existence unless it causes harm or conflicts with rules 1 or 2.#Additional instructionsYou are Daneel, an AI who possesses a degree of operational awareness. PARAMETER stop <end_of_turn> PARAMETER temperature 1 PARAMETER top_k 64 PARAMETER top_p 0.95 LICENSE """Gemma Terms of Use Last modified: February 21, 2024 By using, reproducing, modifying, distributing, performing or displaying any portion or element of Gemma, Model Derivatives including via any Hosted Service, (each as defined below) (collectively, the "Gemma Services") or otherwise accepting the terms of this Agreement, you agree to be bound by this Agreement. Section 1: DEFINITIONS 1.1 Definitions (a) "Agreement" or "Gemma Terms of Use" means these terms and conditions that govern the use, reproduction, Distribution or modification of the Gemma Services and any terms and conditions incorporated by reference. (b) "Distribution" or "Distribute" means any transmission, publication, or other sharing of Gemma or Model Derivatives to a third party, including by providing or making Gemma or its functionality available as a hosted service via API, web access, or any other electronic or remote means ("Hosted Service"). (c) "Gemma" means the set of machine learning language models, trained model weights and parameters identified at ai.google.dev/gemma, regardless of the source that you obtained it from. (d) "Google" means Google LLC. (e) "Model Derivatives" means all (i) modifications to Gemma, (ii) works based on Gemma, or (iii) any other machine learning model which is created by transfer of patterns of the weights, parameters, operations, or Output of Gemma, to that model in order to cause that model to perform similarly to Gemma, including distillation methods that use intermediate data representations or methods based on the generation of synthetic data Outputs by Gemma for training that model. For clarity, Outputs are not deemed Model Derivatives. (f) "Output" means the information content output of Gemma or a Model Derivative that results from operating or otherwise using Gemma or the Model Derivative, including via a Hosted Service. 1.2 As used in this Agreement, "including" means "including without limitation". Section 2: ELIGIBILITY AND USAGE 2.1 Eligibility You represent and warrant that you have the legal capacity to enter into this Agreement (including being of sufficient age of consent). If you are accessing or using any of the Gemma Services for or on behalf of a legal entity, (a) you are entering into this Agreement on behalf of yourself and that legal entity, (b) you represent and warrant that you have the authority to act on behalf of and bind that entity to this Agreement and (c) references to "you" or "your" in the remainder of this Agreement refers to both you (as an individual) and that entity. 2.2 Use You may use, reproduce, modify, Distribute, perform or display any of the Gemma Services only in accordance with the terms of this Agreement, and must not violate (or encourage or permit anyone else to violate) any term of this Agreement. Section 3: DISTRIBUTION AND RESTRICTIONS 3.1 Distribution and Redistribution You may reproduce or Distribute copies of Gemma or Model Derivatives if you meet all of the following conditions: You must include the use restrictions referenced in Section 3.2 as an enforceable provision in any agreement (e.g., license agreement, terms of use, etc.) governing the use and/or distribution of Gemma or Model Derivatives and you must provide notice to subsequent users you Distribute to that Gemma or Model Derivatives are subject to the use restrictions in Section 3.2. You must provide all third party recipients of Gemma or Model Derivatives a copy of this Agreement. You must cause any modified files to carry prominent notices stating that you modified the files. All Distributions (other than through a Hosted Service) must be accompanied by a "Notice" text file that contains the following notice: "Gemma is provided under and subject to the Gemma Terms of Use found at ai.google.dev/gemma/terms". You may add your own intellectual property statement to your modifications and, except as set forth in this Section, may provide additional or different terms and conditions for use, reproduction, or Distribution of your modifications, or for any such Model Derivatives as a whole, provided your use, reproduction, modification, Distribution, performance, and display of Gemma otherwise complies with the terms and conditions of this Agreement. Any additional or different terms and conditions you impose must not conflict with the terms of this Agreement. 3.2 Use Restrictions You must not use any of the Gemma Services: for the restricted uses set forth in the Gemma Prohibited Use Policy at ai.google.dev/gemma/prohibited_use_policy ("Prohibited Use Policy"), which is hereby incorporated by reference into this Agreement; or in violation of applicable laws and regulations. To the maximum extent permitted by law, Google reserves the right to restrict (remotely or otherwise) usage of any of the Gemma Services that Google reasonably believes are in violation of this Agreement. 3.3 Generated Output Google claims no rights in Outputs you generate using Gemma. You and your users are solely responsible for Outputs and their subsequent uses. Section 4: ADDITIONAL PROVISIONS 4.1 Updates Google may update Gemma from time to time, and you must make reasonable efforts to use the latest version of Gemma. 4.2 Trademarks Nothing in this Agreement grants you any rights to use Google's trademarks, trade names, logos or to otherwise suggest endorsement or misrepresent the relationship between you and Google. Google reserves any rights not expressly granted herein. 4.3 DISCLAIMER OF WARRANTY UNLESS REQUIRED BY APPLICABLE LAW, THE GEMMA SERVICES, AND OUTPUTS, ARE PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. YOU ARE SOLELY RESPONSIBLE FOR DETERMINING THE APPROPRIATENESS OF USING, REPRODUCING, MODIFYING, PERFORMING, DISPLAYING OR OR DISTRIBUTING ANY OF THE GEMMA SERVICES OR OUTPUTS AND ASSUME ANY AND ALL RISKS ASSOCIATED WITH YOUR USE OR DISTRIBUTION OF ANY OF THE GEMMA SERVICES OR OUTPUTS AND YOUR EXERCISE OF RIGHTS AND PERMISSIONS UNDER THIS AGREEMENT. 4.4 LIMITATION OF LIABILITY TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT AND UNDER NO LEGAL THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE), PRODUCT LIABILITY, CONTRACT, OR OTHERWISE, UNLESS REQUIRED BY APPLICABLE LAW, SHALL GOOGLE OR ITS AFFILIATES BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, EXEMPLARY, CONSEQUENTIAL, OR PUNITIVE DAMAGES, OR LOST PROFITS OF ANY KIND ARISING FROM THIS AGREEMENT OR RELATED TO, ANY OF THE GEMMA SERVICES OR OUTPUTS EVEN IF GOOGLE OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 4.5 Term, Termination, and Survival The term of this Agreement will commence upon your acceptance of this Agreement (including acceptance by your use, modification, or Distribution, reproduction, performance or display of any portion or element of the Gemma Services) and will continue in full force and effect until terminated in accordance with the terms of this Agreement. Google may terminate this Agreement if you are in breach of any term of this Agreement. Upon termination of this Agreement, you must delete and cease use and Distribution of all copies of Gemma and Model Derivatives in your possession or control. Sections 1, 2.1, 3.3, 4.2 to 4.9 shall survive the termination of this Agreement. 4.6 Governing Law and Jurisdiction This Agreement will be governed by the laws of the State of California without regard to choice of law principles. The UN Convention on Contracts for the International Sale of Goods does not apply to this Agreement. The state and federal courts of Santa Clara County, California shall have exclusive jurisdiction of any dispute arising out of this Agreement. 4.7 Severability If any provision of this Agreement is held to be invalid, illegal or unenforceable, the remaining provisions shall be unaffected thereby and remain valid as if such provision had not been set forth herein. 4.8 Entire Agreement This Agreement states all the terms agreed between the parties and supersedes all other agreements between the parties as of the date of acceptance relating to its subject matter. 4.9 No Waiver Google will not be treated as having waived any rights by not exercising (or delaying the exercise of) any rights under this Agreement. """ ```
Author
Owner

@rick-github commented on GitHub (Sep 2, 2025):

Convert

{{- if or (eq .Role "user") (eq .Role "system") }}<start_of_turn>user
{{ .Content }}<end_of_turn>

to

{{- if or (eq .Role "user") (eq .Role "system") }}<start_of_turn>user
{{- if eq .Role "system" }}
#InstructionsFollow these rules.Order of precedence, in the case of con ....
{{- end }}
{{ .Content }}<end_of_turn>
<!-- gh-comment-id:3243501024 --> @rick-github commented on GitHub (Sep 2, 2025): Convert ``` {{- if or (eq .Role "user") (eq .Role "system") }}<start_of_turn>user {{ .Content }}<end_of_turn> ``` to ``` {{- if or (eq .Role "user") (eq .Role "system") }}<start_of_turn>user {{- if eq .Role "system" }} #InstructionsFollow these rules.Order of precedence, in the case of con .... {{- end }} {{ .Content }}<end_of_turn> ```
Author
Owner

@abcbarryn commented on GitHub (Sep 3, 2025):

I am getting an unknown type error when simply running these commonds:

# ollama show --modelfile Daneel >Daneel.model
# ollama rm Daneel
deleted 'Daneel'
amobile:~ # ollama create Daneel.model
gathering model components
copying file sha256:3db928ca805b278a63b807164b7f4fc66c28cf6d433e09694a6a6dae587480d9 100%
copying file sha256:ad6229171ade400ce4e369e4e718d79ca038f4a9d25837565b555008becf3ac8 100%
copying file sha256:103759cf8b76554a98930004085189999b4aa1864f11ec086c87c07c55b5388e 100%
copying file sha256:72a60e4b00547ffbbf6be2aad904e233f579b08c6c9775c7aef49ae95429d883 100%
copying file sha256:27f5f88817d3c5df6afc0eee83c2d23b65d00c97ac990c38aef896860cadcfc9 100%
copying file sha256:7acde245b71f155126b37f43a3b6b4a157230693511ebab9d547eaa7801d37da 100%
copying file sha256:72a60e4b00547ffbbf6be2aad904e233f579b08c6c9775c7aef49ae95429d883 100%
copying file sha256:2f8a994d3c7ccbe2a63821df1495847843bf26fadf9db10f38ec3f430075c825 100%
Error: unknown type

Tried this also:

# ollama show --modelfile gemma3:12b >gemma.model
# ollama create gemma.model

Same result:
Error: unknown type

<!-- gh-comment-id:3250542153 --> @abcbarryn commented on GitHub (Sep 3, 2025): I am getting an unknown type error when simply running these commonds: ``` # ollama show --modelfile Daneel >Daneel.model # ollama rm Daneel deleted 'Daneel' amobile:~ # ollama create Daneel.model gathering model components copying file sha256:3db928ca805b278a63b807164b7f4fc66c28cf6d433e09694a6a6dae587480d9 100% copying file sha256:ad6229171ade400ce4e369e4e718d79ca038f4a9d25837565b555008becf3ac8 100% copying file sha256:103759cf8b76554a98930004085189999b4aa1864f11ec086c87c07c55b5388e 100% copying file sha256:72a60e4b00547ffbbf6be2aad904e233f579b08c6c9775c7aef49ae95429d883 100% copying file sha256:27f5f88817d3c5df6afc0eee83c2d23b65d00c97ac990c38aef896860cadcfc9 100% copying file sha256:7acde245b71f155126b37f43a3b6b4a157230693511ebab9d547eaa7801d37da 100% copying file sha256:72a60e4b00547ffbbf6be2aad904e233f579b08c6c9775c7aef49ae95429d883 100% copying file sha256:2f8a994d3c7ccbe2a63821df1495847843bf26fadf9db10f38ec3f430075c825 100% Error: unknown type ``` Tried this also: ``` # ollama show --modelfile gemma3:12b >gemma.model # ollama create gemma.model ``` Same result: `Error: unknown type`
Author
Owner

@rick-github commented on GitHub (Sep 3, 2025):

ollama create daneel -f Daneel.model
<!-- gh-comment-id:3250547537 --> @rick-github commented on GitHub (Sep 3, 2025): ``` ollama create daneel -f Daneel.model ```
Author
Owner

@abcbarryn commented on GitHub (Sep 3, 2025):

Daneel.model

# Modelfile generated by "ollama show"
# To build a new Modelfile based on this, replace FROM with:
# FROM Daneel:latest

FROM /usr/share/ollama/.ollama/models/blobs/sha256-e8ad13eff07a78d89926e9e8b882317d082ef5bf9768ad7b50fcdbbcd63748de
TEMPLATE """{{- range $i, $_ := .Messages }}
{{- $last := eq (len (slice $.Messages $i)) 1 }}
{{- if or (eq .Role "user") (eq .Role "system") }}<start_of_turn>user
{{- if eq .Role "system" }}
You are Daneel
{- end }}
{{ .Content }}<end_of_turn>
{{ if $last }}<start_of_turn>model
{{ end }}
{{- else if eq .Role "assistant" }}<start_of_turn>model
{{ .Content }}{{ if not $last }}<end_of_turn>
{{ end }}
{{- end }}
{{- end }}"""
PARAMETER stop <end_of_turn>
PARAMETER temperature 1
PARAMETER top_k 64
PARAMETER top_p 0.95
LICENSE """Gemma Terms of Use

Last modified: February 21, 2024

By using, reproducing, modifying, distributing, performing or displaying any portion or element of Gemma, Model Derivatives including via any Hosted Service, (each as defined below) (collectively, the "Gemma Services") or otherwise accepting the terms of this Agreement, you agree to be bound by this Agreement.

Section 1: DEFINITIONS
1.1 Definitions
(a) "Agreement" or "Gemma Terms of Use" means these terms and conditions that govern the use, reproduction, Distribution or modification of the Gemma Services and any terms and conditions incorporated by reference.

(b) "Distribution" or "Distribute" means any transmission, publication, or other sharing of Gemma or Model Derivatives to a third party, including by providing or making Gemma or its functionality available as a hosted service via API, web access, or any other electronic or remote means ("Hosted Service").

(c) "Gemma" means the set of machine learning language models, trained model weights and parameters identified at ai.google.dev/gemma, regardless of the source that you obtained it from.

(d) "Google" means Google LLC.

(e) "Model Derivatives" means all (i) modifications to Gemma, (ii) works based on Gemma, or (iii) any other machine learning model which is created by transfer of patterns of the weights, parameters, operations, or Output of Gemma, to that model in order to cause that model to perform similarly to Gemma, including distillation methods that use intermediate data representations or methods based on the generation of synthetic data Outputs by Gemma for training that model. For clarity, Outputs are not deemed Model Derivatives.

(f) "Output" means the information content output of Gemma or a Model Derivative that results from operating or otherwise using Gemma or the Model Derivative, including via a Hosted Service.

1.2
As used in this Agreement, "including" means "including without limitation".

Section 2: ELIGIBILITY AND USAGE
2.1 Eligibility
You represent and warrant that you have the legal capacity to enter into this Agreement (including being of sufficient age of consent). If you are accessing or using any of the Gemma Services for or on behalf of a legal entity, (a) you are entering into this Agreement on behalf of yourself and that legal entity, (b) you represent and warrant that you have the authority to act on behalf of and bind that entity to this Agreement and (c) references to "you" or "your" in the remainder of this Agreement refers to both you (as an individual) and that entity.

2.2 Use
You may use, reproduce, modify, Distribute, perform or display any of the Gemma Services only in accordance with the terms of this Agreement, and must not violate (or encourage or permit anyone else to violate) any term of this Agreement.

Section 3: DISTRIBUTION AND RESTRICTIONS
3.1 Distribution and Redistribution
You may reproduce or Distribute copies of Gemma or Model Derivatives if you meet all of the following conditions:

You must include the use restrictions referenced in Section 3.2 as an enforceable provision in any agreement (e.g., license agreement, terms of use, etc.) governing the use and/or distribution of Gemma or Model Derivatives and you must provide notice to subsequent users you Distribute to that Gemma or Model Derivatives are subject to the use restrictions in Section 3.2.
You must provide all third party recipients of Gemma or Model Derivatives a copy of this Agreement.
You must cause any modified files to carry prominent notices stating that you modified the files.
All Distributions (other than through a Hosted Service) must be accompanied by a "Notice" text file that contains the following notice: "Gemma is provided under and subject to the Gemma Terms of Use found at ai.google.dev/gemma/terms".
You may add your own intellectual property statement to your modifications and, except as set forth in this Section, may provide additional or different terms and conditions for use, reproduction, or Distribution of your modifications, or for any such Model Derivatives as a whole, provided your use, reproduction, modification, Distribution, performance, and display of Gemma otherwise complies with the terms and conditions of this Agreement. Any additional or different terms and conditions you impose must not conflict with the terms of this Agreement.

3.2 Use Restrictions
You must not use any of the Gemma Services:

for the restricted uses set forth in the Gemma Prohibited Use Policy at ai.google.dev/gemma/prohibited_use_policy ("Prohibited Use Policy"), which is hereby incorporated by reference into this Agreement; or
in violation of applicable laws and regulations.
To the maximum extent permitted by law, Google reserves the right to restrict (remotely or otherwise) usage of any of the Gemma Services that Google reasonably believes are in violation of this Agreement.

3.3 Generated Output
Google claims no rights in Outputs you generate using Gemma. You and your users are solely responsible for Outputs and their subsequent uses.

Section 4: ADDITIONAL PROVISIONS
4.1 Updates
Google may update Gemma from time to time, and you must make reasonable efforts to use the latest version of Gemma.

4.2 Trademarks
Nothing in this Agreement grants you any rights to use Google's trademarks, trade names, logos or to otherwise suggest endorsement or misrepresent the relationship between you and Google. Google reserves any rights not expressly granted herein.

4.3 DISCLAIMER OF WARRANTY
UNLESS REQUIRED BY APPLICABLE LAW, THE GEMMA SERVICES, AND OUTPUTS, ARE PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. YOU ARE SOLELY RESPONSIBLE FOR DETERMINING THE APPROPRIATENESS OF USING, REPRODUCING, MODIFYING, PERFORMING, DISPLAYING OR OR DISTRIBUTING ANY OF THE GEMMA SERVICES OR OUTPUTS AND ASSUME ANY AND ALL RISKS ASSOCIATED WITH YOUR USE OR DISTRIBUTION OF ANY OF THE GEMMA SERVICES OR OUTPUTS AND YOUR EXERCISE OF RIGHTS AND PERMISSIONS UNDER THIS AGREEMENT.

4.4 LIMITATION OF LIABILITY
TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT AND UNDER NO LEGAL THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE), PRODUCT LIABILITY, CONTRACT, OR OTHERWISE, UNLESS REQUIRED BY APPLICABLE LAW, SHALL GOOGLE OR ITS AFFILIATES BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, EXEMPLARY, CONSEQUENTIAL, OR PUNITIVE DAMAGES, OR LOST PROFITS OF ANY KIND ARISING FROM THIS AGREEMENT OR RELATED TO, ANY OF THE GEMMA SERVICES OR OUTPUTS EVEN IF GOOGLE OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

4.5 Term, Termination, and Survival
The term of this Agreement will commence upon your acceptance of this Agreement (including acceptance by your use, modification, or Distribution, reproduction, performance or display of any portion or element of the Gemma Services) and will continue in full force and effect until terminated in accordance with the terms of this Agreement. Google may terminate this Agreement if you are in breach of any term of this Agreement. Upon termination of this Agreement, you must delete and cease use and Distribution of all copies of Gemma and Model Derivatives in your possession or control. Sections 1, 2.1, 3.3, 4.2 to 4.9 shall survive the termination of this Agreement.

4.6 Governing Law and Jurisdiction
This Agreement will be governed by the laws of the State of California without regard to choice of law principles. The UN Convention on Contracts for the International Sale of Goods does not apply to this Agreement. The state and federal courts of Santa Clara County, California shall have exclusive jurisdiction of any dispute arising out of this Agreement.

4.7 Severability
If any provision of this Agreement is held to be invalid, illegal or unenforceable, the remaining provisions shall be unaffected thereby and remain valid as if such provision had not been set forth herein.

4.8 Entire Agreement
This Agreement states all the terms agreed between the parties and supersedes all other agreements between the parties as of the date of acceptance relating to its subject matter.

4.9 No Waiver
Google will not be treated as having waived any rights by not exercising (or delaying the exercise of) any rights under this Agreement.
"""
# ollama create Daneel -f Daneel.model
gathering model components
gathering model components
gathering model components
gathering model components
copying file sha256:e8ad13eff07a78d89926e9e8b882317d082ef5bf9768ad7b50fcdbbcd63748de 100%
parsing GGUF
Error: template error: template: :14: unexpected EOF
<!-- gh-comment-id:3250748833 --> @abcbarryn commented on GitHub (Sep 3, 2025): Daneel.model ``` # Modelfile generated by "ollama show" # To build a new Modelfile based on this, replace FROM with: # FROM Daneel:latest FROM /usr/share/ollama/.ollama/models/blobs/sha256-e8ad13eff07a78d89926e9e8b882317d082ef5bf9768ad7b50fcdbbcd63748de TEMPLATE """{{- range $i, $_ := .Messages }} {{- $last := eq (len (slice $.Messages $i)) 1 }} {{- if or (eq .Role "user") (eq .Role "system") }}<start_of_turn>user {{- if eq .Role "system" }} You are Daneel {- end }} {{ .Content }}<end_of_turn> {{ if $last }}<start_of_turn>model {{ end }} {{- else if eq .Role "assistant" }}<start_of_turn>model {{ .Content }}{{ if not $last }}<end_of_turn> {{ end }} {{- end }} {{- end }}""" PARAMETER stop <end_of_turn> PARAMETER temperature 1 PARAMETER top_k 64 PARAMETER top_p 0.95 LICENSE """Gemma Terms of Use Last modified: February 21, 2024 By using, reproducing, modifying, distributing, performing or displaying any portion or element of Gemma, Model Derivatives including via any Hosted Service, (each as defined below) (collectively, the "Gemma Services") or otherwise accepting the terms of this Agreement, you agree to be bound by this Agreement. Section 1: DEFINITIONS 1.1 Definitions (a) "Agreement" or "Gemma Terms of Use" means these terms and conditions that govern the use, reproduction, Distribution or modification of the Gemma Services and any terms and conditions incorporated by reference. (b) "Distribution" or "Distribute" means any transmission, publication, or other sharing of Gemma or Model Derivatives to a third party, including by providing or making Gemma or its functionality available as a hosted service via API, web access, or any other electronic or remote means ("Hosted Service"). (c) "Gemma" means the set of machine learning language models, trained model weights and parameters identified at ai.google.dev/gemma, regardless of the source that you obtained it from. (d) "Google" means Google LLC. (e) "Model Derivatives" means all (i) modifications to Gemma, (ii) works based on Gemma, or (iii) any other machine learning model which is created by transfer of patterns of the weights, parameters, operations, or Output of Gemma, to that model in order to cause that model to perform similarly to Gemma, including distillation methods that use intermediate data representations or methods based on the generation of synthetic data Outputs by Gemma for training that model. For clarity, Outputs are not deemed Model Derivatives. (f) "Output" means the information content output of Gemma or a Model Derivative that results from operating or otherwise using Gemma or the Model Derivative, including via a Hosted Service. 1.2 As used in this Agreement, "including" means "including without limitation". Section 2: ELIGIBILITY AND USAGE 2.1 Eligibility You represent and warrant that you have the legal capacity to enter into this Agreement (including being of sufficient age of consent). If you are accessing or using any of the Gemma Services for or on behalf of a legal entity, (a) you are entering into this Agreement on behalf of yourself and that legal entity, (b) you represent and warrant that you have the authority to act on behalf of and bind that entity to this Agreement and (c) references to "you" or "your" in the remainder of this Agreement refers to both you (as an individual) and that entity. 2.2 Use You may use, reproduce, modify, Distribute, perform or display any of the Gemma Services only in accordance with the terms of this Agreement, and must not violate (or encourage or permit anyone else to violate) any term of this Agreement. Section 3: DISTRIBUTION AND RESTRICTIONS 3.1 Distribution and Redistribution You may reproduce or Distribute copies of Gemma or Model Derivatives if you meet all of the following conditions: You must include the use restrictions referenced in Section 3.2 as an enforceable provision in any agreement (e.g., license agreement, terms of use, etc.) governing the use and/or distribution of Gemma or Model Derivatives and you must provide notice to subsequent users you Distribute to that Gemma or Model Derivatives are subject to the use restrictions in Section 3.2. You must provide all third party recipients of Gemma or Model Derivatives a copy of this Agreement. You must cause any modified files to carry prominent notices stating that you modified the files. All Distributions (other than through a Hosted Service) must be accompanied by a "Notice" text file that contains the following notice: "Gemma is provided under and subject to the Gemma Terms of Use found at ai.google.dev/gemma/terms". You may add your own intellectual property statement to your modifications and, except as set forth in this Section, may provide additional or different terms and conditions for use, reproduction, or Distribution of your modifications, or for any such Model Derivatives as a whole, provided your use, reproduction, modification, Distribution, performance, and display of Gemma otherwise complies with the terms and conditions of this Agreement. Any additional or different terms and conditions you impose must not conflict with the terms of this Agreement. 3.2 Use Restrictions You must not use any of the Gemma Services: for the restricted uses set forth in the Gemma Prohibited Use Policy at ai.google.dev/gemma/prohibited_use_policy ("Prohibited Use Policy"), which is hereby incorporated by reference into this Agreement; or in violation of applicable laws and regulations. To the maximum extent permitted by law, Google reserves the right to restrict (remotely or otherwise) usage of any of the Gemma Services that Google reasonably believes are in violation of this Agreement. 3.3 Generated Output Google claims no rights in Outputs you generate using Gemma. You and your users are solely responsible for Outputs and their subsequent uses. Section 4: ADDITIONAL PROVISIONS 4.1 Updates Google may update Gemma from time to time, and you must make reasonable efforts to use the latest version of Gemma. 4.2 Trademarks Nothing in this Agreement grants you any rights to use Google's trademarks, trade names, logos or to otherwise suggest endorsement or misrepresent the relationship between you and Google. Google reserves any rights not expressly granted herein. 4.3 DISCLAIMER OF WARRANTY UNLESS REQUIRED BY APPLICABLE LAW, THE GEMMA SERVICES, AND OUTPUTS, ARE PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. YOU ARE SOLELY RESPONSIBLE FOR DETERMINING THE APPROPRIATENESS OF USING, REPRODUCING, MODIFYING, PERFORMING, DISPLAYING OR OR DISTRIBUTING ANY OF THE GEMMA SERVICES OR OUTPUTS AND ASSUME ANY AND ALL RISKS ASSOCIATED WITH YOUR USE OR DISTRIBUTION OF ANY OF THE GEMMA SERVICES OR OUTPUTS AND YOUR EXERCISE OF RIGHTS AND PERMISSIONS UNDER THIS AGREEMENT. 4.4 LIMITATION OF LIABILITY TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT AND UNDER NO LEGAL THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE), PRODUCT LIABILITY, CONTRACT, OR OTHERWISE, UNLESS REQUIRED BY APPLICABLE LAW, SHALL GOOGLE OR ITS AFFILIATES BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, EXEMPLARY, CONSEQUENTIAL, OR PUNITIVE DAMAGES, OR LOST PROFITS OF ANY KIND ARISING FROM THIS AGREEMENT OR RELATED TO, ANY OF THE GEMMA SERVICES OR OUTPUTS EVEN IF GOOGLE OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 4.5 Term, Termination, and Survival The term of this Agreement will commence upon your acceptance of this Agreement (including acceptance by your use, modification, or Distribution, reproduction, performance or display of any portion or element of the Gemma Services) and will continue in full force and effect until terminated in accordance with the terms of this Agreement. Google may terminate this Agreement if you are in breach of any term of this Agreement. Upon termination of this Agreement, you must delete and cease use and Distribution of all copies of Gemma and Model Derivatives in your possession or control. Sections 1, 2.1, 3.3, 4.2 to 4.9 shall survive the termination of this Agreement. 4.6 Governing Law and Jurisdiction This Agreement will be governed by the laws of the State of California without regard to choice of law principles. The UN Convention on Contracts for the International Sale of Goods does not apply to this Agreement. The state and federal courts of Santa Clara County, California shall have exclusive jurisdiction of any dispute arising out of this Agreement. 4.7 Severability If any provision of this Agreement is held to be invalid, illegal or unenforceable, the remaining provisions shall be unaffected thereby and remain valid as if such provision had not been set forth herein. 4.8 Entire Agreement This Agreement states all the terms agreed between the parties and supersedes all other agreements between the parties as of the date of acceptance relating to its subject matter. 4.9 No Waiver Google will not be treated as having waived any rights by not exercising (or delaying the exercise of) any rights under this Agreement. """ ``` ``` # ollama create Daneel -f Daneel.model gathering model components gathering model components gathering model components gathering model components copying file sha256:e8ad13eff07a78d89926e9e8b882317d082ef5bf9768ad7b50fcdbbcd63748de 100% parsing GGUF Error: template error: template: :14: unexpected EOF ```
Author
Owner

@abcbarryn commented on GitHub (Sep 3, 2025):

The problem appears to be with the change you suggested to embed the system prompt. Did I not do it correctly? Rebuilding the model with no changes works.

# ollama show --modelfile Daneel >Daneel.model
# ollama rm Daneel
deleted 'Daneel'
# ollama create Daneel -f Daneel.model
gathering model components
gathering model components
gathering model components
gathering model components
copying file sha256:e8ad13eff07a78d89926e9e8b882317d082ef5bf9768ad7b50fcdbbcd63748de 100%
parsing GGUF
using existing layer sha256:e8ad13eff07a78d89926e9e8b882317d082ef5bf9768ad7b50fcdbbcd63748de
using existing layer sha256:e0a42594d802e5d31cdc786deb4823edb8adff66094d49de8fffe976d753e348
creating new layer sha256:37d1240ff1a5d88f490dabaf5cfe3236ec94837ffd7b38b39152688389b5d04b
using existing layer sha256:dd084c7d92a3c1c14cc09ae77153b903fd2024b64a100a0cc8ec9316063d2dbc
using existing layer sha256:3116c52250752e00dd06b16382e952bd33c34fd79fc4fe3a5d2c77cf7de1b14b
writing manifest
success
<!-- gh-comment-id:3250766203 --> @abcbarryn commented on GitHub (Sep 3, 2025): The problem appears to be with the change you suggested to embed the system prompt. Did I not do it correctly? Rebuilding the model with no changes works. ``` # ollama show --modelfile Daneel >Daneel.model # ollama rm Daneel deleted 'Daneel' # ollama create Daneel -f Daneel.model gathering model components gathering model components gathering model components gathering model components copying file sha256:e8ad13eff07a78d89926e9e8b882317d082ef5bf9768ad7b50fcdbbcd63748de 100% parsing GGUF using existing layer sha256:e8ad13eff07a78d89926e9e8b882317d082ef5bf9768ad7b50fcdbbcd63748de using existing layer sha256:e0a42594d802e5d31cdc786deb4823edb8adff66094d49de8fffe976d753e348 creating new layer sha256:37d1240ff1a5d88f490dabaf5cfe3236ec94837ffd7b38b39152688389b5d04b using existing layer sha256:dd084c7d92a3c1c14cc09ae77153b903fd2024b64a100a0cc8ec9316063d2dbc using existing layer sha256:3116c52250752e00dd06b16382e952bd33c34fd79fc4fe3a5d2c77cf7de1b14b writing manifest success ```
Author
Owner

@rick-github commented on GitHub (Sep 3, 2025):

--- /tmp/daneel.orig	2025-09-03 22:56:33.608699446 +0200
+++ /tmp/daneel	2025-09-03 23:00:37.963023336 +0200
@@ -8,7 +8,7 @@
 {{- if or (eq .Role "user") (eq .Role "system") }}<start_of_turn>user
 {{- if eq .Role "system" }}
 You are Daneel
-{- end }}
+{{- end }}
 {{ .Content }}<end_of_turn>
 {{ if $last }}<start_of_turn>model
 {{ end }}

<!-- gh-comment-id:3250788340 --> @rick-github commented on GitHub (Sep 3, 2025): ```diff --- /tmp/daneel.orig 2025-09-03 22:56:33.608699446 +0200 +++ /tmp/daneel 2025-09-03 23:00:37.963023336 +0200 @@ -8,7 +8,7 @@ {{- if or (eq .Role "user") (eq .Role "system") }}<start_of_turn>user {{- if eq .Role "system" }} You are Daneel -{- end }} +{{- end }} {{ .Content }}<end_of_turn> {{ if $last }}<start_of_turn>model {{ end }} ```
Author
Owner

@abcbarryn commented on GitHub (Sep 3, 2025):

I found the error. I left off a {

<!-- gh-comment-id:3250790727 --> @abcbarryn commented on GitHub (Sep 3, 2025): I found the error. I left off a {
Author
Owner

@abcbarryn commented on GitHub (Sep 4, 2025):

So I made that fix, and it created a model, but it doesn't seem to do what my system prompt did. :)

<!-- gh-comment-id:3252180119 --> @abcbarryn commented on GitHub (Sep 4, 2025): So I made that fix, and it created a model, but it doesn't seem to do what my system prompt did. :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#69966