[PR #2460] [MERGED] Refactor chat prompt templating #10896

Closed
opened 2026-04-12 23:14:38 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/2460
Author: @jmorganca
Created: 2/12/2024
Status: Merged
Merged: 2/12/2024
Merged by: @jmorganca

Base: mainHead: jmorganca/prompt


📝 Commits (1)

  • 6a0aeb2 Fix issues with templating prompt in chat mode

📊 Changes

7 files changed (+535 additions, -1010 deletions)

View changed files

📝 docs/modelfile.md (+13 -21)
📝 server/images.go (+0 -157)
server/images_test.go (+0 -442)
server/prompt.go (+224 -0)
server/prompt_test.go (+234 -0)
📝 server/routes.go (+64 -159)
📝 server/routes_test.go (+0 -231)

📄 Description

This refactors the chat prompt processing to be a little easier to follow. It also fully deprecates .First in favor of the chat endpoint

Fixes https://github.com/ollama/ollama/issues/2443
Fixes https://github.com/ollama/ollama/issues/2438


🔄 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/2460 **Author:** [@jmorganca](https://github.com/jmorganca) **Created:** 2/12/2024 **Status:** ✅ Merged **Merged:** 2/12/2024 **Merged by:** [@jmorganca](https://github.com/jmorganca) **Base:** `main` ← **Head:** `jmorganca/prompt` --- ### 📝 Commits (1) - [`6a0aeb2`](https://github.com/ollama/ollama/commit/6a0aeb26e1327cce62ddaa4dbf2bc6f71e074c97) Fix issues with templating prompt in chat mode ### 📊 Changes **7 files changed** (+535 additions, -1010 deletions) <details> <summary>View changed files</summary> 📝 `docs/modelfile.md` (+13 -21) 📝 `server/images.go` (+0 -157) ➖ `server/images_test.go` (+0 -442) ➕ `server/prompt.go` (+224 -0) ➕ `server/prompt_test.go` (+234 -0) 📝 `server/routes.go` (+64 -159) 📝 `server/routes_test.go` (+0 -231) </details> ### 📄 Description This refactors the chat prompt processing to be a little easier to follow. It also fully deprecates `.First` in favor of the chat endpoint Fixes https://github.com/ollama/ollama/issues/2443 Fixes https://github.com/ollama/ollama/issues/2438 --- <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-12 23:14:38 -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#10896