models.json Referencemodels.json configures local and custom model providers for the active Sero profile. The file lives in the profile-scoped agent directory:
For the default profile, that is usually ~/.sero-ui/agent/models.json. Sero reads and writes this file through the local models UI, then refreshes model availability.
providers is a map. Each key is the provider ID shown to Sero, and each value is a provider configuration.
| Field | Type | Notes |
|---|---|---|
baseUrl |
string | Base URL for the provider API, such as http://localhost:1234/v1. |
api |
string | Supported values: openai-completions, openai-responses, anthropic-messages, google-generative-ai. |
apiKey |
string | Literal key, environment variable name, or command form supported by Sero's resolver. Use none when the local server should not receive an auth header. |
headers |
object | Extra request headers. Values use the same resolver behavior as apiKey. |
compat |
object | OpenAI-compatibility flags from the Pi SDK type used by Sero. The UI currently exposes supportsDeveloperRole and supportsReasoningEffort. |
authHeader |
boolean | For OpenAI-compatible APIs, controls whether Sero attaches Authorization: Bearer <apiKey>. Defaults to true when an API key is present and not none. |
models |
array | Explicit local/custom model entries. |
modelOverrides |
object | Per-model overrides for built-in provider models. |
| Field | Type | Notes |
|---|---|---|
id |
string | Required model ID. |
name |
string | Optional display name. |
api |
string | Optional per-model API shape; same values as provider api. |
baseUrl |
string | Optional per-model base URL. |
reasoning |
boolean | Whether Sero should treat the model as reasoning-capable. |
input |
array | Supported input types: text, image. |
contextWindow |
number | Context window size when known. |
maxTokens |
number | Max output tokens when known. |
cost |
object | Cost per million tokens. See below. |
headers |
object | Per-model headers. |
compat |
object | Per-model OpenAI compatibility overrides. |
When specified on a model, cost uses numbers per million tokens:
Model overrides can use partial cost objects, so only the fields you need to override are required there.
api value |
Discovery behavior | Auth behavior |
|---|---|---|
openai-completions |
Fetches <baseUrl>/models; if that fails, tries Ollama /api/tags after stripping a trailing /v1. |
Adds Authorization: Bearer <apiKey> unless apiKey is none or authHeader is false. |
openai-responses |
Same model discovery as OpenAI-compatible completions. | Same bearer behavior as above. |
anthropic-messages |
Fetches <baseUrl>/models and parses OpenAI-style data[].id model lists. |
Adds x-api-key and anthropic-version: 2023-06-01 when needed. |
google-generative-ai |
Fetches <baseUrl>/models and parses models[].name, trimming models/. |
Adds x-goog-api-key or ?key= when an API key is present and not none. |
For apiKey and headers values:
! is executed as a shell command and the trimmed stdout is usedprocess.env[value]; if no environment variable exists, the literal value is usedTreat command-based and environment-backed values as sensitive. Do not commit private models.json files.
modelOverrides is keyed by model ID and can adjust display/metadata for built-in provider models:
Supported override fields are name, reasoning, input, cost, contextWindow, maxTokens, headers, and compat.
If models.json is malformed or contains unsupported values, the model registry can report an error and the local models UI may ask you to fix the invalid entry before adding or editing providers.
Recovery steps:
<SERO_HOME>/agent/models.json.