[PR #12302] parser: tidy up parameter/message parsing #76071

Open
opened 2026-05-05 08:32:01 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/12302
Author: @pdevine
Created: 9/16/2025
Status: 🔄 Open

Base: mainHead: pdevine/parser-tidy


📝 Commits (1)

  • c10a40d parser: tidy up parameter/message parsing

📊 Changes

2 files changed (+98 additions, -46 deletions)

View changed files

📝 parser/parser.go (+81 -29)
📝 parser/parser_test.go (+17 -17)

📄 Description

This change addresses how parameters and messages are handled while parsing a Modelfile. Currently a MESSAGE command creates a string that looks like ": " which then has to be re-parsed, and PARAMETER ends up being the default data type which makes it difficult to add other multi-part commands.

This change introduces a Message and a Parameter type which properly handle properties such as the role and the name of the parameter.


🔄 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/12302 **Author:** [@pdevine](https://github.com/pdevine) **Created:** 9/16/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `pdevine/parser-tidy` --- ### 📝 Commits (1) - [`c10a40d`](https://github.com/ollama/ollama/commit/c10a40db995aa3847a5b29b051aed86d0d2aad00) parser: tidy up parameter/message parsing ### 📊 Changes **2 files changed** (+98 additions, -46 deletions) <details> <summary>View changed files</summary> 📝 `parser/parser.go` (+81 -29) 📝 `parser/parser_test.go` (+17 -17) </details> ### 📄 Description This change addresses how parameters and messages are handled while parsing a Modelfile. Currently a `MESSAGE` command creates a string that looks like "<role>: <message>" which then has to be re-parsed, and `PARAMETER` ends up being the default data type which makes it difficult to add other multi-part commands. This change introduces a Message and a Parameter type which properly handle properties such as the role and the name of the parameter. --- <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-05-05 08:32:01 -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#76071