Skip to content

feat(addons): add the Ollama search add-on - #13383

Merged
mudler merged 4 commits into
masterfrom
feat/ollama-search-addon
Nov 22, 2026
Merged

mudler merged 4 commits into
masterfrom
feat/ollama-search-addon

Conversation

@mudler-agent

@mudler-agent mudler-agent commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #13381; retarget to master after it merges.

What

A new add-on, ollama-search, that adds the public Ollama model library as a source of the model search (source ID ollama). Results carry the model name, an ollama://<name> URI, the library page, the download count, the update date and the capability and size tags (tools, vision, thinking, 8b, ...).

  • Sorts: downloads (popular), updated and latest (newest). Other sorts are ignored.
  • Filters: tools, vision, thinking.
  • Empty search text with the latest sort lists the newest models.
  • Models that run only in the cloud are left out (every search asks for local models).

Why

Ollama models were not reachable from the model search. #13381 lets the host accept ollama:// results; this add-on is the source that produces them.

How

Ollama has no public search API, so the add-on reads the HTML of ollama.com/search. It never requests a path under /api or /v1, which the site's robots.txt disallows. It sends a fixed user agent, waits at most 20 seconds, reads at most 4 MiB, cuts the search text at 200 bytes and returns at most 50 rows. A page with an unexpected layout (no result count, or a count with no rows) gives an error that names the page, so a markup change is visible and never looks like an empty result. A non-200 answer gives an error with the status.

The add-on registration follows the Pirate Face search add-on: package workflow matrix, platforms file, library template and index, package suites, first-party lists in tests, catalogue and model search docs.

Limits

  • One search request returns about 14 rows. The page counts more results but loads the rest with a script, which the add-on does not follow. A search with a higher limit still gets about 14 rows.
  • The source declares hasVariants: false. The add-on can read the tags page of a model: its search tool takes a variants argument and returns one entry per tag with size and context window. The host does not call that argument yet, so tag choice from the model list needs a follow-up host change that calls it. Until then a user can import a size by entering ollama://<name>:<tag>. The UI does not list tags.
  • The tags list leaves out MLX and other non-GGUF builds (tags containing mlx, nvfp4 or mxfp8), because llama.cpp cannot run them. The search page has no marker for such builds, so search rows are not filtered by it.
  • The add-on reads HTML, so a change of the site layout can break it.

Tests

Recorded pages of the search and tags pages (fetched 2026-11-21) are kept under testdata/; the tests never call the live site.

  • go test -tags nosqlite,purego_utp ./addons/ollama-search/... : 36 specs pass (parsers, runtime against a local server, limits, filters, sort mapping, variants, error paths, manifest, host search).
  • ./pkg/modelsearch/, ./pkg/addons/packaging/, ./pkg/addons/contract/ pass.
  • ./core/application/ -ginkgo.focus "Ollama search add-on|model search backend": 5 specs pass. The full package was not run to the end: it times out under load.
  • ./core/services/addons/catalog/ passes with a local temp dir. With a network-mounted temp dir 3 tests fail on file permissions, unrelated to this change.
  • sh scripts/addons/catalog.sh --channel development --check passes; golangci-lint on the add-on reports no issues.
  • Each main behaviour was checked by breaking the code once and seeing a test fail.

Not verified

  • scripts/addons/package_test.sh needs the UI node_modules, so it did not run.
  • Paging past the first page was not tried (a plain second-page request returned the same page).
  • The add-on was not run against the live site end to end, and not inside a running LocalAI.

🤖 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>
Ollama has no public search API, so the add-on reads the HTML of two
pages of ollama.com: the search page and the tags page of one model. It
never requests a path under /api or /v1, which the robots.txt of the site
disallows. It sends a fixed user agent, waits 20 seconds at most and reads
4 MiB at most.

Each row has the model name, the ollama:// URI, the library page, the
download count, the update date and the capability and size tags. The
source declares the downloads, updated and latest sorts and three bool
filters (tools, vision, thinking). It always asks for local models, so
models that run only in the cloud are left out. The tags of a model are
read only when the variants argument of the tool is set, never for a
search.

A page with an unexpected layout gives an error that names the page, not
an empty list. The tests run on recorded pages and on a local server.

The source does not claim variants (hasVariants is false) because the host
does not call the variants argument yet. Models install by the ollama://
name or by ollama://name:tag.

Assisted-by: Claude:claude-sonnet-5-5
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Add the add-on to the package workflow matrix, the library template and
index, the package suites, the checks that list the first-party add-ons
(it ships no UI, like the Pirate Face add-on), the catalogue and the
model search documentation.

Assisted-by: Claude:claude-sonnet-5-5
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Some tags of the Ollama library (mlx, nvfp4, mxfp8, for example
27b-mlx or 27b-nvfp4) hold per-tensor safetensors layers, not a GGUF
model, so llama.cpp cannot run them and the importer refuses them. The
tags list now skips every tag whose name contains mlx, nvfp4 or mxfp8, and
keeps bf16, fp16 and quantized tags such as q4_K_M.

The search page has no marker for these builds (no badge, and the names
do not say it), so the search rows are not filtered.

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 force-pushed the feat/ollama-search-addon branch from 7c0e8ac to f576425 Compare November 21, 2026 23:41
Base automatically changed from feat/ollama-host-uri to master November 22, 2026 07:38
@mudler
mudler merged commit a8a7ea4 into master Nov 22, 2026
235 of 236 checks passed
@mudler
mudler deleted the feat/ollama-search-addon branch November 22, 2026 07:39
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