Skip to content

fix(ollama): accept :latest tag on model lookup - #11732

Merged
mudler merged 1 commit into
mudler:masterfrom
leilei3167:fix/ollama-accept-latest-tag
Aug 26, 2026
Merged

fix(ollama): accept :latest tag on model lookup#11732
mudler merged 1 commit into
mudler:masterfrom
leilei3167:fix/ollama-accept-latest-tag

Conversation

@leilei3167

Copy link
Copy Markdown
Contributor

/api/tags and /api/ps add :latest to untagged names, but /api/chat and /v1/chat/completions looked the tagged name up as-is and 404'd. Strip that default tag before config lookup so the listed name works.

Fixes #11728

/api/tags appends :latest to untagged names, but chat and the other
model endpoints looked the tagged name up as-is and 404'd.

Signed-off-by: lei_lei <96427312+leilei3167@users.noreply.github.com>

@localai-org-maint-bot localai-org-maint-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@mudler This looks good to merge. The :latest normalization is limited to the Ollama default tag, preserves the original request model for responses, and covers both successful lookup and the unknown-model 404 path. I verified git diff --check and go test ./core/http/middleware ./core/http/endpoints/ollama -run 'TestMiddleware|TestOllamaEndpoints' -count=1. DCO passes; the normal CI matrix has not reported yet.

@mudler
mudler merged commit f28e8b2 into mudler:master Aug 26, 2026
1 check passed
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.

Hitting /api/tags gives models with :latest tag, but you cannot specify tagged models like that with the other endpoints (even ollama ones)

3 participants