[PR #15916] fix: print better error message when a new version of Ollama is required #77652

Open
opened 2026-05-05 10:19:46 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/15916
Author: @unn-Known1
Created: 5/1/2026
Status: 🔄 Open

Base: mainHead: fix/issue-3395-better-version-error


📝 Commits (1)

  • 7fac3d3 fix: print better error message when a new version of Ollama is required

📊 Changes

1 file changed (+15 additions, -0 deletions)

View changed files

📝 server/sched.go (+15 -0)

📄 Description

Problem

When a model requires a newer version of Ollama, users see cryptic error messages that are hard to recognize. Issue #3395 requested a clearer error message.

Solution

This PR adds a version check in the scheduler before loading a model. If the current Ollama version is older than what the model requires, a clear error message is displayed:

a new version of Ollama is required to run this model (minimum version: X.Y.Z, current version: A.B.C)

The fix:

  1. Checks req.model.Config.Requires against version.Version using semantic versioning
  2. Uses golang.org/x/mod/semver for proper version comparison
  3. Returns early with a descriptive error message if the version check fails

Changes

  • server/sched.go: Added version check logic in the load() function
    • Added imports for version and semver packages
    • Added version comparison before model loading

Testing

The Go syntax has been verified using gofmt. Full build and test should be run in CI.

This contribution was developed with AI assistance.


🔄 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/15916 **Author:** [@unn-Known1](https://github.com/unn-Known1) **Created:** 5/1/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/issue-3395-better-version-error` --- ### 📝 Commits (1) - [`7fac3d3`](https://github.com/ollama/ollama/commit/7fac3d3a91315ad19417e8d93abe629a4c79c341) fix: print better error message when a new version of Ollama is required ### 📊 Changes **1 file changed** (+15 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `server/sched.go` (+15 -0) </details> ### 📄 Description ## Problem When a model requires a newer version of Ollama, users see cryptic error messages that are hard to recognize. Issue #3395 requested a clearer error message. ## Solution This PR adds a version check in the scheduler before loading a model. If the current Ollama version is older than what the model requires, a clear error message is displayed: ``` a new version of Ollama is required to run this model (minimum version: X.Y.Z, current version: A.B.C) ``` The fix: 1. Checks `req.model.Config.Requires` against `version.Version` using semantic versioning 2. Uses `golang.org/x/mod/semver` for proper version comparison 3. Returns early with a descriptive error message if the version check fails ## Changes - `server/sched.go`: Added version check logic in the `load()` function - Added imports for `version` and `semver` packages - Added version comparison before model loading ## Testing The Go syntax has been verified using `gofmt`. Full build and test should be run in CI. This contribution was developed with AI assistance. --- <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 10:19:46 -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#77652