
# Providers and models

Agentak knows 8 provider integrations. The picker shows only the providers the current
browser can use. There is no unconditional provider count for every environment.

## Provider matrix

The table is the picker's order. The two keyed gateways come first, because one key
reaches many vendors' newest models, and the six that need no key follow.

| Provider           | Key | Runtime/API              | Important availability rule                                          |
| ------------------ | --- | ------------------------ | -------------------------------------------------------------------- |
| Vercel AI Gateway  | Yes | API depends on model     | One key gives access to several vendors.                             |
| OpenRouter         | Yes | API depends on model     | One key gives access to several vendors.                             |
| On Device (wllama) | No  | llama.cpp in WebAssembly | Needs WebAssembly, Worker, and a wllama build the document may load. |
| LLM7               | No  | OpenAI Completions       | Browser CORS supported; anonymous rate limits apply.                 |
| OVHcloud           | No  | OpenAI Completions       | Browser CORS supported; anonymous rate limits apply.                 |
| Kilo Gateway       | No  | OpenAI Completions       | Does not accept page CORS preflight; available in the extension.     |
| OpenCode Zen       | No  | OpenAI Completions       | Does not accept page CORS preflight; available in the extension.     |
| Chrome Built-in AI | No  | Chrome Prompt API        | Listed only when `LanguageModel` exists.                             |

Single-vendor providers are not listed. A gateway key already reaches those vendors'
models, so OpenAI, Groq, and Cerebras have no entry of their own.

The supported model API families are:

- `anthropic-messages`
- `chrome-prompt`
- `openai-completions`
- `openai-responses`
- `wllama`

Models that require another API are filtered out of catalogs.

## Browser availability and CORS

A normal page can only call a network provider that answers the browser's CORS preflight.
Kilo Gateway and OpenCode Zen do not, so Agentak leaves them out instead of offering a
choice that will fail. An MV3 extension can use `host_permissions` and is not gated by the
same page preflight, so the Agentak side panel lists them.

The on-device rows have separate capability checks:

- Chrome Built-in AI appears only when the Prompt API exists.
- On Device (wllama) appears only when the page has WebAssembly and Worker support. The
  built-in remote loader is not allowed in an MV3 page, so a host there supplies its own
  build through `useWllamaSource()`; the side panel does, and lists the row.
- On Device (wllama) is listed on a phone as well. The download, the memory, and the
  answer speed all cost more there, so every row states its download size. See
  [On-device models](/agents/pi/on-device-models).

Use `availableProviders()` when a custom picker needs the same filtered list. `PROVIDERS`
contains the complete static list, and `findProvider(id)` looks up one entry.

## Free providers

Six integrations need no API key:

- On Device (wllama) and Chrome Built-in AI perform inference on the device.
- LLM7, OVHcloud, Kilo Gateway, and OpenCode Zen accept anonymous network requests.

Anonymous services apply their own rate limits and may change their free model lists.
Agentak includes only their known free chat models. An on-device model costs no provider
fee, but downloading and running it uses the visitor's bandwidth, storage, memory, and
compute.

## Keys and provider selection

Agentak stores one key per provider. Selecting a provider with no required key changes the
model list immediately. Selecting a keyed provider opens its key form first; the active
provider does not change until the key is saved.

A saved provider is restored only when it is still available in this environment and it
has a usable key when one is required. A saved provider that cannot answer, and a session
with none saved, both start on the first provider in the picker — with or without its key.
Removing the key steps off that provider.

The settings page contains provider, API key, thinking level, and model sections. It opens
with the provider list down while nothing can answer yet: no provider set, or one set that
has no key. A provider that still needs a key lists no models, because the key is the step
before them. A provider used before restores its last model. A new provider does not
silently choose a model for the user. Selecting a model closes settings and returns to the
transcript.

A gateway lists hundreds of models, so the list is short until it is asked for more. With
nothing typed in the search field, it shows the newest model of each well-known line —
Claude Opus, Sonnet, Haiku and Fable, GPT, Gemini, Grok, Qwen, DeepSeek, Kimi, GLM, Llama,
Mistral, MiniMax, and Gemma. Typing searches the whole catalog, and the button at the foot
of the list opens the rest. A catalog of 8 models or fewer is shown as it is, and so is one
where these names are the exception — the free providers show all of their models.

The rows are grouped and sorted by the version in the model id, not by the catalog's own
order. Each model is one row with the newest release at its head: Sonnet 4.5 goes behind
the button, under Sonnet 5, and 5.10 ranks above 5.9. A release under more than one name
keeps every one of those names, because they are models to choose between and not older
versions. A variant such as `mini`, `pro`, or `codex` is its own model, while a codename
after the version — "GPT 5.6 Luna" — belongs to that release of GPT. The model in use is
always listed, however old it is.

## Catalog and API loading

Agentak does not put every provider SDK and catalog in the initial widget bundle:

1. Free and on-device model lists are small and included with the Pi entry.
2. A keyed provider's catalog loads only after that provider is selected.
3. The model's API module loads on the first request that needs it.
4. A loaded catalog is cached for the life of the page.

By default, keyed catalogs come from the newest published `pi-ai` modules on esm.sh. This
lets the picker see models released after the Agentak build. It also means the page needs a
network and a Content Security Policy that permits remote modules.

Use `useCatalogSource()` before creating sessions when the host must bundle or pin its
catalogs:

```ts
import { useCatalogSource } from "agentak/pi";

useCatalogSource(async (provider) => {
  if (provider === "openrouter") {
    return import("@earendil-works/pi-ai/providers/openrouter.models");
  }
  throw new Error(`No bundled catalog for ${provider}.`);
});
```

The Chrome extension does this with one literal dynamic import per keyed provider. Each
catalog remains its own lazy chunk. A custom source is global to the Agentak Pi runtime;
call `useCatalogSource(undefined)` to return to the CDN source.

## Work with catalogs directly

```ts
import { cachedCatalog, loadCatalog } from "agentak/pi";

const models = await loadCatalog("openrouter");
const alreadyLoaded = cachedCatalog("openrouter");
```

`loadCatalog()` validates the provider, filters unsupported API families and non-chat
variants, sorts models by name, and caches the result. It rejects when the catalog cannot
load. The settings page shows that error and lets the user retry it.

## Thinking levels

Thinking is a model capability, not a provider-wide setting. Agentak stores it per provider
and model, restores it with conversations, and limits the picker to levels that model
accepts. The default starting level is `medium` for a reasoning model and `off` for a model
without reasoning.

Read [On-device models](/agents/pi/on-device-models) for the two local runtimes and
[Storage and API keys](/agents/pi/storage-and-api-keys) for persistence and safety.
