Skip to content

fix: match untagged Ollama model names against ':latest' - #611

Open
ieCecchetti wants to merge 1 commit into
AsyncFuncAI:mainfrom
ieCecchetti:fix/ollama-model-check-latest-tag
Open

ieCecchetti wants to merge 1 commit into
AsyncFuncAI:mainfrom
ieCecchetti:fix/ollama-model-check-latest-tag

Conversation

@ieCecchetti

Copy link
Copy Markdown

What

check_ollama_model_exists now treats an untagged model name as <name>:latest, on both the configured name and the names returned by ollama.list().

Why

Since #549 the check compares names exactly, but Ollama lists untagged pulls as <name>:latest. The shipped embedder.ollama.json.bak uses nomic-embed-text, so following the Ollama setup fails with Ollama model 'nomic-embed-text' not found even though the model is installed. Fixes #579.

Tests

tests/unit/test_ollama_model_check.py mocks ollama.Client.list and covers untagged vs :latest, explicit tags, mismatched tags and registry hosts with ports.

check_ollama_model_exists compares the configured name with ollama.list()
exactly (since AsyncFuncAI#549), but Ollama lists untagged pulls as '<name>:latest'.
The default embedder config uses 'nomic-embed-text', so the check fails
with "Ollama model 'nomic-embed-text' not found" even when it is installed.
Treat an untagged name as ':latest' on both sides. Fixes AsyncFuncAI#579.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When using Docker to call a local Ollama model, the model cannot be found.

1 participant