Skip to main content

Add-on contract reference

This reference describes the contracts between LocalAI and its add-ons. If you install and use add-ons, you don’t need it: see the Add-ons user guide, Install and update add-ons and Manage add-ons, data and updates. If you write add-ons, start with Build your own and use these pages as the reference.

Status and trust

The version-one contracts in pkg/addons/contract define managed-process addons. The owner installs, verifies, starts and supervises them, and a deployment with several frontends forwards every addon request to that owner over a pinned mutual TLS carrier. The routes are described in Public API, the Apps and Add-ons pages in Apps, and Tables, the first first-party add-on, in Tables. The first-party package is described in First-party package and release channels; CI publishes it, not the tests or acceptance: the master workflow publishes the development channel, and a release tag publishes the pinned entries of the release.

Trust has three parts, and they are different:

  • Package identity. A package is installed only after its digest matches the catalog entry and, when the library requires it, its signature matches the identity policy of that library. A library, a channel and a trusted signer never change by themselves, and an upgrade is refused when the trusted identity of the new package differs from the installed one.
  • Executable code. An installed executable is trusted code, not sandboxed code. It runs as the owner’s operating system user, with the owner’s file system and network. The host gives it a loopback port, a per-start credential and its own data directory; it does not confine it. Install only packages you trust.
  • Authority. An addon never decides who a caller is or whether a change was approved. The host supplies the actor from the authenticated session or key, decides every role, and applies a mutation from an API client, an MCP session or the OpenAI-compatible chat route only after the proposer’s own browser session confirms it. The one exception is the chats on the server (/api/chats), their agents and their triggers: turning an add-on on for a chat or an agent is the consent, and the change is applied at once, with the credential of the chat turn, for the user who turned the add-on on, and with an undo where the add-on keeps one (see Proposals and confirmation). Prompt text, a model and an addon cannot supply that approval.

Every addon requires an executable; a UI bundle alone is not an addon.

The owner’s resource policy also serves the resource kinds that are not add-ons. Share with your team describes their roles, the grant to @everyone and the /api/shares routes.

Pages of this reference