[PR #9735] [CLOSED] template: Improve ollama model chat template #44291

Closed
opened 2026-04-24 23:47:41 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/9735
Author: @eugene-kamenev
Created: 3/13/2025
Status: Closed

Base: mainHead: main_improve-template


📝 Commits (1)

  • 55226cf template: Improve ollama model template

📊 Changes

2 files changed (+64 additions, -1 deletions)

View changed files

📝 server/prompt_test.go (+48 -0)
📝 template/template.go (+16 -1)

📄 Description

Ollama Model Chat Template is based on pure Go template with just json function exposed to template.
I think templates can be improved.

In this PR:

  • added sum func to have ability to manipulate on numbers
  • added split func to split by regexpr
  • subsequent role: "tool" will not be merged during messages preprocessing

🔄 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/9735 **Author:** [@eugene-kamenev](https://github.com/eugene-kamenev) **Created:** 3/13/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main_improve-template` --- ### 📝 Commits (1) - [`55226cf`](https://github.com/ollama/ollama/commit/55226cf13dafcd9c7fcc1facf6738f3f9dd8b357) template: Improve ollama model template ### 📊 Changes **2 files changed** (+64 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `server/prompt_test.go` (+48 -0) 📝 `template/template.go` (+16 -1) </details> ### 📄 Description Ollama Model Chat Template is based on pure Go template with just `json` function exposed to template. I think templates can be improved. In this PR: * added sum func to have ability to manipulate on numbers * added split func to split by regexpr * subsequent role: "tool" will not be merged during messages preprocessing --- <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 23:47:41 -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#44291