Skip to content

feat(modelsearch): accept ollama:// search results and list their layers - #13381

Merged
mudler merged 1 commit into
masterfrom
feat/ollama-host-uri
Nov 22, 2026
Merged

mudler merged 1 commit into
masterfrom
feat/ollama-host-uri

Conversation

@mudler-agent

Copy link
Copy Markdown
Collaborator

What

A model search add-on can return rows with an ollama://name[:tag] uri. This change lets the host keep those rows and read them.

  • ollama:// is an accepted scheme for search results.
  • ParseRepoURI and RepoOfURI understand ollama://name[:tag] and ollama://user/name[:tag]. A bare name is library/name. The default tag is latest. Empty names, spaces, .., extra colons and extra path segments are rejected.
  • /api/models/remote/files and /api/models/remote/estimate read the Ollama registry manifest. The model layer is the one gguf file and the only variant. A projector layer is listed as mmproj and is not part of the variant. Template, parameter, licence and system layers are not listed. The response shape is the same as for Hugging Face and Pirate Face. The estimate reads the GGUF header from the blob address and falls back to the file size when that fails.
  • Installed-model matching also tries the row uri, because the row id is free text for such a source.
  • Docs and swagger text updated.

The registry is read with the same HTTP client, size cap, cache, concurrency budget and error mapping as the other providers. The importer and blob download are not changed here.

Why

Without this, rows with an ollama:// uri are dropped, and the file list and estimate routes answer "bad repository" for them.

How tested

Package tests with -tags nosqlite,purego_utp for pkg/modelsearch, pkg/downloader, core/gallery/remotemodel and core/http/endpoints/localai: URI parsing table (good and bad forms), the row cleaner, the file list and estimate against a local test registry (a text model and a vision model with a projector), and the two routes. Each new test was shown to fail when the code it covers is broken. golangci-lint is clean on the touched packages. No network is used.

🤖 Generated with Claude Code

A search add-on can now return rows whose uri is ollama://name[:tag].
The host used to drop them, and the repository routes could not read
them.

ollama://name[:tag] and ollama://user/name[:tag] are parsed to a
canonical namespace/name:tag id: a bare name is in the library
namespace and the default tag is latest. The file listing and the
memory estimate read the registry manifest. The model layer is the one
gguf file and the only variant, a projector layer is listed as mmproj,
and the template, parameter, licence and system layers are skipped.
Installed models are matched by the row uri, since the row id is free
text for such a source.

Assisted-by: Claude:claude-sonnet-5-5
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
@mudler
mudler force-pushed the feat/ollama-host-uri branch from df50afb to a632661 Compare November 21, 2026 23:41
@mudler
mudler merged commit aca3d8c into master Nov 22, 2026
87 of 90 checks passed
@mudler
mudler deleted the feat/ollama-host-uri branch November 22, 2026 07:38
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.

2 participants