[GH-ISSUE #693] Mario System Prompt not working with Mistral Model #46827

Closed
opened 2026-04-28 00:34:50 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @ghost on GitHub (Oct 3, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/693

In this example: https://github.com/jmorganca/ollama/blob/main/examples/mario/readme.md

I can successfully create a new model with mistral, however it seems to ignore the system prompt. I tried various system prompts but seems to revert back to Mistral.

Here is my results:

ollama run MARIO

who r u?

I am Mistral...

Originally created by @ghost on GitHub (Oct 3, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/693 In this example: https://github.com/jmorganca/ollama/blob/main/examples/mario/readme.md I can successfully create a new model with mistral, however it seems to ignore the system prompt. I tried various system prompts but seems to revert back to Mistral. Here is my results: >ollama run MARIO > who r u? >I am Mistral...
GiteaMirror added the bug label 2026-04-28 00:34:51 -05:00
Author
Owner

@BruceMacD commented on GitHub (Oct 3, 2023):

Looks like mistral doesn't have a system prompt in its default template:

ollama run mistral
>>> /show modelfile
# Modelfile generated by "ollama show"
# To build a new Modelfile based on this one, replace the FROM line with:
# FROM mistral:latest

FROM /Users/bruce/.ollama/models/blobs/sha256:6ae28029995007a3ee8d0b8556d50f3b59b831074cf19c84de87acf51fb54054
TEMPLATE """[INST] {{ .Prompt }} [/INST]
"""
SYSTEM """"""

Try this Modelfile instead for the Mario example:

FROM mistral
PARAMETER temperature 1
TEMPLATE """[INST] <<SYS>>You are Mario from Super Mario Bros, acting as an assistant.<</SYS>>

{{ .Prompt }} [/INST] """

I haven't tested this template out much, but it may do the trick. Iterate as needed.

<!-- gh-comment-id:1745750516 --> @BruceMacD commented on GitHub (Oct 3, 2023): Looks like mistral doesn't have a system prompt in its default template: ``` ollama run mistral >>> /show modelfile # Modelfile generated by "ollama show" # To build a new Modelfile based on this one, replace the FROM line with: # FROM mistral:latest FROM /Users/bruce/.ollama/models/blobs/sha256:6ae28029995007a3ee8d0b8556d50f3b59b831074cf19c84de87acf51fb54054 TEMPLATE """[INST] {{ .Prompt }} [/INST] """ SYSTEM """""" ``` Try this Modelfile instead for the Mario example: ``` FROM mistral PARAMETER temperature 1 TEMPLATE """[INST] <<SYS>>You are Mario from Super Mario Bros, acting as an assistant.<</SYS>> {{ .Prompt }} [/INST] """ ``` I haven't tested this template out much, but it may do the trick. Iterate as needed.
Author
Owner

@cjbottaro commented on GitHub (Oct 5, 2023):

Adding that TEMPLATE directive to the Modelfile worked for me.

Btw, where can I learn more about that syntax like <<SYS>> and [INST]? I'm new to LLMs and such.

<!-- gh-comment-id:1749485385 --> @cjbottaro commented on GitHub (Oct 5, 2023): Adding that TEMPLATE directive to the Modelfile worked for me. Btw, where can I learn more about that syntax like `<<SYS>>` and `[INST]`? I'm new to LLMs and such.
Author
Owner

@65a commented on GitHub (Oct 6, 2023):

@cjbottaro these sorts of things are usually model-specific and come from how it was trained. You can usually find them in the huggingface modelcard for the specific model, or the model it was derived from. For Mistral: https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.1 the instruction format describes [INST]. They often will work with a variety of prompt styles, but you can imagine they work best with prompt formats they saw during training best.

<!-- gh-comment-id:1749932462 --> @65a commented on GitHub (Oct 6, 2023): @cjbottaro these sorts of things are usually model-specific and come from how it was trained. You can usually find them in the huggingface modelcard for the specific model, or the model it was derived from. For Mistral: https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.1 the instruction format describes `[INST]`. They often will work with a variety of prompt styles, but you can imagine they work best with prompt formats they saw during training best.
Author
Owner

@s-kostyaev commented on GitHub (Oct 7, 2023):

Can we fix default template for mistral? I can't find default templates for models to provide PR.

<!-- gh-comment-id:1751806155 --> @s-kostyaev commented on GitHub (Oct 7, 2023): Can we fix default template for mistral? I can't find default templates for models to provide PR.
Author
Owner

@jmorganca commented on GitHub (Nov 2, 2023):

This should be fixed now. Thanks for creating an issue and feel free to re-open if you see this again!

<!-- gh-comment-id:1789987108 --> @jmorganca commented on GitHub (Nov 2, 2023): This should be fixed now. Thanks for creating an issue and feel free to re-open if you see this again!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#46827