94 KiB
Model and Provider Configuration (models.yml / models.yaml)
This document describes how the coding-agent currently loads models, applies overrides, resolves credentials, and chooses models at runtime.
What controls model behavior
Primary implementation files:
packages/coding-agent/src/config/model-registry.ts— loads built-in + custom models, provider overrides, runtime discovery, auth integrationpackages/coding-agent/src/config/model-resolver.ts— parses model patterns and selects initial/smol/slow modelspackages/coding-agent/src/config/model-settings.ts— model selection settings (modelRoles,enabledModels,enabledProviders/disabledProviders,modelProviderOrder,cycleOrder)packages/coding-agent/src/session/settings.ts— provider transport preferences (providers.*)packages/coding-agent/src/config/models-config.tsandmodels-config-schema-bundle.ts— custom provider/model validationpackages/coding-agent/src/session/auth-storage.ts— re-exportsAuthStoragefrom@oh-my-pi/pi-ai; credential precedence is implemented inpackages/ai/src/auth/cascade.tspackages/catalog/src/compat/resolve.tsandcompat/rules/— compatibility and model policy resolutionpackages/catalog/src/models.tsandpackages/catalog/src/types.ts— built-in providers/models and public model types
Config file location and legacy behavior
Default-profile config paths, in precedence order:
~/.omp/agent/models.yml~/.omp/agent/models.yaml
These are relative to the active agent directory returned by getAgentDir(). Named profiles use
~/.omp/profiles/<name>/agent/; PI_CONFIG_DIR changes the config-root directory name, and
PI_CODING_AGENT_DIR can override the default-profile agent directory. A programmatic
ModelRegistry path overrides the directory-derived location.
Legacy behavior still present:
- If both YAML files are missing and
models.jsonexists at the same location, it is migrated tomodels.yml. - Explicit
.json/.jsoncconfig paths are still supported when passed programmatically toModelRegistry.
models.yml / models.yaml shape
providers:
<provider-id>:
# provider-level config
provider-id is the canonical provider key used across selection and auth lookup.
providers is the only root key the registry consumes. Unknown root keys are not rejected by the current schema, but do not configure model behavior.
Provider-level fields
providers:
my-provider:
baseUrl: https://api.example.com/v1
apiKey: MY_PROVIDER_API_KEY
api: openai-completions
headers:
X-Team: platform
authHeader: true
auth: apiKey
disableStrictTools: false # set true for Anthropic-compatible endpoints that reject the strict field
discovery:
type: ollama
timeoutMs: 10000 # optional per-provider HTTP probe timeout in milliseconds
modelOverrides:
some-model-id:
name: Renamed model
models:
- id: some-model-id
name: Some Model
api: openai-completions
reasoning: false
input: [text]
imageInputDecoder: stb # local STB decoder; OMP converts WebP before dispatch
cost:
input: 0
output: 0
cacheRead: 0
cacheWrite: 0
contextWindow: 128000
maxContextWindow: 256000 # optional extended-context window
maxTokens: 16384
headers:
X-Model: value
compat:
supportsStore: true
supportsDeveloperRole: true
supportsReasoningEffort: true
maxTokensField: max_completion_tokens
openRouterRouting:
only: [anthropic]
vercelGatewayRouting:
order: [anthropic, openai]
extraBody:
gateway: m1-01
controller: mlx
maxContextWindow is available on both models entries and modelOverrides.
Set contextWindow to the normal prompt window and maxContextWindow to the
larger prompt window accepted by the provider. /extended-context on selects
the larger window; off restores the normal one. An override specifying only
contextWindow remains fixed in both modes, as before. This changes OMP's
local context budget, not the provider's server-side limit; verify the endpoint
accepts requests of the configured size.
Configured maxima do not replace provider-advertised capacity. Models governed
by a catalog override ceiling (such as Codex Astra) still clamp to that ceiling.
Per-model overrides, including retired variant aliases, are resolved before
selecting the extended window.
Custom models entries can set their own baseUrl; otherwise they inherit the provider URL.
For built-in models, a provider baseUrl override is scoped to the effective APIs of custom models
that inherit it, or to the provider's api for an override-only configuration. Without either
scope it applies provider-wide. transport: pi-native always applies the gateway URL provider-wide.
An unscoped OpenRouter baseUrl names the /api/v1 chat root, so OpenRouter Decisions (judge)
models use its /api/alpha sibling on the same host, e.g. a .../api/v1 relay serves judges at
.../api/alpha/decisions.
omitMaxOutputTokens omits the model-derived output cap.
compat.base64SkipThoughtSignature (Google APIs, default false): sends the unsigned-tool-call bypass sentinel base64-encoded. Set it on a google-generative-ai model behind a gateway that decodes thoughtSignature as base64 and answers the raw skip_thought_signature_validator literal with a 400, for example when Gemini replays another model's tool-call history:
providers:
my-gemini-gateway:
baseUrl: https://gateway.example.com/gemini/v1beta
api: google-generative-ai
models:
- id: gemini-3.8-flash
compat:
base64SkipThoughtSignature: true
Standard Responses WebSockets
Standard Responses uses HTTP/SSE by default, including at the official OpenAI
endpoint. To opt in from OMP, set this in config.yml:
providers:
openaiResponsesWebsockets: true
The catalog's supports-websockets KDL rule marks capability, not enablement.
It covers OpenAI openai-responses, including custom providers that inherit that
provider type. Copilot, OpenRouter and other unmarked provider/API combinations
remain on HTTP/SSE. The independent providers.openaiWebsockets: auto|off|on setting
and PI_CODEX_WEBSOCKET continue to govern Codex only.
Model and request preferWebsockets can only narrow OMP's setting: either explicit
false disables WS, even if the other is true. Turning the setting off cannot
be overridden. Standalone pi-ai SDK callers have no OMP settings dependency: they
must explicitly opt in with a request or model true; either false still vetoes it.
For a gateway with uneven support, keep the existing provider entry in models.yml
and disable WS for the affected model:
providers:
openai:
api: openai-responses
baseUrl: https://gateway.example.com/v1
modelOverrides:
gpt-5:
preferWebsockets: false
Custom models entries accept the same boolean. WS uses the existing /responses
endpoint and authentication; the gateway must implement response.create.
SDK fetch overrides affect HTTP/SSE, not sockets. Explicit WS opt-in bypasses that
HTTP override for the socket; an HTTP fallback still uses it.
Payload construction and onPayload precede connecting, including for cancelled
requests. A pre-send handshake network failure, connect timeout, or upgrade
404/405/426/501 rebuilds the full HTTP candidate with its normal storage/chaining
rules and calls onPayload again. The hook may replace each candidate; it does not
see the final socket-local delta. Other upgrade statuses retain normal error
classification. Diagnostics preserve status and available headers, not a buffered
rejected-upgrade body.
When handshake headers are available, onResponse reports the physical WS
handshake once, marked with metadata.transport="websocket" and
metadata.phase="handshake". Reusing the socket does not emit another handshake.
These are not per-generation headers; no generation request ID is invented.
omp bench --json includes the transport when response metadata makes it
observable. Standard WS cache benchmarks still measure generation usage, but
cannot claim per-generation request IDs or HTTP response-cache headers.
A healthy retained socket can send incremental previous_response_id turns,
including with store: false. Changed history/options, credentials, concurrent
temporary sockets, or a replacement after the 30-second idle limit require
full input without an old socket's anchor. Continuation follows the same opt-outs
as HTTP chaining: statefulResponses: false, PI_OPENAI_STATEFUL=0, or a model's
compat.statefulResponses: false sends full history on every WS turn, so set the
compat flag for gateways that ignore previous_response_id. Three consecutive
stale-anchor rejections stop sending anchors for the logical session. Official HTTP
can already use stored stateful chaining independently of that socket lifetime; WS
is not guaranteed to save traffic or latency there.
Injected previous_response_id and background: true are rejected. A definite
first-frame stale-anchor rejection permits one full-history resend on the same
healthy socket before generation evidence. WS does not inherit HTTP transient,
resume, or empty-completion retries; a successful empty WS response submits once.
After an uncertain send, a transport failure or stream timeout fails the call without hidden HTTP replay. Partial output remains available; existing Agent recovery may start an SSE continuation under its own rules, retaining completed tool results and never executing incomplete arguments. Caller abort and protocol/ queue errors do not mark transport incompatibility.
An upgrade rejection (404/405/426/501) or a post-send transport failure makes the
SSE downgrade sticky for the logical session, endpoint and model until
releaseSession/provider-state close or a new scope. A pre-send network failure or
connect timeout falls back for that request only; a second consecutive one becomes
sticky, and a completed WS exchange resets the count. Embedders retaining provider
state must release finished sessions. Calls without a logical session ID do not
share sticky state; without providerSessionState, it lasts only for that call.
Normal idle retirement is not a downgrade. Codex's protocol and recovery remain
independent.
Bedrock request options
Provider-level guardrailIdentifier, guardrailVersion, and guardrailTrace attach a guardrail to
Converse requests. The version defaults to "DRAFT" when an identifier is set; trace accepts
enabled, disabled, or enabled_full. requestMetadata supplies invocation-log tags. Invalid
entries and entries beyond Bedrock's 16-entry limit are dropped before dispatch; per-request tags
override matching model tags. These fields do not configure the Anthropic Messages route.
Compaction options
compactionModel(per model, includingmodelOverrides) — preferred compaction model, tried before the active model, chat-role candidates, and a largest-context fallback. It does not switch the active conversation model.remoteCompaction(provider level or per model) — opts eligible models into provider-native compaction. Supported keys:enabled,api,endpoint,model,v2StreamingEnabled,v2Endpoint,streamingEndpoint. Provider-level settings are the baseline; per-model keys override them.
Allowed provider/model api values
openai-completionsopenai-responsesopenai-codex-responsesazure-openai-responsesanthropic-messagesbedrock-converse-streamgoogle-generative-aigoogle-gemini-cligoogle-vertextypesafeopenrouter-decisionsopenai-decisionsgoogle-decisionsworkers-ai-systemone
typesafe, openrouter-decisions, openai-decisions, google-decisions, and workers-ai-systemone are judgment APIs, not chat transports: a model declared with one answers judgment requests and is selected by the judge model role. typesafe posts TypeSafe's System One body to {baseUrl}/v1/systemone (any System One server: TypeSafe, OpenJEV, Kev, self-hosted Clef); openrouter-decisions posts the same body to {baseUrl}/decisions; openai-decisions translates questions and answers to OpenAI's Decisions API at {baseUrl}/decisions (the bundled openai/gpt-6-luna-decisions row sends the wire model gpt-6-luna); google-decisions translates them to Google's Gemini Decisions API at {baseUrl}/decisions with the key in x-goog-api-key (the bundled google/gemini-decision-1 row); workers-ai-systemone posts the System One body to Cloudflare Workers AI at {baseUrl}/{model id}, where <account> in the base URL is filled from the stored credential's account id or CLOUDFLARE_ACCOUNT_ID. Its headers carry gateway routing or custom authentication headers for that traffic.
Judgment requests can share image attachments with vision-chat requests. Native OpenAI Decisions, Gemini Decisions, TypeSafe Jev, OpenRouter Jev, and Workers AI judges, plus prompted vision-chat models, support images; text-only candidates are skipped for image requests. Judge.supportsImages identifies compatible candidates, and a judge chain with no image-capable model fails explicitly rather than dropping images. Prompted judgments normalize images for the selected candidate, including upscaling undersized rasters and converting WebP for models with STB-backed decoders; native judges continue to receive the original image bytes. When constructing a NativeJudge directly for System One, set supportsImages: true; createNativeJudge derives this flag from the catalog.
Catalog-backed native judges apply the selected model's image bounds. Direct NativeJudge constructors can supply imageInput bounds explicitly; opting into images does not inherit Jev's size limits for unrelated System One models.
openrouter-decisions judges honor the model's compat.openRouterRouting and compat.extraBody as OpenRouter chat models do, under any base URL: routing (including an @provider selector pin) becomes the request's provider field, then extraBody is merged over the body. openRouterRouting accepts only only and order; for other provider preferences such as allow_fallbacks or data_collection, set the whole provider object in extraBody, which replaces the routing block. Other judgment APIs ignore both keys.
providers:
openrouter:
modelOverrides:
typesafe/jev-1.14:
compat:
extraBody:
provider: { only: [typesafe], allow_fallbacks: false, data_collection: deny }
OpenAI Decisions forwards embedded ImageContent.detail, and different explicit fidelity settings retain separate native image-judgment cache entries. TypeSafe Jev has no image-detail equivalent: detail is ignored on the wire and in cache identity, so requests that differ only by detail can reuse an answer. Omitted detail and explicit auto share the default setting.
Image inputs are validated before any candidate runs; malformed images fail as caller errors rather than exhausting the chain. Providers may enforce additional limits. Workers AI Clef accepts at most 4 PNG, JPEG, or WebP images of up to 4 MiB and 16 MP each, 8 MiB in total. Valid padded and unpadded base64, and MIME case variants, share one cache identity.
After image filtering, the same native-only tail policy used for text judgments applies: a failed native judge may fall through to another compatible native, never to a prompted chat model. Filtering removes natives without image support and natives whose image-count cap the request exceeds, so when no compatible native remains, eligible prompted candidates and a vision-capable session-model fallback can still answer. Size bounds never filter a native: each image is fitted into them first (see below).
Jev images (experimental)
Native image judgments for Jev are experimental. Direct TypeSafe Jev supports jev-latest, jev-preview, jev-1.13.0, and jev-1.14.0 (the default judge role uses typesafe/jev-1.14.0; jev-latest is TypeSafe's stable alias and has served jev-1.14.0 since 2026-10-22). OpenRouter supports typesafe/jev-1.13, typesafe/jev-1.14, and ~typesafe/jev-latest.
Images join state without replacing it: an object root keeps its fields and gains them under a collision-safe __omp_judgment_images key (with a numeric suffix if the key is taken), an array root gains them at the end, and a string root becomes [original, ...images]. Direct TypeSafe requests add each image as a referenced assets entry and put its reference in state, setting TypeSafe-Danger-Zone-Images: true only when images are attached; caller-supplied assets (auth gateway) must each be referenced in state, instructions, or criteria, and each split request carries only the assets it references. OpenRouter encodes each image as an image_url data URL part and uses neither the TypeSafe header nor a top-level images field.
Text-only requests retain their original request shape and bytes. Image support is limited to the listed TypeSafe Jev and OpenRouter Jev models; it does not imply support for other System One-compatible servers or OpenRouter Decisions models.
Both paths accept PNG and JPEG of 280–1568 pixels per side and 78,400–2,458,624 pixels in total, and reject anything else rather than resizing it. The judge chain therefore fits every image into a native judge's bounds before sending: an image already inside them keeps its original bytes; any other is scaled down past a maximum, or up toward a minimum as far as the maximums allow, without distortion, then padded with its top-left pixel when an extreme aspect ratio still leaves a side short (a 401×41 toolbar crop becomes 1568×160 centered on 1568×280), and re-encoded as PNG, or JPEG when the PNG exceeds the byte cap. TypeSafe Jev has no image-detail equivalent, so ImageContent.detail is ignored on direct TypeSafe requests.
Box questions ({ type: "box", instructions, image }) need Jev 1.14 and go only to TypeSafe and OpenRouter Decisions judges; the chain skips every other candidate for a request that has one, with no prompted or session-model fallback. image indexes the request's images and never reaches the wire, so instructions must still name the image to search among several. Jev answers with edges as fractions of the image it was sent; when fitting padded that image, the chain maps the edges back onto the image you passed and clamps any edge that lands in the padding.
See TypeSafe's image documentation and OpenRouter's multimodal Decisions guide for their image constraints.
OpenRouter's guide lists a 256 px minimum side, but a report of a live Jev 1.14 request says a 270×300 PNG received HTTP 400; the 280 px minimum side is intentional and remains in effect.
For example, configure TypeSafe Jev as the judge and attach an image in JavaScript or Python:
modelRoles:
judge: typesafe/jev-1.14.0
await judge(state, question, { images: ["./chart.png"] });
await judge(state, question, images=["./chart.png"])
A model or modelOverrides entry may also use a runner API, which serves one model kind; RUNNER_API_KINDS in packages/catalog/src/types.ts lists them (for example openai-images serves image, openai-embeddings serves embedding, openai-speech serves tts). web-search is built in and cannot be named here, so neither can kind: search. kind defaults to the api's kind (chat for chat transports), and an explicit kind must be one its api serves. Chat transports serve chat and tiny (small models for the tiny, memory, and judge roles); those that generate_image runs (openai-responses, openai-codex-responses, google-generative-ai, google-gemini-cli) also serve image: on openai-responses, the image is generated through the Responses image_generation tool, carried by a GPT-5+ chat model on the same provider, instead of /images/generations. This moves discovered gateway models to the image role:
providers:
my-gateway:
api: openai-responses
discovery:
type: openai-models-list
modelOverrides:
gpt-image-2:
api: openai-images # kind: image, generated via /images/generations
gpt-image-1.5:
kind: image # stays on openai-responses, generated via the hosted image tool
A configured kind, explicit or implied by a runner API, outranks the bundled catalog's classification of the same id and survives modelOverrides and refreshes.
Loading models.yml checks a modelOverrides kind only against an api the file names: the override's own api, or that of a models entry with the same id. A built-in or discovered model gets its api later, so its override kind is checked against that api when the override applies; a kind the api does not serve is ignored and logged. An api override without kind takes a runner API's kind, keeps a kind the new api still serves, and otherwise makes the model chat. A models entry that redefines a built-in id on a different api follows the same rule, so redefining an image row on openai-completions makes it chat.
Allowed auth/discovery values
auth:apiKey(default),none, oroauth.noneandoauthwaive the custom-providerapiKeyrequirement, butoauthdoes not create credentials or register a login flow. It forces OAuth-style request shaping; a usable credential must come from stored auth, environment, or a configured key. Customanthropic-messagesmodels also use OAuth-style shaping whenauthis omitted; setauth: apiKeyfor plain API-key shaping.discovery.type:ollama,llama.cpp,lm-studio,openai-models-list,proxy,litellm, orapple-foundation-models. Apple's transport is registered implicitly on supported Macs;apple-foundation-modelsis not an allowedapivalue in this YAML schema.discovery.injectV1: optional boolean, defaulttrue, foropenai-models-list. Setfalseto fetch the model list from{baseUrl}/modelswithout injecting/v1— for gateways that root their OpenAI-compatible surface at a versioned path (e.g.https://api.opper.ai/v3/compat) where the forced/v1/modelsreturns a different, smaller model list. Query strings inbaseUrlare ignored, matching the default mode.discovery.advertisedReasoning: optional boolean, defaulttrue, foropenai-models-list,lm-studio, andproxy. Discovery reads what a/v1/modelsrow states about its own reasoning surface (supported_reasoning_levels/default_reasoning_level/reasoning, top-level or undermetadata) and lets it outrank the bundled-reference guess, so a gateway that dispatches with its own catalog offers exactly the tiers its route accepts. A row that listsnonegetsreasoningDisableMode: none-effort, so a thinking-off request sends the off-switch instead of being clamped to the lowest tier. An advertised ladder also pinsdefaultLevelinside itself, so catalog policy cannot inject a tier the row omits. A row reportingreasoning: falseoverrides a reasoning-enabled reference for that id. Set the flag tofalsewhen an endpoint advertises levels its route rejects: discovery then builds each model's thinking surface from the bundled reference alone. A row that says nothing about reasoning is unaffected either way. ExplicitmodelOverrides.<id>.thinkingandcompat.supportsReasoningEffortstill win over both.litellmdoes not accept the flag: its authoritative reasoning metadata comes from/model_group/info, so the setting would only apply to its/v1/modelsfallback.transport:pi-nativeonly. When set, every model under that provider is sent to anomp auth-gatewaycompatiblebaseUrlviaPOST /v1/pi/stream;apiKeyis the gateway bearer.imageInputDecoder:stbonly. Set this on a custom model ormodelOverridesentry when the serving backend uses an STB-compatible image decoder that cannot accept WebP; OMP converts attached and historical WebP images before provider dispatch.imageCountBudget: positive integer. Set this on a custom model ormodelOverridesentry to state how many images one request to its host may carry. It replaces the catalog budget, which is 5 for a provider no catalog rule names. A gateway in front of a vendor with a higher limit needs it: once a session holds more images than the budget, OMP drops the oldest ones, which changes the cached prompt prefix.snapcompactShape:{ variant, frameSize? }. Set this on a custom model ormodelOverridesentry to choose the snapcompact frame shape its archive pages use, in place of the shape OMP picks for the model line.variantis asnapcompact.shapevalue other thanauto(for example11on16-bw);frameSizeis the frame edge in px, an integer from 64 to 2576, and defaults to the variant's own. Thesnapcompact.shapesetting, when notauto, still wins, the frame is still shrunk to the host'simage-max-edge, and billing estimates still follow the model.tokenizer: opt into a specific embedded local tokenizer when a proxy's model id is ambiguous or noncanonical. Allowed values:claude-v3,claude-v47,claude-v5,claude-v5-sonnet,qwen3,deepseek-v3,kimi-k2,glm5,cl100k(OpenAI GPT-3.5 and GPT-4) ando200k(OpenAI GPT-5 and later). Omit it to use catalog identity policy; models without one count in o200k.
Validation rules (current)
Full custom provider (models is non-empty)
Required:
baseUrlapiKeyunlessauth: noneorauth: oauthapiat provider level or each model
Override-only provider (models missing or empty)
Must define at least one of:
baseUrlapiKeyauth: noneheaderscompatdisableStrictTools: trueguardrailIdentifierrequestMetadata- non-empty
modelOverrides discoveryremoteCompaction
Discovery
discovery.timeoutMsoverrides that provider's runtime HTTP probe timeout in milliseconds. It must be a positive finite number.- Without an override, Ollama and llama.cpp loopback probes use short endpoint-specific budgets (150–250 ms); remote/LAN probes use 10 s. Generic model-list and proxy probes default to 10 s.
discoveryrequires provider-levelapi, exceptdiscovery.type: proxy(per-model wire auto-detected).
Remote compaction
remoteCompaction is independently sufficient for an override-only provider.
It supports enabled, api, endpoint, model, v2StreamingEnabled,
v2Endpoint, and streamingEndpoint.
openai-responses models on Amazon Bedrock's OpenAI routes (/openai/… on
bedrock-runtime.<region>.amazonaws.com or bedrock-mantle.<region>.api.aws,
Mantle's /v1 base, the runtime FIPS host, and PrivateLink hosts of both endpoints)
use native OpenAI compaction without an opt-in, for any provider id. Set
enabled: false to turn it off, or v2StreamingEnabled: false to keep only
the V1 /responses/compact request. See compaction.
Bedrock Converse Claude models compact natively through a Bedrock Runtime side request on AWS endpoints;
a custom non-AWS baseUrl needs remoteCompaction.enabled: true, and enabled: false opts out. See
compaction. The separate Anthropic Messages /anthropic route has
its own setup.
Model value checks
idis required and non-empty; optionalname, modelbaseUrl,contextPromotionTarget, andcompactionModelmust also be non-empty- custom
modelsentries require positivecontextWindowandmaxTokenswhen provided; the current auxiliary positivity check does not covermodelOverrides - on both custom models and overrides,
maxContextWindowmust be a positive safe integer no smaller thancontextWindowwhen both are set
Unknown compatibility keys
Unknown keys in provider, model, and modelOverrides compat blocks produce non-fatal warnings: a notification at interactive startup, and a stderr line in print and RPC modes and when listing models (including JSON output; stdout is unchanged). Each warning names the config file and the dotted key path; model array entries use zero-based indices, as schema errors do. The configuration still loads and unknown keys are preserved for forward compatibility. A registry reports each unknown key path only once, even after forced refreshes or re-reading an unchanged file.
Known record-level keys, at the top level of compat and inside its whenThinking override, come from both the models.yml compatibility schemas and the runtime compatibility vocabulary (wire axes). The schemas validate only a curated subset, so a runtime-recognized key such as streamFirstEventTimeoutMs does not warn merely because the file schema omits it. A nested whenThinking.whenThinking still warns: a thinking override cannot contain another thinking override. Thinking and catalog axes belong outside compat and are not included. Other nested checking follows only schema-declared fixed-field objects, including routing blocks and reasoningEffortMap; open maps such as extraBody accept arbitrary keys and nested payloads. Runtime extension provider registrations are not checked against the file schema: they can register custom APIs with their own compatibility fields.
The runtime vocabulary is not filtered by the provider's api: a wire key that only another API family reads (for example an Anthropic-only key in an openai-completions provider) does not warn, even though it has no effect there.
Command-resolved secrets
Provider apiKey values and provider/model headers values may start with ! to read a secret from command stdout. Commands run asynchronously with a 10 s timeout; stdout is trimmed, and empty/failing commands are omitted. Loading or inspecting the catalog does not execute them: credentials resolve when a request or online credential probe needs them.
providers:
openai:
apiKey: "!op read op://dev/openai/api-key"
headers:
X-Team-Key: "!bw get password omp-team-key"
Successful command outputs are cached for the process lifetime, and concurrent requests share an in-flight execution. Failures back off for 30 seconds. Refresh callers that request refreshCommandCredentials (including the model hub's explicit refresh) and 401 credential recovery invalidate the relevant cached API keys and headers; an ordinary catalog refresh does not. Runtime API-key overrides, including --api-key, take precedence over configured credentials.
Merge and override order
ModelRegistry composition order:
- Load
models.yml/models.yamlto establish provider overrides, custom models, model overrides, and discovery configuration. - Load built-in models from
@oh-my-pi/pi-catalog(getBundledProviders/getBundledModels), applying provider overrides and context policies. - Merge cached and runtime-discovered rows. Authoritative provider catalogs can replace their bundled chat roster.
- Merge configured custom
models, then extension-registered models:- a matching
provider + idreplaces transport metadata and patches defined model fields - otherwise append a model, filling omitted metadata from a bundled reference or local defaults
- a matching
- Collapse effort-tier variants, apply
modelOverrides, and select configured extended windows. - Apply provider Bedrock fields, runtime provider overrides, discovery wire policies, and extension OAuth catalog projections.
Background discovery repeats the merge with custom definitions and model overrides applied after the discovered rows, so explicit user configuration remains effective.
Provider-model cache and static fingerprint
Cached per-provider model lists are persisted in models.db (schema version 13) as materialized
models. A materialization-policy stamp includes the application version, builder version, and
compiled-rule hash; incompatible rows are invalidated. Request-header values are never persisted
and must be restored from trusted local metadata or configuration.
static_fingerprint hashes the current static slice and merge policy. It is recomputed from the
array's current contents, not stored on the array. When a fresh authoritative cache matches and no
headers remain unresolved, resolveProviderModels can skip the full merge. Additive shared-catalog
caches still reapply static rows, and returned models pass through variant collapsing.
The model-manager default cache TTL is two hours (individual providers can override it);
non-authoritative snapshots use a five-minute retry interval.
Shared catalog refresh
The bundled catalog remains the startup and offline baseline. Startup loads configuration and cached rows, materializing provider slices lazily; a local-only credential-scoped hydration pass precedes selector validation. Background refresh fetches the shared models.dev catalog through https://catalog.stencil.so/models.json.zstd for supported providers. New model IDs are merged additively into each provider's bundled slice, normalized through that provider's catalog descriptor, and persisted in the model-cache database. This allows newly published models to appear without waiting for a new OMP binary.
Remote rows can supply current limits, pricing, modalities, and capability flags for newly added IDs, but they cannot introduce code, arbitrary headers, or an unregistered provider. Providers whose descriptors declare endpoint discovery authoritative use that result for their available chat roster. The shared catalog is not authoritative: it does not remove bundled models when a remote row disappears.
Fresh cached snapshots avoid a network request. If refresh fails, OMP keeps the last usable cached snapshot and marks it stale; without a cache, it falls back to the bundled catalog. Provider discovery state records source (bundled, models.dev, provider, or cache) and fetchedAt so callers can distinguish current remote data from an offline fallback.
Provider and model identity
The registry retains concrete provider + id identities. Use an exact
provider/modelId selector when the same model id exists under multiple providers. Session state
and transcripts record the concrete provider/model that executed the turn.
Provider defaults vs per-model overrides:
- Provider
headers,compat, andremoteCompactionare baselines. - Model
headersoverride provider header keys. modelOverridescan override model metadata (name,api,kind,reasoning,thinking,input,imageInputDecoder,imageCountBudget,snapcompactShape,tokenizer,supportsTools,cost,promptCache,premiumMultiplier,contextWindow,maxContextWindow,maxTokens,omitMaxOutputTokens,preferWebsockets,headers,compat,contextPromotionTarget,compactionModel, andremoteCompaction).compatis deep-merged for nested routing blocks (openRouterRouting,vercelGatewayRouting,extraBody, andwhenThinking).
Prompt cache lifetimes
promptCache states how long the provider keeps a prompt cache entry alive for each retention tier
OMP can request (short is normally the default; Anthropic OAuth subscriber requests default to
long where supported, unless an explicit retention setting or PI_CACHE_RETENTION overrides it). Values are seconds and are
estimates: providers publish ranges, so pick the conservative end.
providers:
anthropic:
modelOverrides:
claude-sonnet-5:
promptCache: { short: 300, long: 3600 }
An explicit promptCache replaces the model's catalog lifetimes rather than
merging with them: promptCache: {} disables warming for that model, and a
short-only value does not inherit a catalog long lifetime. For a matching
model, modelOverrides.promptCache has highest priority. A runtime-registered
model definition replaces the matching YAML models definition for lifetime
selection, even when the runtime promptCache is omitted: the actual effective
model's catalog defaults apply instead of the YAML lifetime. Without a runtime
replacement, the matching YAML lifetime applies, or catalog defaults if absent.
The ordinary bun run gen:models command recomputes bundled prompt-cache
lifetimes from current catalog policy; there is no separate cache-regeneration
command.
Direct Anthropic keeps its existing 5 min / 1 h lifetimes (short: 300, long: 3600),
defaulting to 5 min for API keys and 1 h for OAuth subscriber sessions; API keys can
explicitly select long. Factory Droid's Claude models have the same 5 min / 1 h lifetimes and
default to 5 min; long writes 1 h entries on the Anthropic, Vertex, Bedrock and Azure upstreams
and stays 5 min elsewhere. Claude on native Amazon Bedrock Converse has a 5 min TTL; 1 h is
available only where both catalog metadata and the request wire support it. Claude on
Bedrock Runtime or Mantle's Anthropic Messages route has a 5 min lifetime under existing
request support; an explicit long request falls back to short when unsupported. Other Amazon Bedrock models,
including Nova and GPT, are not enabled for warming. A model without a lifetime for the
retention tier actually used is never warmed; custom models and modelOverrides can opt in
with promptCache once the backing cache behavior is known. See providers.cacheWarming in
Settings.
Usage costs and time-based pricing
OMP estimates token costs from the selected provider/model's catalog pricing, preferring server-reported monetary costs when available. Completed messages retain their recorded costs: crossing a pricing boundary, switching models, or reopening a session does not reprice accumulated usage.
For the first-party deepseek provider, the catalog follows DeepSeek's official pricing:
- Peak hours are Monday–Friday, 01:00–04:00 and 06:00–10:00 UTC (start inclusive, end exclusive). All other times, including weekends, cost 50% of peak rates.
- Flash pricing covers
deepseek-flashand the retired-but-still-accepteddeepseek-v4-flashanddeepseek-v4-flash-vision-expids, all billed at the Flash card. Peak rates per million tokens are $0.30 uncached input, $0.006 cached input, and $1.20 output. deepseek-v4-proinitially uses peak rates of $1.32 uncached input, $0.044 cached input, and $3.96 output per million tokens. From 2026-09-14 04:00 UTC, its estimates use the Flash rate card, with the same peak/off-peak schedule.
Some catalog prices change on a date without a peak/off-peak tariff. Gemini 4 Argon on google, google-vertex, google-antigravity, and cursor is estimated at $2 input / $0.10 cached input / $10 output per million tokens through 2026-11-30, and at Google's $4 / $0.20 / $20 list price from 2026-12-01 08:00 UTC (midnight US Pacific). The request's timestamp picks the price, so a model loaded before the change prices later requests at the new rate without a catalog update, and the model browser and omp models --json show the price in force.
Local estimates use the assistant message's request-start timestamp to choose both the rate card and tariff for the whole request. This is OMP's estimation convention: DeepSeek's pricing page does not specify how its server bills a request spanning a boundary. When importing historical usage without recorded cost, the stats importer leaves scheduled pricing unpriced if no request timestamp can be recovered, rather than choosing a wall-clock tariff.
The status line's cost segment appends ↑ for peak or ↓ for off-peak pricing on the currently active provider/model, using the current wall clock. It refreshes at tariff boundaries even while idle; the arrow is not a label for the accumulated session total. Models without a peak/off-peak tariff, including dated price changes and explicit flat-price overrides, show no arrow.
An explicit model cost in models.yml, including modelOverrides, is a flat-price override and disables inherited time-based pricing for that model. Omitting cost preserves catalog pricing. models.yml does not configure a timeBased schedule; that metadata belongs to the catalog's KDL pricing rules.
A new custom model in models.yml that omits cost inherits its bundled reference row's card,
schedule included. References are matched by model id and prefer larger context/output limits,
then complete cache pricing and first-party OpenAI rows. A same-provider, same-id custom entry
instead preserves the existing model's pricing when cost is omitted. Generic proxy and
OpenAI-model-list discovery keeps pricing local-unknown (zero) rather than borrowing upstream
prices; rich provider discovery such as LiteLLM can supply its own prices.
Runtime discovery integration
Implicit Ollama discovery
If ollama is not explicitly configured, registry adds an implicit discoverable provider:
- provider:
ollama - api:
openai-responses - base URL:
OLLAMA_BASE_URL, orOLLAMA_HOST, orhttp://127.0.0.1:11434 - context window:
OLLAMA_CONTEXT_LENGTHif set, otherwise Ollama/api/showmetadata, otherwise128000 - auth mode: keyless (
auth: nonebehavior)
Runtime discovery calls Ollama endpoints and normalizes discovered OpenAI-compatible models to openai-responses.
OLLAMA_CONTEXT_LENGTH does not configure Ollama's runtime num_ctx; set that in Ollama/model configuration separately.
Implicit llama.cpp discovery
If llama.cpp is not explicitly configured, registry adds an implicit discoverable provider:
- provider:
llama.cpp - api:
openai-responses - base URL:
LLAMA_CPP_BASE_URLorhttp://127.0.0.1:8080 - auth mode: keyless (
auth: nonebehavior)
Runtime discovery calls llama.cpp model endpoints and synthesizes model entries with local defaults.
The provider api is the default for discovered models; catalog rules can override it per model class. Qwen-class models on any discovery.type: llama.cpp provider (implicit or explicit) are discovered as openai-completions, because the Responses API cannot carry the chat template's thinking controls (enable_thinking / chat_template_kwargs). The override lives in packages/catalog/src/compat/rules/providers/llama.cpp.kdl (discovery-api).
After a first response loads a lazy llama.cpp model, OMP re-probes its runtime context and input
metadata. Explicit custom-model and modelOverrides limits take precedence over that probe.
The implicit provider is keyless only when no credential source is configured.
Implicit LM Studio discovery
If lm-studio is not explicitly configured, registry adds an implicit discoverable provider:
- provider:
lm-studio - api:
openai-completions - base URL:
LM_STUDIO_BASE_URLorhttp://127.0.0.1:1234/v1 - auth mode: keyless (
auth: nonebehavior)
Runtime discovery fetches the OpenAI-compatible model list and native LM Studio metadata when
available. Native loaded_context_length takes precedence over the training window; after a first
response JIT-loads a model, OMP refreshes that runtime metadata. Explicit custom-model and
modelOverrides limits remain authoritative. Discovered LM Studio models use imageInputDecoder: stb.
Decision models (type: "decision" in LM Studio's native GET /api/v1/models) are discovered as
judge models on the openai-decisions API: judgments post to {baseUrl}/decisions, LM Studio's
OpenAI-compatible Decisions endpoint, instead of chat completions. They accept images when LM Studio
reports has_vision_adapter: true. Select one with modelRoles.judge: lm-studio/<model>.
This path also works for local OpenAI-compatible servers that are not LM Studio. For example, if oMLX is bound to Ollama's usual port, set LM_STUDIO_BASE_URL=http://127.0.0.1:11434/v1 to discover it through the existing /v1/models flow. Running oMLX and Ollama side by side requires assigning a different port to one of them. Do not configure oMLX as ollama: Ollama discovery uses native /api/tags and /api/show endpoints, not OpenAI /v1/models.
Implicit Apple Foundation Models discovery
On Apple Silicon macOS, an unconfigured, non-disabled apple provider is probed through the
in-process Foundation Models bridge. When the bridge reports it usable, apple/on-device is
available without credentials, with context size, reasoning, image input, and tool support derived
from bridge metadata. It is not selected automatically: its on-device context window may be
smaller than the default coding-agent prompt and project instructions. Select it deliberately with
--model apple/on-device or /model; otherwise use /login or configure another local model.
Ineligible devices, disabled Apple Intelligence, and builds without the bridge yield no models.
Its internal API is apple-foundation-models; no HTTP endpoint is used.
LiteLLM provider discovery
When litellm is active (for example through LITELLM_API_KEY or stored auth), runtime discovery uses the LiteLLM proxy:
- provider:
litellm - api:
openai-decisions(kindjudge) for model groups withmode: decisions;openai-responsesfor OpenAI-backed models;openai-completionsfor other models - base URL: explicit provider
baseUrl/models.ymlconfig, otherwiseLITELLM_BASE_URL, otherwisehttp://localhost:4000/v1 - auth mode:
LITELLM_API_KEYor stored LiteLLM auth when the proxy requires a key
Runtime discovery probes LiteLLM management metadata in order: GET /model_group/info, GET /v2/model/info, GET /model/info, and GET /v1/model/info. The configured key must be authorized to read at least one of these routes; on deployments that restrict management endpoints, grant the route through LiteLLM's allowed_routes access controls or use a master/admin key for discovery.
If every metadata route is unavailable, discovery falls back to the OpenAI-compatible GET /models list. A forbidden or failed metadata request is logged once with its endpoint and status; 404 is treated as an absent route. Both paths exclude models explicitly marked with known task-specific LiteLLM modes: audio_speech, audio_transcription, batch, embedding, guardrail, image_edit, image_generation, moderation, ocr, rerank, search, vector_store, and video_generation. Missing, null, and unrecognized modes remain selectable so router aliases continue to work. Rich metadata maps per-model context, capability, and upstream-provider fields. OpenAI-backed models use LiteLLM's Responses route so reasoning summaries remain available; mixed-provider groups stay on Chat Completions. Bare fallback ids use the known OpenAI model families for routing and bundled reference metadata when available. Fallback pricing remains unknown (represented by zero); configured generic discovery uses a 128,000-token context default when neither the endpoint nor a bundled reference supplies a limit. Rich management metadata can supply provider-specific prices. Later probes fill or override reported metadata for models in the first usable roster rather than unioning every endpoint's roster.
Bifrost provider discovery
When bifrost has a credential (BIFROST_API_KEY or stored /login bifrost auth), runtime discovery reads the gateway's GET /models roster from the provider baseUrl / models.yml config, otherwise BIFROST_BASE_URL, otherwise http://localhost:8080/v1. Model ids keep Bifrost's <bifrost-provider>/<model> form. Chat models use openai-completions; decision models become openai-decisions judges on POST {baseUrl}/decisions. The roster is authoritative and cached per key and base URL. Row mapping, decision-model detection, and judge retry guidance are in Bifrost.
Generic OpenAI-compatible discovery
openai-models-list reads {baseUrl}/v1/models by default (without adding a second /v1).
discovery.injectV1: false treats the configured URL as the complete API root. Reported
max_model_len wins over context_length. If both are absent, nested
limits.max_input_tokens and limits.max_output_tokens supply their sum as context only when both
are positive safe integers and the sum is safe. A valid limits.max_output_tokens independently sets the
chat output cap, clamped to the resolved context; an incomplete or invalid context pair does not
discard a valid output limit. Without it, a valid top-level max_output_tokens, then
max_completion_tokens, then top_provider.max_completion_tokens, then the generic max_tokens
sets the cap, ahead of any bundled-reference limit. Each spelling is validated on its own, so an
unusable value on one never suppresses a usable sibling. Otherwise, context and output follow the
existing native/reference/default fallback.
Silent endpoints can inherit bundled-reference limits, reasoning, and input modalities; unknown models
use 128,000 context and 32,768 output as generic chat defaults. Output caps are bounded by the resolved context;
Anthropic-routed models use an 8,192-token fallback output cap.
When neither configuration, discovery nor the catalog establishes reasoning support, thinking is unverified, not disabled. The first request with a thinking level (including the session default) runs small, separate capability probes before sending your turn. The requested level is tried first; all six levels are tested in parallel. If that format fails, alternate effort, toggle or token-budget formats are tried for the API. Probes contain only a fixed arithmetic question, never your conversation or tools. They add requests and latency on the first use of an unknown model.
Accepted levels, request format and observed reasoning are saved in models.db, scoped to provider,
API, endpoint and wire model ID. Later turns reuse the result and clamp unsupported levels. Positive
results expire after 30 days; results with no reasoning controls expire after one day. Auth failures,
rate limits, outages and timeouts are inconclusive and are not saved as lack of support. Parameter
acceptance counts even if the provider returns no visible reasoning. Explicit capability settings,
including reasoning: false, take precedence over probing.
A row advertising only image output becomes an image-generation runner; embedding-only output
becomes an embedding runner. speech as the only output becomes a tts runner on openai-speech,
and transcription an stt runner on openai-transcriptions. Outputs come from the row's
modality arrays or OpenRouter's architecture.modality summary
(text->speech). Mixed outputs, a bare audio output (Poe lists TTS voices and music generators
alike as text->audio), and rows that declare no modalities remain chat models. These runners are
visible with omp models --kind all, not the default chat listing.
Explicit provider discovery
You can configure discovery yourself:
providers:
ollama:
baseUrl: http://127.0.0.1:11434
api: openai-responses
auth: none
discovery:
type: ollama
llama.cpp:
baseUrl: http://127.0.0.1:8080
api: openai-responses
auth: none
discovery:
type: llama.cpp
Custom LiteLLM gateways can use the same rich discovery path:
providers:
litellm-gateway:
baseUrl: http://gateway.example:4000/v1
apiKey: LITELLM_API_KEY
api: openai-completions
discovery:
type: litellm
LiteLLM metadata endpoints use the configured base URL with a trailing /v1 stripped for discovery only, preserving any preceding proxy path. Runtime model calls keep the configured OpenAI-compatible /v1 base URL.
Proxy discovery (discovery.type: proxy)
For Anthropic+OpenAI-compatible proxies (new-api / one-api / similar)
that expose both /v1/messages and /v1/chat/completions behind the same
host. Discovery hits GET /v1/models (10s timeout, OpenAI-style payload) and
derives each model's api from the entry's supported_endpoint_types:
- contains
"anthropic"->api: anthropic-messages(routes via/v1/messages) - contains
"openai"->api: openai-completions(routes via/v1/chat/completions) - otherwise -> falls back to provider-level
api, oropenai-completionswhen it is omitted
Provider-level api is optional with discovery.type: proxy because the
per-model wire is auto-detected. The Anthropic SDK strips a trailing /v1
from baseUrl before appending /v1/messages, so a single discovery baseUrl
(ending in /v1) round-trips correctly to both wires.
providers:
newapi-reseller:
baseUrl: https://api.example.com/v1
apiKey: xxxx
authHeader: true # injects Authorization: Bearer for openai models
disableStrictTools: true # most anthropic-fronted proxies reject `strict`
discovery:
type: proxy
Extension provider registration
Extensions can register providers at runtime (pi.registerProvider(...)), including:
- model replacement/append for a provider
- custom stream handler registration for new API IDs
- custom OAuth provider registration
fetchDynamicModelsfor a credential-aware live roster (cached with a default 24-hour TTL)- custom usage reporting and OAuth
modifyModelsprojections reapplied after catalog rebuilds
Auth and API key resolution order
When requesting a key for a provider, effective order is:
- Runtime override (CLI
--api-key) - Config override (
models.ymlproviders.<name>.apiKey) - Stored OAuth credential (with refresh)
- Login-sourced stored API key
- Extension-registered config fallback (
keys.setConfig(..., { fallback: true })) - Environment variable mapping (
OPENAI_API_KEY,ANTHROPIC_API_KEY, etc.) - Other stored API key, such as a broker-migrated copy
The fallback tier is for registered providers with their own login flow. Keys explicitly supplied
in models.yml belong to tier 2, not this fallback tier.
models.yml apiKey behavior:
- Value is first treated as an environment variable name.
- If the env var is unset or empty, the literal string is used as the token.
If authHeader: true and provider apiKey is set, models get:
Authorization: Bearer <resolved-key>header injected.
Resolution does not fail for a missing variable: with apiKey: MY_PROVIDER_API_KEY
and authHeader: true, an unset or empty MY_PROVIDER_API_KEY produces
Authorization: Bearer MY_PROVIDER_API_KEY. Launchers using env-backed keys must
check that the variable is set and non-empty before starting OMP.
Command-resolved secrets do not use this literal fallback: a failing command or empty trimmed stdout resolves to no value, so it does not add a derived bearer header.
Keyless providers:
- Providers marked
auth: none, implicit local providers, and optional-key logins stored in keyless mode can be available without credentials. ModelRegistry.getApiKey*returnskNoAuthwhen a provider is keyless and no real credential source is configured; configured credentials still take precedence.
Broker mode
When OMP_AUTH_BROKER_URL (or auth.broker.url) is set, the local SQLite credential store is replaced by RemoteAuthCredentialStore. Layers 3, 4, and 7 above (stored OAuth and API-key credentials) are served from a broker-supplied snapshot whose refresh tokens are redacted; expiry triggers POST /v1/credential/:id/refresh on the broker rather than a local refresh.
AuthStorage.keys.setConfig lets a models.yml apiKey win over a broker-resolved OAuth token without overriding a runtime --api-key. See auth-broker-gateway.md for the full broker / gateway design and env surface (OMP_AUTH_BROKER_URL, OMP_AUTH_BROKER_TOKEN, auth.broker.url, auth.broker.token).
Model availability vs all models
getAll()returns chat models by default;getAll("all")includes every catalog kind.getAvailable()is also chat-only by default; a kind or"all"includes the corresponding runners.- Availability excludes
disabledProvidersand requires a keyless provider or configured credential source. It does not execute secret commands or refresh OAuth tokens.
A model can exist in the registry without being available, and a configured credential can still
fail when resolved for a request. enabledProviders controls foreign configuration-source discovery,
not an allowlist of model transports.
Runtime model resolution
CLI and pattern parsing
model-resolver.ts supports:
- exact
provider/modelId - exact model id (provider inferred)
- fuzzy/substring matching for bare ids (
opus,gpt-5.2); aprovider/modelIdselector must match exactly - glob scope patterns in
--models(e.g.openai/*,*sonnet*) - optional
:thinkingLevelsuffix (off|minimal|low|medium|high|xhigh|max|auto|inherit) @upstreamrouting suffix on OpenRouter and Vercel Gateway selectors (for example,openrouter/anthropic/claude-sonnet-5@anthropic:high); an exact literal model id still wins
--provider is legacy; --model is preferred. An exact provider/modelId is unambiguous; bare ids
and fuzzy patterns are resolved against the available concrete models.
Resolution precedence for exact selectors:
- exact
provider/modelIdreference - exact bare id (case-insensitive); when several providers carry the same id, a preference ranking picks the winner (see below)
- retired effort-tier variant alias (collapsed catalog entries, e.g.
X/X-thinkingtwins) - substring matching with an alias-vs-dated pick (bare ids only)
A provider/modelId selector whose provider is known stops after the exact phases: it never runs a similarly named sibling. A miss fails with Model "…" not found, which suggests up to three close ids from that provider. A configured default model that misses produces a warning naming it and the model that runs instead, unless a configured retry.fallbackChains entry takes over; a configured dictation model that misses warns the same way.
Glob scope patterns (used by enabledModels and CLI --models) run separately over concrete models after exact matching.
When a bare id matches models from multiple providers, preference order is:
- recently used model variants
- provider priority (
modelProviderOrdersetting, then built-in catalog provider priority) - recently used providers
- registry order
Initial model selection priority
findInitialModel(...) uses this order:
- explicit CLI provider+model
- first scoped model (if not resuming)
- saved default provider/model
- known provider defaults (e.g. OpenAI/Anthropic/etc.) among available models; a provider whose discovery marks the account's default model (
isProviderDefault, e.g. Devin) uses it in place of its bundleddefault-model - first available model
The automatic fallback first restricts the pool to providers with concrete credentials (including keyless locals) when any exist. Ambient AWS/Vertex credential sentinels remain usable, but do not displace providers with explicit credentials. Session restoration is handled separately and checks that the saved model still exists and resolves a usable credential.
Role aliases and settings
Model roles assign model selectors to workloads. Configure them under modelRoles in config.yml, not in models.yml; models.yml defines providers and model metadata.
Built-in roles are grouped in the model picker:
- Chat roles:
default,smol,slow,vision,plan,commit,tiny,memory,task, andadvisor. Thetinyandmemoryroles accept both ordinary chat models andtinycatalog models. - Model-kind roles:
image,web,speech,dictation, andjudge. These select image generation, search/grounded chat, text-to-speech, speech-to-text, and judgment runners respectively. Thejudgerole also accepts tiny and chat models.
vision and image are different workloads: vision selects a chat model for image analysis, such as read screenshot.png?q=...; image selects a model with catalog kind image for generate_image. Assigning a model to vision does not give it image-input support: image questions additionally check that the model can send image input to its provider.
The tiny role selects lightweight models for background work such as session titles; when unset, it resolves through @smol. The memory role resolves through @tiny when unset. See model settings for configuration and fallback-chain examples.
Assigning a non-default role in /models normally saves its selector without switching the active conversation model. A workload uses the role when invoked; assigning plan does not itself enter plan mode, and calling todo does not itself select the plan model. While plan mode is active, changing the plan role reapplies its model. Assigning default normally also switches the active model, unless a higher-priority settings layer overrides the edited assignment. The session-only model picker changes the active model without rewriting role assignments.
Role aliases like @smol expand through settings.modelRoles; * selects @default. Quote @ aliases in YAML values (plan: "@slow"). Chat-role values can append a thinking selector such as :minimal, :low, :medium, or :high; model-kind roles do not use chat thinking suffixes.
Role values can contain comma-separated selectors; selection uses the first available match,
not a per-request retry chain. Request-failure fallbacks are configured separately under
retry.fallbackChains (role, exact model, or provider-wildcard keys; see Settings).
Custom role names
can be introduced through modelRoles, modelTags, or cycleOrder; they use chat models.
Unset smol and slow inherit an explicitly configured default before their built-in priority
lists. The advisor uses an explicitly configured slow, otherwise its own strong-model priority
chain rather than inheriting the active conversation model.
If a role points at another role, the target model still inherits normally and any explicit suffix on the referring role wins for that role-specific use.
Model presets
A model preset is a named snapshot of every role assignment plus defaultThinkingLevel, so you can swap a whole setup at once:
/modelpreset save cheap # save the current roles and thinking level
/modelpreset switch deep # apply a saved preset
/modelpreset # pick one from a list (interactive)
/modelpreset list | delete <name>
In /models, press s in the Roles view to save the current setup under a name. Presets live under modelPresets in config.yml:
modelPresets:
deep:
modelRoles:
default: anthropic/claude-opus-4-5:high
smol: anthropic/claude-sonnet-4-5
defaultThinkingLevel: high
Switching writes roles the way the model picker does: into the scope chosen by modelRoleStorage, clearing roles the preset leaves out and replacing --model/--smol session overrides. The preset's defaultThinkingLevel is written to the global config. It then switches the active model to the resulting default (an automatic provider-default selection when the preset has none) and sets the session's thinking level from the :level suffix on that selector, or else the preset's defaultThinkingLevel; a :inherit suffix leaves the level the model switch set. When a preset's default model is unavailable, nothing is changed. Roles that another layer still decides — a --config file, a project config in global storage, or the global config in project storage — are listed in the switch message with the layer that wins, instead of being reported as switched. The same goes for a defaultThinkingLevel set by a project config or --config file: the session still switches to the preset's level, but the message names that layer, whose level returns on the next start.
When several config layers define a preset of the same name, the highest layer (command line, then --config file, then project config, then global config) wins whole: entries are never merged across layers, so a project deep that only sets default applies without the global deep's other roles. A null entry in a --config file (or a command-line override) hides the preset from lists and switches; a null entry in a project config is ignored, so the global preset of that name still applies. Saving always writes the named entry to the global config and reports when a higher layer still takes precedence for that name.
Saving captures the effective assignments — including any --model session override — and the configured defaultThinkingLevel, not the session's live thinking level.
Related settings:
modelRoles(record)enabledModels(scoped pattern list)modelProviderOrder(provider precedence when equivalent concrete choices share an id)providers.kimiApiFormat(auto|openai|anthropic;autofollows server-declared model metadata)providers.openaiWebsockets(auto|off|onwebsocket preference for OpenAI Codex transport)providers.openaiResponsesWebsockets(opt-in standard Responses transport; see Standard Responses WebSockets)providers.openaiLiveSteering(deliver mid-response user messages into GPT-6 responses over the Codex WebSocket)
modelRoles stores model selectors such as provider/modelId; enabledModels and CLI --models
accept exact selectors, globs, and fuzzy matches. The resulting scope restricts chat models only
(Ctrl+P cycling, the startup model, chat roles in /model); judge, search, image, and speech
models stay available for their roles, so entries naming them are accepted but have no effect.
enabledModels, enabledProviders, and disabledProviders entries may also be scoped to a path prefix:
enabledModels:
- claude-sonnet-4-5
- path: ~/work
models:
- anthropic/claude-opus-4-5
disabledProviders:
- ollama
- path: ~/private
providers:
- anthropic
String entries apply everywhere. Scoped entries apply when the current working directory is the configured path or one of its subdirectories. Use path, paths, pathPrefix, or pathPrefixes; use models for enabledModels, providers for either provider setting, or values for any of them.
/model and omp models
Both surfaces keep provider-prefixed concrete models visible and selectable.
/model//modelsopens the model hub with role assignments and provider catalogs; the session-only picker changes the active model without saving a role assignment.omp models(defaultlsaction) prints provider-grouped tables of available chat models;--kind <kind>selects another catalog kind and--kind allincludes every kind.omp models find <substring>filters by provider, id, or name;omp models refreshforces an online catalog re-fetch ignoring the model cache TTL; a provider name doubles as anlsfilter (e.g.omp models openai-codex).- Other flags:
--json,-e <path>/--extension <path>(repeatable),--no-extensions(skip ambient discovery; explicit-estill loads), and--config <overlay>(repeatable).
JSON includes provider, kind, id, selector, name, limits, reasoning/thinking metadata,
declared input, and cost; it does not expose the model's transport api.
Selecting a provider row stores its explicit provider/modelId.
The table's images column reports what the transport will actually send, so a model whose images are
stripped (compat.stripImageInput, see Image handling) shows no
even when its spec declares input: [text, image]; --json keeps the declared input.
Context promotion
Context promotion switches to an explicitly configured larger-context model before compaction. It is attempted on context overflow errors and at pre-prompt or post-turn compaction thresholds.
Context promotion and retry model fallback are independent.
Turning off Auto-Promote Context (contextPromotion.enabled) does not disable
retry.fallbackChains: provider errors still switch the active model while retry.modelFallback
is on, even when the fallback model happens to have a larger context window. To stop those
switches, set retry.modelFallback: false; same-model retries (retry.enabled) and automatic
compaction (compaction.enabled) are unaffected.
Trigger and order
When a turn fails with a context overflow error (e.g. context_length_exceeded), AgentSession attempts promotion before falling back to compaction:
- If
contextPromotion.enabledis true, resolve a promotion target (see below). - If a target is found, switch to it and retry the request — no compaction needed.
- If no target is available, fall through to auto-compaction on the current model.
Target selection
Selection is explicit and model-driven:
currentModel.contextPromotionTarget(if configured)
Only the configured target is considered; context promotion does not automatically choose a larger same-provider/API sibling. The target must be available, differ from the current model, have a strictly larger known context window, and resolve a usable credential (ModelRegistry.getApiKey(...)).
OpenAI Codex websocket handoff
If switching from/to openai-codex-responses, session provider state key openai-codex-responses is closed before model switch. This drops websocket transport state so the next turn starts clean on the promoted model.
Persistence behavior
Promotion uses temporary switching (setModelTemporary):
- recorded as a
model_changewith the ephemeral role"fallback"(not a durable user model selection) - does not rewrite saved role mapping
Configuring promotion targets
Configure the target directly in model metadata via contextPromotionTarget.
contextPromotionTarget accepts either:
provider/model-id(explicit)model-id(resolved within current provider)
Example (models.yml) for an explicit OpenAI promotion target:
providers:
openai-codex:
modelOverrides:
gpt-5.5:
contextPromotionTarget: openai-codex/gpt-5.4
Do not rely on a model-name-derived chain: configure the target explicitly or use a target supplied by the provider's discovered metadata.
Compatibility and routing fields
The compat block supplies sparse overrides to packages/catalog/src/compat/resolve.ts, after
endpoint detection and the KDL provider/model rules in packages/catalog/src/compat/rules/.
The YAML schema is constructed in packages/coding-agent/src/config/models-config-schema-bundle.ts.
The resolved shape depends on the model's API: OpenAICompat is the sparse OpenAI input type, while
chat-completions and Responses transports consume their corresponding resolved records from
packages/catalog/src/types.ts.
Endpoint-specific exceptions that interact with these fields are cataloged in Provider endpoint constraints.
models.yml supports the following keys (all optional; unset uses catalog rules and endpoint defaults).
Fields only affect APIs whose resolved compatibility record declares them:
Request shaping:
supportsStore— emitstore: falseon requests. Default: auto (off for non-standard endpoints).supportsDeveloperRole— use thedevelopersystem role for reasoning models instead ofsystem. Default: auto.supportsMultipleSystemMessages— preserve separate leading system/developer messages instead of coalescing them. Default: auto (known OpenAI-compatible hosted APIs preserve; strict-template/local hosts coalesce).supportsUsageInStreaming— sendstream_options: { include_usage: true }to receive token usage on streaming responses. Default: auto (normally on, off for Cerebras hosts).maxTokensField—"max_completion_tokens"or"max_tokens". Default: auto.supportsToolChoice— allow thetool_choiceparameter. Default: auto. Setfalsefor endpoints that 400 ontool_choice(e.g. DeepSeek when reasoning is on).supportsForcedToolChoice— accept a forcedtool_choicethat requires a specific tool. Default: auto. Whenfalse, a forced selector is downgraded toautoso the tool stays available for endpoints that reject forced tool calls (e.g. some thinking-required OpenAI-compatible models).disableReasoningOnForcedToolChoice— dropreasoning_effort/ OpenRouterreasoningwhenevertool_choiceforces a call. Default: auto (Kimi/Anthropic-fronted endpoints).disableReasoningOnToolChoice— drop reasoning fields whenever anytool_choiceis sent. Default: auto (DeepSeek reasoning models).disableReasoningWithTools— suppress reasoning when tools are present even without forced tool choice. Default:falseunless catalog policy overrides it.alwaysSendMaxTokens— always send a max-token field when the caller did not provide one. Default: auto (Kimi-family models derive TPM limits frommax_tokens).strictResponsesPairing— Responses-API tool-call/result history must be strictly paired. Default: auto (Azure OpenAI, GitHub Copilot).statefulResponses— enable or disable storedprevious_response_idchaining foropenai-responses. Enabling it sendsstore: trueand delta input on later turns; disabling it replays full context withstore: false. Precedence: call option >PI_OPENAI_STATEFUL>compat.statefulResponses>compat.officialEndpoint(on for official OpenAI, off elsewhere). This key does not enableofficialEndpointor official-only fields such astext.verbosity; it does not change Codex or Azure Responses behavior.streamIdleTimeoutMs— stream-watchdog idle-timeout floor in ms for slow reasoning hosts. Default: auto (GLM coding-plan hosts, direct DeepSeek reasoning).streamMarkupHealingPattern— recover leaked stream control markup with thekimi,dsml,qwen, orthinkinggrammar. Default: endpoint/model policy.cacheControlFormat—"anthropic"to include Anthropic-style prompt-cache markers in chat-completions payloads. Default: auto (OpenRouteranthropic/*models).supportsLongPromptCacheRetention— host honorsprompt_cache_retention: "24h"on the Responses API. Default: auto (api.openai.com).supportsImageDetailOriginal— allow the Responses API's nonstandarddetail: "original"image mode where the endpoint supports it. Default:truefor OpenAI, Azure OpenAI, and Codex;falsefor other hosts, including custom/local endpoints, xAI, and Copilot. Custom hosts receiveautofor snapcompact frames and computer screenshots unless they opt in withcompat.supportsImageDetailOriginal: true. An explicitfalsealso overrides the known-host default.supportsConfigurationUpdate— let the Responses API changereasoning.effortmid-session through aconfiguration_updateinput item while the request-level effort stays pinned for prompt caching (GPT-6 Astra). Default: auto (trueforgpt-6-astraon every host,falseotherwise). Setfalsefor customopenai-responses/openai-codex-responsesendpoints that reject the item type with HTTP 400; effort changes are then sent as the top-levelreasoning.effortand no update items are emitted.supportsSteering— let the Codex WebSocket transport sendresponse.steer, so a message typed while the model responds joins that response instead of waiting for the next request. Default: auto (truefor the GPT-6 family). Setfalsefor proxies that reject the event.extraBody— extra top-level fields merged into every request body (gateway hints, controller selectors, etc.).
Image handling:
stripImageInput— drop image parts before anopenai-completionsrequest is encoded (including the OpenRouter chat fallback,PI_OPENROUTER_RESPONSES=0). The catalog's class rules set it for model lines that endpoints commonly serve as text-only (e.g. the DeepSeek class), independently of the provider's owninputdeclaration, so a model can declareinput: [text, image]and still send no image. Per-modelcompatis deep-merged over those rules and wins: setstripImageInput: falsefor an id whose endpoint really acceptsimage_url— a vision-augmenting proxy, for example. Default: auto (catalog class and provider rules). The Responses and Anthropic/Google encoders ship the modalities the model declares, as does thepi-nativetransport (it forwards the original context to the gateway, so the guard never runs client-side and theimagescolumn reports the declaredinput).
Reasoning / thinking:
Custom models and overrides may define thinking with required mode and efforts, plus
defaultLevel, effortMap, supportsDisplay, and requiresEffort. Modes are effort, budget,
google-level, anthropic-adaptive, and anthropic-budget-effort. Efforts are ordered
minimal|low|medium|high|xhigh|max. Legacy levels or minLevel/maxLevel shapes are normalized to
efforts; explicit efforts wins over either.
requiresEffort defaults to auto-detection; set it to false only when the
configured backend has been verified to accept an explicit reasoning-off
request. This keeps the :off selector from being clamped to the lowest effort.
For a custom model with the default thinkingFormat: openai, --thinking off
has no explicit off payload on openai-completions: when reasoning_effort is
sent, it requests the first effort listed in efforts, even with
requiresEffort: false (for example, efforts: [low, medium, high] sends
reasoning_effort: low), so list efforts lowest-first. Turning reasoning off
requires a request shape the server treats as off; for example,
thinkingFormat: qwen-chat-template sends
chat_template_kwargs: { enable_thinking: false }.
supportsReasoningEffort— acceptreasoning_effort. Default: endpoint/model policy; supported dialects can vary within a provider.supportsReasoningParams— whether request shaping may send reasoning params at all. Default: auto (off for GitHub Copilot chat-completions).supportsReasoningSummary— allow Responses reasoning summaries. Default: endpoint/model policy; setfalsefor endpoints that rejectreasoning.summary.reasoningEffortMap— partial map from internal effort levels (minimal|low|medium|high|xhigh|max) to provider-specific strings (e.g. Fireworks GLM mapsminimal -> "none").thinkingFormat— request shape for thinking:"openai"(reasoning_effort),"openrouter"(reasoning: { effort }),"zai"(thinking: { type: "enabled" }),"qwen"(top-levelenable_thinking), or"qwen-chat-template"(chat_template_kwargs.enable_thinking). Default: endpoint/model policy, normally"openai".qwenTemplateReasoningEffort— route the selected effort onto the Qwen 3.8+ chat template'sreasoning_effortkwarg (chat_template_kwargs.reasoning_effort, plus the top-level field on theqwendialect). Default: catalog policy (enabled for Qwen 3.8+ on LM Studio, llama.cpp discovery, and vLLM). Setfalsefor strict servers that reject unknownchat_template_kwargs; effort selections are then not sent for the Qwen dialects and the template runs at its own default.reasoningContentField— assistant field carrying chain-of-thought:"reasoning_content","reasoning", or"reasoning_text". Default: auto.requiresReasoningContentForToolCalls— assistant tool-call turns must round-trip the reasoning field. Default: endpoint/model policy (including DeepSeek, Kimi, and reasoning-enabled OpenRouter).allowsSyntheticReasoningContentForToolCalls— allow a placeholder reasoning field when a prior assistant tool-call turn lacks provider reasoning content. Default: endpoint/model policy; setfalsefor providers that validate the exact reasoning value.requiresAssistantContentForToolCalls— assistant tool-call turns must include non-empty text content. Default: endpoint/model policy (including Kimi and direct DeepSeek reasoning).whenThinking— partial compat overrides applied only when a request actually engages thinking mode (deep-merged over the baseline compat).
Tool / message normalization:
requiresToolResultName— tool-result messages need anamefield (Mistral). Default: auto.requiresAssistantAfterToolResult— a user message after a tool result needs an assistant turn in between. Default: auto.requiresThinkingAsText— convert thinking blocks to text wrapped in<thinking>delimiters (Mistral). Default: auto.requiresMistralToolIds— normalize tool-call ids to exactly 9 alphanumeric chars. Default: auto.supportsStrictMode— accept the per-toolstrictfield on tool schemas. Default: conservative auto-detect per provider/baseUrl.toolStrictMode—"all_strict"forces strict on every tool,"none"forces it off; unset uses endpoint/model policy (normally mixed, all-strict on Cerebras hosts).
Gateway routing (only applied when baseUrl matches the gateway):
openRouterRouting.only/openRouterRouting.order— provider routing onopenrouter.ai(see https://openrouter.ai/docs/provider-routing).vercelGatewayRouting.only/vercelGatewayRouting.order— provider routing onai-gateway.vercel.sh(see https://vercel.com/docs/ai-gateway/models-and-providers/provider-options).
Provider-level compat is the baseline; per-model compat is deep-merged on top, with
openRouterRouting, vercelGatewayRouting, extraBody, and whenThinking merged as nested objects.
Anthropic compatibility (anthropic-messages)
For anthropic-messages models the runtime uses a separate AnthropicCompat shape
(packages/catalog/src/types.ts). The models.yml schema exposes the strict-tools opt-out as a
top-level provider field; inside compat it honors every shared key that also names an
AnthropicCompat field: supportsContextManagement, supportsEagerToolInputStreaming,
supportsForcedToolChoice, allowAnthropicHeaderOverrides, requiresToolResultId,
replayUnsignedThinking, bedrockMessagesApi, stripImageInput, and streamIdleTimeoutMs. Other Anthropic-side knobs
are supplied by built-in catalog metadata and are not configurable here — applyCompatOverrides
drops override keys the resolved shape does not declare.
Bedrock compatibility (bedrock-converse-stream)
The same compat slot accepts promptCacheMode (none, automatic, or explicit),
supportsLongPromptCacheRetention, promptCacheMinimumTokens,
promptCacheMaximumCheckpoints, supportsForcedToolChoice (forced any/tool choices
fall back to auto when false; built in for Claude Opus/Sonnet 5.5), and
supportsThinkingBindingControls for Bedrock models. Prefix-bound Claude models (Fable 5.1+,
Opus/Sonnet/Haiku 5.5) send thinking.block_binding, the thinking-binding-controls-2026-08-01
beta and the /input_transformations response path by default; set
supportsThinkingBindingControls: false for a gateway or region that rejects them. Local
prefix-binding safeguards stay on, and a prefix-mismatch rejection is retried once with
bound thinking stripped.
By default bedrock-converse-stream requests go to bedrock-runtime.{region}.amazonaws.com.
An explicit per-request region or a model ARN's region wins. Otherwise an ambient region from
AWS_REGION/AWS_DEFAULT_REGION/the AWS profile is used when compatible with the inference
profile's geo prefix; a compatible guardrail ARN region or the geo's default region is the
fallback. Models without a recognized geo prefix use the ambient region, then the guardrail ARN
region, then a regional baseUrl region, then us-east-1. Set baseUrl on providers.amazon-bedrock
(or on a custom provider using
api: bedrock-converse-stream) to send requests somewhere else instead — a VPC/PrivateLink
endpoint, a FIPS host, or a gateway. Any path or query string on the baseUrl is kept — the path
as a prefix, the query appended to the final URL (and included in SigV4's canonical request when
signing) — so {baseUrl}/model/{id}/converse-stream[?query] is the final URL. That covers gateways
that authenticate via a query parameter instead of a header:
providers:
amazon-bedrock:
baseUrl: https://vpce-0123456789abcdef0.bedrock-runtime.us-east-1.vpce.amazonaws.com
One host shape is not taken literally: a baseUrl of exactly
bedrock-runtime.{region}.amazonaws.com is AWS's own endpoint, and its region segment is replaced
with the resolved region — signing has to match the region it sends to, and every bundled Bedrock
model already carries such a baseUrl. Use a distinct host (VPC endpoint, -fips, gateway) to
pin an origin exactly.
For models without a recognized geo prefix, a regional baseUrl sets the region when the ambient
and guardrail ARN regions are unset. SigV4 signs with that region instead of the us-east-1 default.
An ambient region or region-scoped model id/ARN overrides it. A gateway that accepts a bearer token
instead of SigV4 needs no AWS signing credentials: set the
provider's apiKey (or AWS_BEARER_TOKEN_BEDROCK) and signing is skipped. Region resolution still
controls AWS's default host.
Claude on Bedrock's Anthropic Messages API (/anthropic)
Amazon Bedrock also serves Claude through the Anthropic Messages API, under /anthropic on both of
its endpoints. AWS recommends bedrock-runtime for new applications
(Inference using Anthropic Messages API).
Claude Opus 4.7 and later are served here; Opus 4.6 and earlier stay on Converse
(Claude in Amazon Bedrock).
| Route | Base URL | Provider | Model id |
|---|---|---|---|
| bedrock-runtime | https://bedrock-runtime.<region>.amazonaws.com/anthropic |
amazon-bedrock |
inference profile, e.g. us.anthropic.claude-opus-5-5 |
| bedrock-mantle | https://bedrock-mantle.<region>.api.aws/anthropic |
bedrock-mantle |
anthropic.claude-opus-5-5 |
The FIPS host (bedrock-runtime-fips.<region>.amazonaws.com) and AWS PrivateLink endpoint-specific
hosts (<vpce-id>[-<az>].bedrock-runtime.<region>.vpce.amazonaws.com, likewise for
bedrock-runtime-fips and bedrock-mantle) are recognized as the same routes. A VPC endpoint with
private DNS enabled needs no change: it answers on the public hostnames
(Bedrock VPC endpoints).
Define the model under the provider shown in the table, with api: anthropic-messages. Those two
provider ids carry the catalog rule that enables Claude's on-demand compaction
(Compaction). Set auth: apiKey so OMP sends plain API-key requests; without
it, custom anthropic-messages models get Claude Code request shaping. The examples authenticate
with an Amazon Bedrock API key;
OMP does not sign runtime-route requests with SigV4. Write the region into the runtime URL. Mantle
URLs may keep {region}, which OMP fills in from your AWS region settings.
providers:
amazon-bedrock:
baseUrl: https://bedrock-runtime.us-east-1.amazonaws.com
apiKey: AWS_BEARER_TOKEN_BEDROCK
auth: apiKey
models:
- id: us.anthropic.claude-opus-5-5
api: anthropic-messages
baseUrl: https://bedrock-runtime.us-east-1.amazonaws.com/anthropic
reasoning: true
input: [text, image]
bedrock-mantle:
baseUrl: https://bedrock-mantle.{region}.api.aws/openai/v1
apiKey: AWS_BEARER_TOKEN_BEDROCK
auth: apiKey
models:
- id: anthropic.claude-opus-5-5
api: anthropic-messages
baseUrl: https://bedrock-mantle.{region}.api.aws/anthropic
reasoning: true
input: [text, image]
Requests on these routes are shaped by compat.bedrockMessagesApi, which OMP detects from a Bedrock
/anthropic baseUrl under any provider id. Both routes reject the tool strict field, so OMP drops
it. OMP also fits metadata.user_id to
Bedrock's request-metadata pattern,
which the runtime route enforces: a value that fits is kept, otherwise its session id is sent,
otherwise it is left out. Both run after any onPayload hook. Both routes verify thinking
signatures, so by default OMP does not replay unsigned thinking to them.
The URL check cannot see a Bedrock route behind a proxy or an ANTHROPIC_BASE_URL reroute of the
first-party anthropic provider; those keep plain Anthropic requests unless you opt in. Set the flag
in compat (provider-wide or under modelOverrides) to opt in, or to false to opt a Bedrock URL
out:
providers:
anthropic:
compat:
bedrockMessagesApi: true # ANTHROPIC_BASE_URL points at bedrock-runtime /anthropic
On-demand compaction still needs a model line the catalog grants it to (amazon-bedrock,
bedrock-mantle, anthropic, or google-vertex provider ids); an arbitrary proxy provider id does
not acquire that capability just from bedrockMessagesApi.
Strict tool schemas (disableStrictTools)
Anthropic's API supports a strict field on tool definitions that forces the model to always follow the provided schema exactly. OMP enables it by default for a small allowlist of high-frequency built-in anthropic-messages tools (python, edit, and find) whose schemas fit Anthropic's strict grammar limits; other tools still send normalized schemas but omit strict. bash is left out: strict decoding fixes property order, so once a call has written async, the timeout declared before it can no longer be emitted.
Third-party providers that front the Anthropic API (AWS Bedrock, Azure, self-hosted proxies) do not always implement this field and will reject requests that include it. Set disableStrictTools: true at the provider level to opt out of strict mode for the allowlisted tools:
providers:
bedrock-anthropic:
baseUrl: https://bedrock-runtime.us-east-1.amazonaws.com/anthropic
apiKey: AWS_BEARER_TOKEN
api: anthropic-messages
disableStrictTools: true
models:
- id: claude-sonnet-4-20250514
name: Claude Sonnet 4 (Bedrock)
input: [text, image]
contextWindow: 200000
maxTokens: 16384
cost:
input: 3.00
output: 15.00
cacheRead: 0.30
cacheWrite: 3.75
disableStrictTools is a provider-level flag that applies to all models in the provider. It disables the Anthropic strict marker only for tools that OMP would otherwise mark strict; it does not change runtime tool argument validation. OMP can automatically retry without strict tools after Anthropic reports a strict-grammar-too-large error before the first streamed token, but proxies that reject the strict field for other reasons should set this flag explicitly. Claude on google-vertex can also reject strict tools when the GCP organization policy vertexai.allowedPartnerModelFeatures disallows structured_outputs; OMP retries once without strict and pins strictToolsDisabled for the session. Set disableStrictTools: true for google-vertex to skip that failed first request.
Tool schemas going on the wire are normalized by the unified flow in
packages/ai/src/utils/schema/normalize.ts (Google/CCA/MCP dispatchers
plus the OpenAI strict-mode sanitize+enforce pipeline). See
ai-schema-normalize.md for the strict-mode
edge cases (local $ref inlining, single-item allOf collapse,
anyOf-wrapper description hoist, enum/const primitive-type inference)
and the per-provider dispatcher mapping.
Practical examples
Local OpenAI-compatible endpoint (no auth)
providers:
local-openai:
baseUrl: http://127.0.0.1:8000/v1
auth: none
api: openai-completions
models:
- id: Qwen/Qwen2.5-Coder-32B-Instruct
name: Qwen 2.5 Coder 32B (local)
For oMLX or another local OpenAI-compatible server with a discoverable /v1/models endpoint, prefer discovery instead of listing models by hand. Set api to the endpoint family your server actually exposes: openai-completions uses /v1/chat/completions; servers that expose /v1/responses need openai-responses instead.
providers:
omlx:
baseUrl: http://127.0.0.1:11434/v1
auth: none
api: openai-completions
discovery:
type: openai-models-list
The built-in vLLM provider can be pointed at a non-default endpoint without declaring a custom discovery type. OMP uses vLLM's /v1/models metadata and preserves vLLM's max_model_len field as the discovered context window.
providers:
vllm:
baseUrl: http://192.168.5.3:8085/v1
auth: none
For multiple vLLM endpoints, use arbitrary provider IDs with the generic OpenAI-compatible discovery path. Set auth: none for local no-auth servers or apiKey for authenticated ones. Generic discovery reads max_model_len first and then context_length as a generic OpenAI-compatible fallback.
providers:
vllm-fast:
baseUrl: http://host-a:8000/v1
auth: none
api: openai-completions
discovery:
type: openai-models-list
vllm-long:
baseUrl: http://host-b:8000/v1
auth: none
api: openai-completions
discovery:
type: openai-models-list
Hosted proxy with env-based key
providers:
anthropic-proxy:
baseUrl: https://proxy.example.com/anthropic
apiKey: ANTHROPIC_PROXY_API_KEY
api: anthropic-messages
auth: apiKey
authHeader: true
disableStrictTools: true # if the proxy doesn't support strict tool schemas
models:
- id: claude-sonnet-4-20250514
name: Claude Sonnet 4 (Proxy)
reasoning: true
input: [text, image]
Override built-in provider route + model metadata
providers:
openrouter:
baseUrl: https://my-proxy.example.com/v1
headers:
X-Team: platform
modelOverrides:
anthropic/claude-sonnet-4:
name: Sonnet 4 (Corp)
compat:
openRouterRouting:
only: [anthropic]
Legacy consumer caveat
Most model configuration now flows through models.yml / models.yaml via ModelRegistry.
Explicit .json / .jsonc paths remain supported when passed programmatically; the active agent
directory's models.yml takes precedence over models.yaml.
Failure mode
If models.yml / models.yaml fails schema or validation checks:
- registry keeps operating with built-in models
- error is exposed via
ModelRegistry.getError()and surfaced in UI/notifications