[PR #232] [MERGED] Allow specifying stop conditions in Modelfile #41301

Closed
opened 2026-04-24 21:12:56 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/232
Author: @BruceMacD
Created: 7/27/2023
Status: Merged
Merged: 7/28/2023
Merged by: @BruceMacD

Base: mainHead: brucemacd/modelfile-stop


📝 Commits (3)

  • 184ad8f allow specifying stop conditions in modelfile
  • f5cbcb0 specify stop params separately
  • 47bda0b add stop to docs

📊 Changes

4 files changed (+31 additions, -28 deletions)

View changed files

📝 api/types.go (+1 -1)
📝 docs/modelfile.md (+15 -14)
📝 llama/llama.go (+1 -1)
📝 server/images.go (+14 -12)

📄 Description

This is useful for Modelfiles which define a format. Multi-value paramters are set by listing them in quotes.

Example Modelfile:

FROM llama2
PARAMETER temperature 1
PARAMETER stop "AI Cat:" "Dog:"

TEMPLATE """
{{- if .First }}
<<SYS>>
{{ .System }}
<</SYS>>

Dog: woof woof woof

AI Cat: meow meow meeeeow

Dog: bark woof

AI Cat: mew meow
{{- end }}

Dog: {{ .Prompt }}

AI Cat:
"""

SYSTEM """
AI Cat is a highly advanced robot cat that can only respond with meows. She has a comprehensive understanding of cat psychology, but without the human biases that may interfere with therapy.
"""

TODO:

  • documentation

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/232 **Author:** [@BruceMacD](https://github.com/BruceMacD) **Created:** 7/27/2023 **Status:** ✅ Merged **Merged:** 7/28/2023 **Merged by:** [@BruceMacD](https://github.com/BruceMacD) **Base:** `main` ← **Head:** `brucemacd/modelfile-stop` --- ### 📝 Commits (3) - [`184ad8f`](https://github.com/ollama/ollama/commit/184ad8f05795fcbd6c02ae7b4cba4121f64a8720) allow specifying stop conditions in modelfile - [`f5cbcb0`](https://github.com/ollama/ollama/commit/f5cbcb08e65a039f1ad0c5d543cdf154c47496e1) specify stop params separately - [`47bda0b`](https://github.com/ollama/ollama/commit/47bda0b86034465127f2654dcba73eaa27905d58) add stop to docs ### 📊 Changes **4 files changed** (+31 additions, -28 deletions) <details> <summary>View changed files</summary> 📝 `api/types.go` (+1 -1) 📝 `docs/modelfile.md` (+15 -14) 📝 `llama/llama.go` (+1 -1) 📝 `server/images.go` (+14 -12) </details> ### 📄 Description This is useful for Modelfiles which define a format. Multi-value paramters are set by listing them in quotes. Example Modelfile: ``` FROM llama2 PARAMETER temperature 1 PARAMETER stop "AI Cat:" "Dog:" TEMPLATE """ {{- if .First }} <<SYS>> {{ .System }} <</SYS>> Dog: woof woof woof AI Cat: meow meow meeeeow Dog: bark woof AI Cat: mew meow {{- end }} Dog: {{ .Prompt }} AI Cat: """ SYSTEM """ AI Cat is a highly advanced robot cat that can only respond with meows. She has a comprehensive understanding of cat psychology, but without the human biases that may interfere with therapy. """ ``` TODO: - [x] documentation --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-24 21:12:56 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#41301