[PR #15413] [MERGED] modelfiles: fix /save command and add shortname for safetensors based models #61843

Closed
opened 2026-04-29 16:50:53 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/15413
Author: @pdevine
Created: 4/8/2026
Status: Merged
Merged: 4/9/2026
Merged by: @pdevine

Base: mainHead: pdevine/modelfile-fixes


📝 Commits (1)

  • 23ecf4f modelfiles: fix /save command and add shortname for safetensors based models

📊 Changes

5 files changed (+179 additions, -45 deletions)

View changed files

📝 cmd/cmd.go (+42 -29)
📝 cmd/cmd_test.go (+74 -10)
📝 cmd/interactive.go (+17 -3)
📝 server/routes.go (+11 -3)
📝 server/routes_test.go (+35 -0)

📄 Description

This change fixes two issues with Modelfiles:

  1. If a user uses ollama show --modelfile to show a safetensors based model, the Model would leave the "FROM" field blank which won't allow a user to recreate the model. This change adds the model's current canonical short name to the FROM field.
  2. If a user uses the /save command in the CLI any messages which were saved in a previous model wouldn't get saved (only the set of messages from the current session).

🔄 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/15413 **Author:** [@pdevine](https://github.com/pdevine) **Created:** 4/8/2026 **Status:** ✅ Merged **Merged:** 4/9/2026 **Merged by:** [@pdevine](https://github.com/pdevine) **Base:** `main` ← **Head:** `pdevine/modelfile-fixes` --- ### 📝 Commits (1) - [`23ecf4f`](https://github.com/ollama/ollama/commit/23ecf4fac3d3a28d575e7698e1ec2ff1a07129cb) modelfiles: fix /save command and add shortname for safetensors based models ### 📊 Changes **5 files changed** (+179 additions, -45 deletions) <details> <summary>View changed files</summary> 📝 `cmd/cmd.go` (+42 -29) 📝 `cmd/cmd_test.go` (+74 -10) 📝 `cmd/interactive.go` (+17 -3) 📝 `server/routes.go` (+11 -3) 📝 `server/routes_test.go` (+35 -0) </details> ### 📄 Description This change fixes two issues with Modelfiles: 1. If a user uses `ollama show --modelfile` to show a safetensors based model, the Model would leave the "FROM" field blank which won't allow a user to recreate the model. This change adds the model's current canonical short name to the FROM field. 2. If a user uses the `/save` command in the CLI any messages which were saved in a previous model wouldn't get saved (only the set of messages from the current session). --- <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-29 16:50:53 -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#61843