Files
LocalAI/gallery/addons/README.md
T
mudler-agentandEttore Di Giacinto 6e3222922e feat(addons): show the tool count of each add-on before install (#12898)
The add-on cards, the Find add-ons tab and the install dialog said
"Adds a page" for a library entry but nothing about chat tools, so the
tools only showed once the add-on was installed.

The library index now carries toolCount and tools on each entry, with
the same names as the installed view. They come from capabilities.tools
of the manifest; admin tools are not chat tools and are not counted.
Tools is capped at 32 names and toolCount stays the full number. The
catalog reader validates the hint and refuses it on a backend entry.
addonpkg catalog writes the fields. The new catalog-tools subcommand adds
them to an existing index from addons/<id>/manifest.json, and leaves
every digest and artifact as it was.

The UI reads the fields through the same helper as the installed view and
shows "Adds N tools" when N is above zero.

Assisted-by: Claude:claude-sonnet-5-5 [Claude Code]

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Co-authored-by: Ettore Di Giacinto <mudler@localai.io>
2026-10-25 19:13:30 +01:00

3.6 KiB

First-party add-on catalog

This directory holds the template of the catalog entries of the first-party add-ons. It holds no live URL, registry or namespace. The registry and repository are inputs of the release workflow (ADDON_OCI_REPOSITORY). Each first-party add-on has its own template (tables, voice, face, fine-tuning, quantization, studio, talk) and its own release platform matrix, addons/<id>/package/platforms.yaml. The templates differ in name: only.

Render entries

go run ./scripts/addons/cmd/addonpkg catalog \
  --config addons/tables/package/platforms.yaml \
  --template gallery/addons/tables.yaml.tmpl \
  --merged <merged layout> \
  --repository <registry>/<namespace>/<repository> \
  --tag <immutable tag without the id prefix: the version or sha-<12 hex>> \
  --channel <latest | development | branch-...> \
  --owner-repo <owner>/<repository> \
  --signer-ref <refs/tags/vX.Y.Z | refs/heads/master> \
  --out <catalog.yaml>

To render the entries of another package, name its matrix and its template. For example, for Voice:

go run ./scripts/addons/cmd/addonpkg catalog \
  --config addons/voice/package/platforms.yaml \
  --template gallery/addons/voice.yaml.tmpl \
  --merged <merged layout of voice> ... # the other flags as above

Use face, fine-tuning, quantization, studio or talk in place of voice for the other packages. All packages share one repository, so pass the same repository for each. The artifact of an entry is oci://<repository>:<id>-<tag>, for example ...:voice-sha-50f0f3de26d2.

The add-on packages live in quay.io/go-skynet/local-ai-addons; the template itself holds no registry value. The result is a YAML list with one entry for each enabled platform. Each entry:

  • pins the digest of the platform image, so a tag that moves later changes nothing;
  • names oci://<repository>:<id>-<tag> for the immutable tag of that add-on;
  • carries the channel it is current for and the version of the package, so the channel is metadata that maps to a digest;
  • states the signature policy: signature required, issuer https://token.actions.githubusercontent.com, identity https://github.com/<owner>/<repository>/.github/workflows/addons-package.yml@<signer ref>.

The command fails when the repository is empty or a backend image repository, when the channel is not a channel alias, when a platform of the matrix has no image, or when the template holds an unknown placeholder or weakens the policy.

Every entry also carries toolCount and tools: the chat tools the package declares in capabilities.tools (admin tools are not counted), at most 32 names, and the full count. An add-on without chat tools has neither field. To add them to an existing index without a merged layout, read the manifests of the repository:

go run ./scripts/addons/cmd/addonpkg catalog-tools --index gallery/addons/index.yaml --addons addons

It changes no other field, so no digest or artifact moves.

Placeholders

{{addon}}, {{version}}, {{tag}}, {{channel}}, {{repository}}, {{digest}}, {{os}}, {{arch}}, {{issuer}}, {{identity}}, {{title}}, {{description}}, {{main_page}}, {{icon}}. The title, description, main page and icon come from the verified manifest of the package.

Signature policy of the library

The host replaces the policy of an entry with the policy of the library (source) that serves it. Configure the library with signature required, the issuer above and the identity of the entries. The identity is an exact string and carries the ref of the signing run, so one library names the identity of one release ref. A pattern is not supported by the library policy today.