# models-config.json

Source: https://nodedocs.mor.org/reference/models-config

## Agent Instructions

- Non-browser fetches of page URLs on this site return clean Markdown (not the JS UI). Prefer `https://nodedocs.mor.org/llms-full.txt` for the full corpus, or `https://nodedocs.mor.org/llms.txt` for the index.
- Per-page Markdown is also at `<page-url>.md` (homepage: `https://nodedocs.mor.org/index.md`).
- Docs search MCP: `https://nodedocs.mor.org/mcp` (discovery: `https://nodedocs.mor.org/.well-known/mcp`).
- Never invent contract addresses, chain IDs, token addresses, or live bid/model counts. Cite Networks and tokens; link active.mor.org for live data.
- Never claim Morpheus runs inference — independent providers do. Opening a session escrows MOR; it does not spend it.

`models-config.json` tells the proxy-router how to translate on-chain `modelId` values into actual backend HTTP calls. The schema is enforced by [`proxy-router/internal/config/models-config-schema.json`](https://github.com/MorpheusAIs/Morpheus-Lumerin-Node/blob/main/proxy-router/internal/config/models-config-schema.json).

## Per-model fields

| Field | Required | Notes |
|-------|----------|-------|
| `modelId` | yes | The on-chain model id (32-byte hex) |
| `modelName` | yes | Human-readable name. For `byteplus-video` and `renderful`, the vendor's model id, which also sets the job limits (see [Video models](#video-models)) |
| `apiType` | yes | Transport adapter the proxy-router speaks to the backend: `openai` (any OpenAI-compatible chat/completions endpoint), `claudeai` (Anthropic Messages), `prodia-sd`, `prodia-sdxl`, `prodia-v2`, `hyperbolic-sd` (image generation), `decisions` (TypeSafe Decisions / System One, see the note under the example below), `byteplus-video` and `renderful` (hosted video jobs, see [Video models](#video-models)) |
| `apiStack` | optional | Backend API preset advertised to consumers: `openai`, `vllm`, `sglang`, `llamacpp`, `ollama`, `venice`, `openrouter`, `litellm`, `anthropic`, `gemini`. Never selects the adapter; its required `apiType` is listed under [API presets](#api-presets). On a mismatch or an unknown preset the proxy-router logs an error and ignores `apiStack` for that model (the model is still served and its backend API is detected at runtime, as if `apiStack` were omitted). When omitted, the backend API is detected at runtime — see [Detection](#detection) |
| `modelFamily` | optional | Canonical model family used to pick reasoning-control bindings. Families with bindings: `qwen3`, `qwen3.5`, `qwq`, `deepseek-v3.1`, `deepseek-r1`, `phi-4-reasoning`, `gpt-oss`, `glm`, `granite`, `hunyuan`, `seed-oss`, `nemotron`, `cogito`, `hermes` (Hermes 4 only), `mimo` (MiMo-V2 only), `olmo` (Olmo 3 Think always-on), `claude`, `o-series`, `gemini`, `gemma` (Gemma 4 members only), `kimi` (Kimi K2.5 / K2.6 hybrid; K2.7-Code and K3 always-on), `minimax` (MiniMax-M2 and M2.x always-on; MiniMax-M3 hybrid via `thinking_mode`; Text-01 and M1 none), `exaone` (EXAONE 4.x hybrid; EXAONE Deep always-on). For `gemma`, `kimi`, `minimax`, `exaone`, `hermes`, `mimo`, `olmo` and `nemotron` the member is detected from the model id the backend reports, or from `modelName` when it reports none, so `modelFamily` alone does not select those bindings. Any other value (or an inferred label such as `llama`, `mistral`, `phi`, `magistral`, `arcee`) is accepted and reported as the `api` block's `modelFamily` without reasoning bindings. Inferred from `modelName` when omitted. Detection never overrides an explicit value; it only fills an empty one |
| `apiUrl` | yes | Full backend URL including the endpoint path. For `byteplus-video` and `renderful`, the vendor's API base instead (see [Video models](#video-models)) |
| `apiKey` | optional | Backend API key (resale providers usually need this) |
| `capabilities` | optional | Facts about the model as served that you state instead of letting detection find them: `context`, `maxOutput`, `modalities`, `tools`, `structured`, `webSearch`, `embeddings`. Each declared field wins over every other source and is published with evidence `declared`; see [Declared capabilities](#declared-capabilities) |
| `concurrentSlots` | optional | Distinct concurrent chats your backend can handle for **this** model |
| `capacityPolicy` | optional | `idle_timeout` or `simple` |
| `parameters` | optional | Per-`apiType` extra parameters (e.g. SD `cfg_scale`, `steps`) |

> **`concurrentSlots` is per-model, not global.** The proxy-router will accept up to `sum(concurrentSlots)` across all configured models concurrently. There is no built-in global cap. If your hardware can serve only one of N models at a time, configure all N in `models-config.json` but **only post a bid for the one currently active**, and rotate the bid when you want to switch. Prefer bidding on existing marketplace `modelId`s rather than minting duplicates — see [Register on chain](/providers/full/register-onchain). See also [Pausing or temporarily disabling a model offering](/providers/full/register-onchain#pausing-or-temporarily-disabling-a-model-offering).

For the canonical per-`apiType` schema, see the JSON schema file linked above.

## API presets

`apiStack` declares which backend API serves the model. It only feeds the self-reported `api` block in `/healthcheck` and in the pong `models` list: with `apiStack` set the block is composed from the preset and reports `"source": "declared"`; without it the block comes from runtime [detection](#detection) and reports `"source": "detected"` (unless `MODEL_API_DETECT_ENABLED=false`). `apiType` stays the transport adapter and is not derived from `apiStack`; each preset is valid with exactly one `apiType`. The value is trimmed and lowercased on load (`" vLLM "` reads as `vllm`; a whitespace-only value means unset). A mismatch (for example `apiStack: anthropic` with `apiType: openai`) or an unknown preset does **not** reject `models-config.json`: the proxy-router logs `model <id>: apiStack "anthropic" requires apiType "claudeai", got "openai" — apiStack ignored for this model; its backend API will be detected at runtime` and keeps serving that model exactly as if `apiStack` were unset (its backend API is [detected](#detection)), so check the startup log after adding the field.

| `apiStack` | Backend | Required `apiType` |
|------------|---------|--------------------|
| `openai` | api.openai.com or any generic OpenAI-compatible endpoint | `openai` |
| `vllm` | vLLM OpenAI-compatible server | `openai` |
| `sglang` | SGLang OpenAI-compatible server | `openai` |
| `llamacpp` | llama.cpp `llama-server` | `openai` |
| `ollama` | Ollama `/v1` OpenAI-compatible surface | `openai` |
| `venice` | Venice | `openai` |
| `openrouter` | OpenRouter | `openai` |
| `litellm` | LiteLLM proxy | `openai` |
| `anthropic` | Anthropic Messages API | `claudeai` |
| `gemini` | Gemini OpenAI-compatible endpoint (`https://generativelanguage.googleapis.com/v1beta/openai/`) | `openai` |

**`modelFamily` (optional):** families with reasoning bindings are `qwen3` and `qwen3.5` (`enable_thinking` chat-template kwarg), `qwq`, `deepseek-r1` and `phi-4-reasoning` (always-on), `deepseek-v3.1` and `granite` (`thinking` kwarg), `gpt-oss` (`reasoning_effort` kwarg), `glm` and `hunyuan` (`enable_thinking`), `seed-oss` (`thinking_budget` kwarg; `0` disables), `nemotron` (Nemotron 3: `enable_thinking` kwarg; Nemotron Nano v2 and Llama-3.3-Nemotron v1.5: `/no_think` in the system prompt; other Llama-Nemotron: `detailed thinking on|off` in the system prompt), `cogito` (Cogito v2: `enable_thinking` kwarg, or the documented system prompt), `hermes` (Hermes 4 only: `thinking` kwarg; Hermes 2/3 none), `mimo` (MiMo-V2 only: `enable_thinking`; MiMo-VL and MiMo-7B none), `olmo` (Olmo 3 Think always-on; Olmo 3 Instruct none), `claude`, `o-series`, `gemini`, `gemma` (Gemma 4 members only; Gemma 3 and older, including MedGemma 4B, get none), `kimi` (Kimi K2.5 / K2.6 hybrid via the `thinking` chat-template kwarg; K2.7-Code and K3 always-on; K2 Instruct none), `minimax` (MiniMax-M2 and every M2.x always-on; MiniMax-M3 hybrid via the `thinking_mode` chat-template kwarg — `enabled` / `disabled` / `adaptive`, adaptive when unset; MiniMax-Text-01 and MiniMax-M1 none — M1's thinking toggle is undocumented), `exaone` (EXAONE 4.x hybrid via `enable_thinking`; EXAONE Deep always-on; EXAONE 3.5 and older none). Where a family has members with different behaviour the member is detected from the model id the backend reports — the weights vLLM loaded (its `root`: a hub id such as `Qwen/Qwen3-32B`, or a local directory that names a known family and says more than the served name), SGLang's model path, TGI's model id, the LiteLLM upstream id — or from `modelName` when it reports none (Gemma 4, K2.5 / K2.6 / K2.7-Code / K3, M2.x / M3, EXAONE 4.x / Deep, Hermes 4, MiMo-V2, Olmo 3 Think, Nemotron 3 / Nano v2 / v1.5 tokens), so `modelFamily` alone does not select those bindings: a renamed endpoint needs the member token in one of those names. Names match regardless of separators: `.`, `_`, `@` and spaces count as `-`, so `Kimi-K2.7-Code`, `kimi-k2-7-code` and `Kimi K2.7 Code` are the same member, and Vertex AI's `claude-sonnet-4-5@20250929` reads as Claude 4.5; Venice's inline `:key=value` request parameters (`…:strip_thinking_response=true`) are ignored. Version tokens (K2.5, K2.6, EXAONE 4, Qwen3.5 as `qwen3.5` or `qwen35`, Nemotron 3, Hermes 4, MiMo-V2) must not run on into another digit: `k2-50b` is not K2.5, `exaone-40b` not EXAONE 4, `qwen3-56b` is Qwen3. A `thinking` token in the name (but not `non-thinking` or `no-thinking`) marks a reasoning model, not an always-on one: a detected gateway counts it as reasoning evidence. When the model id the backend serves (or, if it reports none, `modelName`) is such a checkpoint, the family's on/off toggle from the chat template or the system prompt is not assumed, because a `…-Thinking` release may force its reasoning and ignore the switch silently; API params, effort levels and budgets still apply, and on Ollama the effort enum omits `none` (its off switch). Whether such a model can stop is left to the backend's own knobs. A `…-thinking` label on an endpoint serving a hybrid keeps the hybrid's toggle. `magistral` and `arcee` are recognised but unbound (Magistral reasons through a recommended system prompt the card does not bake into the template; Trinity-Large-Preview has no reasoning mode). Any other value (or an inferred label such as `llama`, `mistral`, `phi`) is accepted and reported as the `api` block's `modelFamily` without reasoning bindings. When omitted, the family is inferred from `modelName`. Every rule cites its model card or vendor doc in [`family.go`](https://github.com/MorpheusAIs/Morpheus-Lumerin-Node/blob/main/proxy-router/internal/apispec/family.go).

**`parameters` vocabulary:** the `api.parameters` list in a preset's declared spec uses the stack's own request vocabulary — OpenAI chat-completions names for every stack except `anthropic`, which uses Anthropic Messages names (an upper bound: server-side flags are invisible). A detected block reached through LiteLLM narrows it to what LiteLLM forwards for the model (see [Detection](#detection)). Capability facts never go into `parameters`; they have their own [`capabilities` block](#the-capabilities-block).

**`anthropic` preset transport:** `apiStack: anthropic` requires `apiType: claudeai` (Anthropic Messages transport); the request's `max_tokens` is forwarded (default 1024 when omitted) and `thinking.budget_tokens` must stay below it.

**`gemini` preset.** `apiStack: gemini` describes Gemini's OpenAI-compatible endpoint (`https://generativelanguage.googleapis.com/v1beta/openai/`, `apiType: openai`), not the native `generateContent` API. Its bindings, all from [ai.google.dev/gemini-api/docs/openai](https://ai.google.dev/gemini-api/docs/openai): `reasoning.effort` → `reasoning_effort` (`none` | `minimal` | `low` | `medium` | `high`; `none` only on Gemini 2.5 Flash / Flash-Lite, rejected on 2.5 Pro and Gemini 3; not combinable with `extra_body.google.thinking_config`), `reasoning.budget` → `extra_body.google.thinking_config.thinking_budget` (Gemini 2.5; Gemini 3 takes `thinking_level` in the same object), `reasoning.format` → `extra_body.google.thinking_config.include_thoughts`, `response_format.schema` → `response_format` (`json_schema`, the shape the SDK parse helpers send), `stream.include_usage` → `stream_options.include_usage`. Gemini-only fields travel in a top-level `extra_body.google` object with snake_case keys — the Python SDK's `extra_body={'extra_body': {...}}` serialises to that shape. The preset deliberately binds nothing for `reasoning.disable` (no stack-wide off switch on current models — `none` is an enum value of `reasoning.effort` with the caveat in its hint), `response_format.json` (undocumented on the compatible endpoint; only the schema helpers are), `web_search.enable` (the Google Search tool is documented for the Images endpoint only) and `cache.prompt` (`extra_body.google.cached_content` names a pre-created cache resource, not a per-request switch). The `gemini` family's native `generationConfig.thinkingConfig.*` bindings describe the native API and are never advertised on this stack. Detection already reports `stack: gemini` for `generativelanguage.googleapis.com` by hostname (and reads the model's token limits, see [below](#where-each-backends-facts-come-from)); the preset lets a model declare it and skip probing.

### Declared capabilities

`capabilities` states facts about the model as served that no probe needs to find. It is published for every model that declares it, whatever its `apiType` and whether `apiStack` is set, detected, or detection is off: an image (`prodia-*`, `hyperbolic-sd`) or `decisions` model then reports an `api` block holding only `modelFamily`, the declared block and `"source": "declared"` (plus `thinking.mode: always_on` for an always-on family, as with the kill switch below), while detection, the health-probe harvest, the verifier and the offline registry fill the remaining fields on chat transports (`apiType: openai` or `claudeai`) only. It is the highest-precedence source: a declared field is never overwritten by detection, the health probe, the verifier or the offline registry, and its evidence entry is `declared`. Fields you leave out are still filled from the other sources.

```json
"capabilities": {
  "context": 32768,
  "maxOutput": 4096,
  "modalities": { "input": ["text", "image"] },
  "tools": true,
  "structured": ["json_schema"],
  "webSearch": false,
  "embeddings": false
}
```

| Field | Type | Meaning |
|-------|------|---------|
| `context` | integer in `(0, 2^31)` | Served window in tokens (prompt + completion): the vLLM `--max-model-len` or llama.cpp `-c` value, the number consumers plan requests against |
| `maxOutput` | integer in `(0, 2^31)` | Largest completion the backend allows |
| `modalities.input` | array from `text`, `image`, `audio`, `video`, `pdf` | What the model accepts; `text` is implied and prepended when you list only the extras |
| `modalities.output` | array from `text`, `image`, `audio`, `embeddings` | What the model produces |
| `tools` | boolean | Function / tool calling accepted by the backend for this model |
| `structured` | array from `json_object`, `json_schema`, `grammar`, `regex`, `choice` | Constrained-output kinds the backend honours |
| `webSearch` | boolean | The backend can search the web for this model on request (the request knob is a `web_search.*` binding) |
| `embeddings` | boolean | The model serves `/v1/embeddings` |

The declared subset is deliberately smaller than the wire block: `contextTrained`, `reasoning`, `toolsParallel`, `promptCache` and `quantization` come only from the backend, a probe or the registry. Validation at load: integers must be in `(0, 2^31)`, list values must come from the vocabularies above with no duplicates, and the JSON schema rejects unknown keys (`additionalProperties: false`). An invalid block — unknown key, wrong type, non-positive integer, unknown modality or structured kind — is logged as `model <id>: invalid capabilities: …` and ignored **for that model only**; the model itself is kept and served, the same policy as an invalid `apiStack`. An empty block (`{}`) declares nothing. The declared block is part of the detection cache key, so editing it and [reloading](#reload-without-a-restart) republishes the model on the next sweep.

### Detection

When a model has no `apiStack`, the proxy-router identifies its backend API at runtime during every model-health sweep — every configured model on a chat transport (`apiType: openai` or `claudeai`), whether or not it has an active bid — and reports the result in the same `api` block with `"source": "detected"`. Models on the image-only adapters (`prodia-*`, `hyperbolic-sd`) and the `decisions` adapter have no chat API to probe and are never detected; one that declares `capabilities` still publishes that block with `"source": "declared"` (see [Declared capabilities](#declared-capabilities)). An explicit `apiStack` always wins: declared models are never probed. Detection never overrides an explicit `modelFamily`; it only fills an empty one.

Detection **never sends an inference request**. It recognises hosted vendors by hostname (api.openai.com, api.anthropic.com, openrouter.ai, venice.ai, api.groq.com, api.together.xyz, router.huggingface.co, …), fingerprints self-hosted engines by their service endpoints — Ollama `/api/tags` + `/api/show`, llama.cpp `/props` (chat template), SGLang `/model_info` (fallback `/get_model_info`), LM Studio `/api/v1/models` (fallback `/api/v0/models`), KoboldCpp `/api/extra/version`, TGI `/info`, LiteLLM `/health/liveliness` + `/model_group/info`, vLLM `/version` + `/v1/models` — and reads registry-style model listings (OpenRouter `supported_parameters`, Venice `model_spec`). A listing entry (in these and in the vLLM, SGLang, llama.cpp and LM Studio model lists) is found by its id (any case, inline `:key=value` parameters dropped), as the only entry of a one-entry listing, under an `org/` prefix, or else by the separator-agnostic spelling the name rules use when exactly one entry matches it: `google.gemma-4-31b-it` finds Venice's `google-gemma-4-31b-it`. The same endpoints supply the [capability facts](#where-each-backends-facts-come-from). Each probe goes to the model's own host only (a redirect to another host, or from https to http, is not followed), times out after 2 s and reads at most 2 MiB (16 MiB for a registry listing); one detection is capped at 10 s (or `MODEL_HEALTH_CHECK_TIMEOUT` when that is lower — keep it above 2 s). Fingerprinting a self-hosted engine tries each engine's signature endpoints in turn under both base URL candidates, each with the model's key, so one detection costs up to about twenty service-endpoint requests on the model's host, once per TTL; a hostname-recognised vendor costs one listing or one model lookup. Results are cached for `MODEL_API_DETECT_TTL` (default `MODEL_HEALTH_CHECK_INTERVAL`, so one detection per sweep; minimum `1m`) per `apiUrl` + `modelName` + `apiKey` + `apiStack` + `modelFamily` + declared `capabilities`, so a rotated key, an edited family or an edited capabilities block re-detects. A pass that finds nothing (no `api` block) is cached for the same TTL — an unreachable backend is not re-probed on every health check — while a pass cut short by the detection deadline is not cached and is retried at the next sweep. A registry host's `GET /models` listing is read once per host + key per TTL and shared by every model configured against it. Parameter and reasoning-effort names read from a backend listing are advertised only when they look like a plain request-parameter name (`^[A-Za-z0-9_.-]{1,64}$`) and are capped at 64 parameters and 16 efforts; anything else, and anything past the cap, is dropped from the list. Integers a backend reports are accepted only in `(0, 2^31)`. `declaredAt` moves only when the published block changes.

The block is composed with the same rules as a declared preset (family from the backend's own architecture / served model id / `modelName`, reasoning bindings from a chat template, Ollama's `thinking` capability or the family defaults, then the stack's documented request params), with one difference: a detected gateway (LiteLLM, OpenRouter, Venice) gets reasoning knobs only when the gateway itself says the model reasons. When the stack cannot be identified the block carries at most `modelFamily` (from the name), `thinking.mode: always_on` for families that always reason, and declared or registry capabilities — never bindings, because the wire vocabulary is unknown (the endpoint could be a gateway). When nothing is known there is no `api` block. The same reduction applies when a detected stack's required transport (the `openai` / `claudeai` split in the preset table above) does not match the model's own `apiType`, for example a backend fingerprinted as vLLM on a model configured with `apiType: claudeai`: `stack` (and `via`), bindings, parameters, `thinking.default` and every capability read from that stack's endpoints are dropped, leaving only `modelFamily`, an `always_on` thinking mode (with the `capabilities.reasoning: true` derived from it) and the declared / registry capabilities when any is still known.

**Detected-only stacks.** `stack` may report engines that are not presets — `tgi`, `lmstudio`, `koboldcpp` — and hosted vendors recognised by hostname (`together`, `fireworks`, `groq`, `deepinfra`, `hyperbolic`, `mistral`, `xai`, `deepseek`, `moonshot`, `nvidia-nim`, `cerebras`, `sambanova`, `hf-router`). They carry no bindings table; only the family, thinking facts and capabilities are reported.

**Two hops through LiteLLM.** When the backend is a LiteLLM proxy, detection also reads `GET /model/info` (same host, same key) to find the deployment behind the configured `modelName` and looks at its `litellm_params`: the provider prefix of `model` (or `custom_llm_provider`) and `api_base`. The upstream model id is evidence for the model family and for reasoning (a `…-thinking` model). When the upstream is a registry vendor — Venice (reached through LiteLLM as `openai/<model>` with an `api_base`) or OpenRouter — or an engine — vLLM, Ollama, or an OpenAI-compatible endpoint at a host detection does not otherwise recognise (fingerprinted the same way a self-hosted backend would be) — it is read once more, **without any credential** (the LiteLLM key is never forwarded, no key ever goes to another host), at most one hop (an upstream that is itself LiteLLM is recognised by its liveliness check and not followed any further), and under its own budget of up to 4 s — or whatever remains of the model's overall detection budget, if that is less — so a slow upstream can cost the hop its own evidence but never the first hop's. The hop learns what the upstream is, whether the model reasons (Venice `supportsReasoning`, OpenRouter `supported_parameters` containing `reasoning`, Ollama's `thinking` capability), the served model id or architecture the upstream reports, and the per-model effort levels its listing names, plus the upstream's capability facts, thinking default and mandatory reasoning ([which of them cross](#where-each-backends-facts-come-from)) — never a chat template or a registry's own bindings or parameter list. An upstream that rejects the anonymous request (401/403) or times out is skipped silently and the bare upstream id from the first hop still stands as family evidence.

**The identified upstream is the stack.** When the hop identifies the upstream — Venice or OpenRouter by hostname or by the shape of their model listing, OpenAI or Anthropic by hostname (Anthropic also by its documented `anthropic/` prefix alone — no `api_base` needed there), or an engine confirmed at the `api_base` (vLLM by `/version`, or a fingerprinted llama.cpp, SGLang, TGI, LM Studio or KoboldCpp) — the block reports that upstream as `stack`, composed with the upstream's own table and family rules exactly as if the proxy-router talked to it directly, plus a new field `"via": "litellm"` naming the gateway in front of it. The reason is how LiteLLM handles request params: any param it does not recognise is treated as provider-specific and forwarded verbatim in the request body (`venice_parameters.*`, `chat_template_kwargs.*`, `top_k`, `min_p`, OpenRouter's `reasoning` object, `thinking`, …), while the standard OpenAI chat-completions params are validated against LiteLLM's per-provider map and rejected when the model's provider does not list them (`litellm.UnsupportedParamsError: openai does not support parameters: ['reasoning_effort']` was observed live on an `openai/`-prefixed Venice deployment). So the upstream's own vocabulary is what actually works through LiteLLM, and a standard param works only when LiteLLM lists it in the model group's `supported_openai_params`. Only the gateway's name is reported: `api_base`, the upstream model id and hostnames still never appear in the block. An identified Anthropic upstream is reported as `stack: anthropic` even though the proxy-router still only ever speaks OpenAI chat-completions to LiteLLM (LiteLLM is what translates the request into an Anthropic Messages call upstream), but its `parameters` is LiteLLM's `supported_openai_params` reported as-is rather than intersected with the anthropic preset's own documented list, since the two are different vocabularies (Anthropic Messages vs. OpenAI). One upstream stays evidence-only, with `stack: litellm` and no `via`: **Ollama**, because LiteLLM's `ollama/` and `ollama_chat/` providers speak Ollama's native `/api` rather than the `/v1` surface the `ollama` preset describes. An upstream that cannot be identified — an undocumented provider prefix, a hosted vendor or cloud prefix (`bedrock/`, `azure/`, `groq/`, …), no `api_base`, a refused address, a listing that could not be read, a failed fingerprint or a timed-out hop — leaves `stack: litellm` with LiteLLM's own knobs, as before.

**What LiteLLM forwards.** Whenever the request path goes through LiteLLM — an identified upstream as well as a plain `stack: litellm` — the block is narrowed to what LiteLLM forwards for the model group. A binding whose root param (the text before the first `.`) is a standard OpenAI chat-completions name is dropped unless `/model_group/info` lists that name in `supported_openai_params` (the diagnostics trace notes each drop: `litellm does not forward <param> for this model`); bindings rooted at a non-standard name are kept, since LiteLLM passes them through. `parameters` is the stack's documented list intersected with `supported_openai_params` (which is why `model` and `messages`, never listed by LiteLLM, are absent there). When `/model_group/info` cannot be read, only bindings rooted at `reasoning_effort` are dropped — the demonstrated rejection — and `parameters` is the stack's list minus `reasoning_effort`. The thinking mode is derived after this narrowing: dropping a `reasoning_effort` toggle can turn `controllable` into `tunable` (a budget knob remains) or remove the mode. For a plain `stack: litellm` block, LiteLLM's `supported_reasoning_efforts` still become the `reasoning.effort` enum for that model, and without `none` among them no `reasoning.disable` binding is advertised; the `reasoning.enable` binding takes the first listed effort other than `none` as its value (LiteLLM's order), and when the list has no such effort no `reasoning.enable` binding is advertised either. An identified upstream keeps its own documented effort enum; for Venice that enum comes from its listing (below). `drop_params` / `additional_drop_params` configured per deployment remain invisible from outside; the block is still an upper bound.

**Listed reasoning levels.** When the serving backend's own listing names effort levels for the model — Venice `reasoningEffortOptions` (read only when the same entry sets `supportsReasoningEffort`), OpenRouter `reasoning.supported_efforts`, LM Studio's allowed options, xAI's reasoning efforts, Ollama's think values — they become the `reasoning.effort` enum and count as evidence that the model reasons; LiteLLM's `supported_reasoning_efforts` describe what the provider accepts and only set the enum. When the listed levels include `none`, the family's always-on rule does not apply, because the backend turns reasoning off itself (Venice and MiniMax-M2.7), so its off switch is advertised. An always-on model whose listing names effort levels keeps its `reasoning.effort` binding without `none`: it cannot stop, but it can think less. For `stack: venice`, reached directly or through LiteLLM, the `reasoning.effort` binding writes the object form `reasoning.effort`: LiteLLM forwards the `reasoning` object as-is, while it rejects a top-level `reasoning_effort` for `openai/` deployments. A Venice entry that sets `supportsReasoningEffort: false` gets no `reasoning.effort` binding at all.

**Kill switch.** `MODEL_API_DETECT_ENABLED=false` disables all probing (including the offline registry lookup); a model without `apiStack` then reports no `api` block, unless it declares `capabilities` — that model still publishes `modelFamily` (from its name) and the declared block with `"source": "declared"`, no `stack` and no bindings (an always-on family still reports `thinking.mode: always_on`). Declared presets are unaffected, and so is the [health-probe harvest](#runtime-evidence).

### The `capabilities` block

`api.capabilities` carries facts about the model as served. Every field is optional and **an absent field means unknown, never false**. A field is set only from explicit evidence — a backend or vendor endpoint, a declared override, the offline registry, the health probe's own response or an opt-in verifier probe — and every set field has an entry in `api.evidence` naming where it came from. Nothing in the block is inferred from the stack preset tables or from the family name: a wrong capability is worse than a missing one.

| Field | Type | Meaning |
|-------|------|---------|
| `context` | integer | Served window (prompt + completion tokens): the number to plan requests against |
| `contextTrained` | integer | The model's trained window, only when the backend reports both a served and a trained one |
| `maxOutput` | integer | Largest completion the backend allows |
| `modalities.input` | array | `text`, `image`, `audio`, `video`, `pdf` |
| `modalities.output` | array | `text`, `image`, `audio`, `embeddings` |
| `tools` | boolean | Function / tool calling accepted |
| `toolsParallel` | boolean | Parallel tool calls accepted |
| `structured` | array | Subset of `json_object`, `json_schema`, `grammar`, `regex`, `choice` |
| `reasoning` | boolean | The model can reason; how to control it is in `thinking` and the `reasoning.*` bindings |
| `webSearch` | boolean | The backend can search the web for this model on request; the knob is a `web_search.*` binding |
| `embeddings` | boolean | The model serves embeddings |
| `promptCache` | boolean | Prompt caching available |
| `quantization` | string | The backend's own label (`fp8`, `Q4_K_M`, `bf16`, `MXFP4`, …) |

**Served beats trained.** `context` is the window the running server enforces (vLLM `max_model_len`, llama.cpp `n_ctx`, Ollama's loaded `num_ctx`, LM Studio's smallest loaded instance). When the backend also reports the model's trained window it goes to `contextTrained`; when only the trained window is known it stands in as `context` and the evidence entry names the trained source (`llamacpp:/v1/models.meta.n_ctx_train`, `ollama:/api/show.model_info.<arch>.context_length`, `lmstudio:/api/v1/models.max_context_length`) so a consumer can tell. When the offline registry knows the model and the served window is below a quarter of the registry's, the diagnostics trace notes `context: served window N is far below the registry's M`; the block is unchanged.

**Text is implied.** A backend's vision / audio / pdf flag names the extra modality, not the whole set, and every model here speaks a chat transport, so a non-empty `modalities.input` without `text` gets `text` prepended (the evidence stays the producer's; the trace says `text prepended — a chat model accepts text`). `modalities.output` is left exactly as reported.

**`reasoning`** is `true` when the thinking mode is `always_on` or a `reasoning.*` binding survived every filter (evidence `derived:thinking.mode` / `derived:bindings.reasoning`), or when a backend reported it. It is `false` only when a backend reported false — Ollama `thinking.values == [false]`, Venice `supportsReasoning: false`, LiteLLM `supports_reasoning: false`, Mistral / Cerebras `capabilities.reasoning: false`; a registry `false` is ignored because the snapshot cannot distinguish "no" from "unknown". A backend `false` that lands beside a surviving `reasoning.*` binding or an `always_on` mode (LiteLLM's `supports_reasoning` defaults to `false` for a model its cost map does not know, while the toggle comes from the upstream model's family or template) is published as neither: the field is left out, with the trace `capabilities.reasoning: backend false (<source>) contradicts the surviving reasoning.* bindings; left unknown`, so a block never denies a knob it also advertises. Behind LiteLLM, its `supports_reasoning: false` yields to an upstream the second hop read: the upstream's own `reasoning` value (Venice `supportsReasoning: false`, Ollama `thinking.values`) replaces it, and an upstream report that the model reasons (Venice `supportsReasoning: true`, OpenRouter `supported_parameters` containing `reasoning`, Ollama's `thinking` capability, a listing's effort levels, mandatory reasoning) drops it, so `true` is then derived from the surviving knobs whenever the block carries any capability, as for that upstream reached directly; an upstream that says nothing about reasoning leaves LiteLLM's `false` in place.

**`thinking.default`** (beside `thinking.mode`) is `on`, `off` or an effort level name: what the model does when the request says nothing. It comes only from evidence — Ollama `thinking.default`, LM Studio `capabilities.reasoning.default`, OpenRouter `reasoning.default_enabled` / `default_effort` (a `default_effort` counts only when reasoning is on by default or mandatory), Venice `defaultReasoningEffort`, xAI `default_reasoning_effort`, or a chat template that assigns its own switch (`{%- set enable_thinking = false %}`, `set thinking = …`, evidence `template:chat_template.enable_thinking` / `.thinking`) — and is published only alongside a thinking mode.

**Precedence.** When sources disagree, `declared` > runtime-verified (`verify:*`) > backend-served > backend-trained / listing > `template:*` > `registry:*`. Lower-precedence sources fill only fields that are still unset, field by field; a runtime verdict replaces backend, template and registry facts but never a declared one, and the health probe's error-derived `context` fills only an unset field. List fields (`structured`, `modalities.*`) are **extended** by a runtime fact, never narrowed: a probe proves the entries it saw, not the absence of the rest.

**The `evidence` map.** Keys are wire field paths — `capabilities.context`, `capabilities.modalities.input`, `thinking.default`, `bindings.reasoning.disable`, `stack` — and values are the source, one of these classes:

| Source | Meaning |
|--------|---------|
| `<stack>:<endpoint>.<field>` | Read from that backend endpoint, e.g. `vllm:/v1/models.max_model_len`, `ollama:/api/show.capabilities`, `openrouter:/models.supported_parameters`, `anthropic:/v1/models/{id}.capabilities.image_input` (the endpoint is spelled with a literal `{id}`; the configured id never enters a source). The [table below](#where-each-backends-facts-come-from) lists every endpoint |
| `declared` | The `capabilities` override in `models-config.json` |
| `registry:<name>@` | The offline registry snapshot; `<name>` is `models.dev`, `litellm` or `models.dev+litellm` (which sources carried the entry), the date is the snapshot's generation date |
| `derived:thinking.mode`, `derived:bindings.reasoning` | The composer derived `capabilities.reasoning` from an `always_on` mode or a surviving `reasoning.*` binding; cleared together with detected facts |
| `template:chat_template.<var>` | Read from the chat template llama.cpp `/props` or Ollama `/api/show` returned: `tools` (a `tools` variable or `<tool_call>` marker; a template whose `raise_exception` names tools as unsupported yields no `tools` fact — it is not published as `false`), `image_token` (`<\|vision_start\|>`, `<\|image_pad\|>`, `<image>`, `<\|image\|>`, `<start_of_image>`), `enable_thinking` / `thinking` (the reasoning default). Applied only when the stack is known and no engine fact already set the field |
| `health-probe:<what>` | Harvested from the ordinary health probe's response, free: `reasoning_seen`, `headers` (key `stack`, LiteLLM named by its `x-litellm-*` response headers), `context_length_exceeded` (OpenAI / vLLM sentence), `vllm.context_length_exceeded`, `llamacpp.exceed_context_size_error`, `tgi.validation_error`, `tgi.max_input_tokens` (a lower bound of the window), `anthropic.prompt_too_long` |
| `verify:<what>@<unix>` | An opt-in verifier probe at that unix time: `reasoning.disable` / `reasoning.enable` (binding verified true), `reasoning_content_still_present` / `rendered_prompt_unchanged` (verified false — the reason slug), `tools` (accepted), `tool_choice_auto` (vLLM's documented refusal, `tools: false`), `json_schema`, `image`, `reasoning_seen_with_disable` (reasoning content survived the disable binding: `capabilities.reasoning = true` and `thinking.mode` becomes `always_on`), `rejected:<param>` (a binding the backend refused; the binding is gone and only its evidence entry remains) |

Binding evidence keys (`bindings.<intent>`) are written for the entries whose origin is not the stack table: `bindings.web_search.enable` / `.citations` carry the `capabilities.webSearch` source they were gated on, `bindings.reasoning.effort` the listing that supplied the effort levels (`litellm:/model_group/info.supported_reasoning_efforts`, `openrouter:/models.reasoning.supported_efforts`, `venice:/models.model_spec.capabilities.reasoningEffortOptions`, `ollama:/api/show.thinking.values`, `lmstudio:/api/v1/models.capabilities.reasoning.allowed_options`, `xai:/v1/language-models/{id}.capabilities.reasoning_effort`), the Anthropic `reasoning.*` and `response_format.schema` bindings the `anthropic:/v1/models/{id}.capabilities` facts that replaced the name-based guess, and every verified or rejected binding its `verify:*` entry.

**`verified` on a binding.** A `ParamBinding` may carry `verified: true|false` and `verifiedAt` (unix): the runtime verifier sent the binding to the backend and saw it honoured or not. Absent means never checked; bindings stay documented knobs — an upper bound — until then.

**`web_search.*` intents and the `tool_entry` kind.** Two intents describe web search: `web_search.enable` (turn it on) and `web_search.citations` (ask for citations). They are the one evidence-gated kind of stack-table binding: a stack's knob says nothing about the model behind it, so the `openrouter` (`plugins: [{"id": "web"}]`), `venice` (`venice_parameters.enable_web_search` / `enable_web_citations`), `litellm` (`web_search_options`), `openai` (`web_search_options`, search models only) and `anthropic` rows are advertised only when `capabilities.webSearch` is reported `true`. The `anthropic` row uses the binding kind `tool_entry`: `param` is `tools` and `value` is a tool object (`{"type": "web_search_20250305", "name": "web_search"}`) that the consumer **appends** to the request's `tools[]`, creating the array when absent — unlike `body_param`, which sets a field. A consumer applying a binding whose value is an array or object onto a field that already holds one extends it rather than replacing it.

### Where each backend's facts come from

Every row below is what the detector reads and which fields it publishes; the evidence entry is `<stack>:<endpoint>.<field>` as written. "true only" means a `false` from that source is not published (the vendor's schema cannot distinguish false from unknown there); "true/false" means both cross. A server-wide list (`structured` on vLLM, SGLang, llama.cpp) describes the server's constrained-decoding support, not one model's fitness for it.

| `stack` | Reads | Publishes |
|---------|-------|-----------|
| `ollama` | `POST /api/show`: `capabilities[]`, `thinking{values, default}`, `model_info.<arch>.context_length`, `details.context_length`, `details.quantization_level`, `parameters` (`num_ctx N`), the chat template; `GET /api/ps`: `models[].context_length` of the loaded model | `context` (loaded `/api/ps` > `num_ctx` > `details.context_length`), `contextTrained`, `tools`, `modalities.input` (`vision` → image, `audio`), `embeddings`, `reasoning` (true/false from `thinking.values`; `[true]` alone → `always_on`), `thinking.default`, `reasoning.effort` levels (level strings; `false` among them as `none`), `quantization` |
| `llamacpp` | `GET /props`: `default_generation_settings.n_ctx`, `modalities{vision, video, audio}`, `chat_template_caps.supports_tool_calls` / `supports_parallel_tool_calls`, the chat template; `GET /v1/models`: `meta.n_ctx`, `meta.n_ctx_train`, `meta.ftype`, `models[].capabilities ∋ multimodal` (only when `/props` listed no modalities) | `context` (`/props` `n_ctx`, else `meta.n_ctx`), `contextTrained`, `modalities.input`, `tools` (true/false), `toolsParallel` (true/false), `structured = [json_object, json_schema, grammar]` (server-wide), `quantization` (GGUF ftype name) |
| `sglang` | `GET /model_info` (fallback `/get_model_info`): `reasoning_parser`, `tool_call_parser`, `has_image_understanding`, `has_audio_understanding`, `architectures[0]`, `is_generation` (+ `embedding.task`), `served_model_name`, `model_path`; `GET /v1/models`: `max_model_len` | `context`, `reasoning` (parser set), `tools` (parser set), `modalities.input`, `embeddings` + `modalities.output = [embeddings]` (`is_generation: false` with an embed task), `structured = [json_object, json_schema, grammar, regex]` (server-wide) |
| `vllm` | `GET /version`; `GET /v1/models`: `max_model_len`; when that is absent, `POST /tokenize {model, prompt: "x"}`: `max_model_len` | `context`, `structured = [json_object, json_schema, grammar, regex, choice]` (server-wide). Nothing for `tools`: not discoverable outside `VLLM_SERVER_DEV_MODE` — the [verifier's tool probe](#runtime-evidence) answers it |
| `lmstudio` | `GET /api/v1/models`: `max_context_length`, `loaded_instances[].config.context_length`, `capabilities{vision, trained_for_tool_use, reasoning{allowed_options, default}}`, `quantization.name`, `type`, `architecture`; fallback `GET /api/v0/models`: `max_context_length`, `type` (`vlm`, `embeddings`), `capabilities ∋ tool_use`, `quantization`, `arch` | `context` (smallest loaded instance, else `max_context_length` on v0), `contextTrained` (`max_context_length` on v1), `modalities.input` image, `tools` (true only — LM Studio accepts `tools[]` for every model, so `trained_for_tool_use: false` is not a refusal), `reasoning`, `thinking.default`, `reasoning.effort` levels (`off` among them as `none`), `embeddings`, `quantization` |
| `koboldcpp` | `GET /api/extra/version`: `vision`, `audio`, `websearch`, `embeddings`; `GET /api/extra/true_max_context_length` | `context`, `modalities.input`, `webSearch` (true/false), `embeddings` (true/false). Upstream documents the vision / audio flags as "not always correct" |
| `tgi` | `GET /info`: `model_id`, `max_total_tokens` | `context` (`max_total_tokens`). `max_input_tokens` is published as nothing: the difference is the completion budget at the longest prompt, not a `maxOutput` |
| `litellm` | `GET /model_group/info`: `max_input_tokens`, `max_output_tokens`, `supports_vision`, `supports_function_calling`, `supports_parallel_function_calling`, `supports_web_search`, `supports_reasoning`, `supported_openai_params`; `GET /model/info` (the matched deployment's `model_info`): `supports_prompt_caching`, `supports_response_schema`, `supports_pdf_input`, `supports_audio_input` | `context` (`max_input_tokens`), `maxOutput`, `modalities.input` image / pdf / audio, `tools` (true only), `toolsParallel` (true only), `webSearch` (true only), `reasoning` (`false` only — a `true` is reasoning evidence for the bindings instead), `structured` (`json_object` when `response_format` is a supported param; `json_object, json_schema` with `supports_response_schema`), `promptCache` (true only). Every `supports_*` flag defaults to false in LiteLLM, so false means "not in the cost map" |
| `openrouter` | `GET /models` (memoised per host + key): the model's `supported_parameters` (`tools`, `parallel_tool_calls`, `response_format` → `json_object`, `structured_outputs` → `json_schema`, `web_search_options`, `reasoning`), `context_length` (else `top_provider.context_length`), `top_provider.max_completion_tokens`, `architecture.input_modalities` (`file` reads as `pdf`) / `output_modalities`, `reasoning{mandatory, supported_efforts, default_enabled, default_effort}` | `context`, `maxOutput`, `modalities`, `tools`, `toolsParallel`, `structured`, `webSearch` (`true` for every model on openrouter.ai itself via `openrouter:/models.plugins` — the web plugin works on any model; not asserted for an OpenRouter-shaped listing on another host), reasoning (`mandatory` → `always_on`, `reasoning.disable` / `enable` dropped), `reasoning.effort` levels, `thinking.default` |
| `venice` | `GET /models` (memoised): the model's `model_spec.availableContextTokens`, `maxCompletionTokens`, `capabilities{supportsFunctionCalling, supportsVision, supportsVideoInput, supportsAudioInput, supportsWebSearch, supportsResponseSchema, supportsReasoning, supportsReasoningEffort, reasoningEffortOptions, defaultReasoningEffort, quantization}` | `context`, `maxOutput`, `tools` (true/false), `modalities.input`, `webSearch` (true/false), `structured = [json_schema]`, `reasoning` (`false` only), `reasoning.effort` levels, `thinking.default`, `quantization` (the `not-available` placeholder is skipped) |
| `anthropic` | `GET /v1/models/{id}` with `x-api-key` and `anthropic-version: 2023-06-01`: `max_input_tokens`, `max_tokens`, `capabilities{image_input, pdf_input, thinking{supported, types{adaptive, enabled}}, effort{low…max}, structured_outputs}` | `context`, `maxOutput`, `modalities.input` image / pdf; the thinking and effort facts replace the `claude` family's name-based bindings (`reasoning.disable = {type: disabled}`, `reasoning.enable = {type: adaptive}` or `{type: enabled, budget_tokens: 1024}` + `reasoning.budget`, `reasoning.effort` = the supported levels) and `structured_outputs` gives `structured = [json_schema]`. Without a `thinking` object the facts are "not stated" and the name-based fallback stands |
| `gemini` | `GET /v1beta/models/{id}` with `x-goog-api-key` (a `models/` prefix on `modelName` is stripped): `inputTokenLimit`, `outputTokenLimit`, `thinking` | `context`, `maxOutput`, `reasoning` (true only) |
| `mistral` | `GET /v1/models/{id}` (bearer): `max_context_length`, `capabilities{function_calling, reasoning, vision, audio}` | `context`, `tools` (true/false), `reasoning` (true/false), `modalities.input` |
| `groq` | `GET /openai/v1/models/{id}` (bearer): `context_window`, `max_completion_tokens` | `context`, `maxOutput` |
| `xai` | `GET /v1/language-models/{id}` (bearer): `input_modalities`, `output_modalities`, `capabilities.reasoning_effort[]`, `default_reasoning_effort` | `modalities`, `reasoning.effort` levels, `thinking.default`. No context field is exposed |
| `together` | `GET /v1/models` (bearer; a bare array): the model's `context_length` | `context` |
| `cerebras` | `GET /public/v1/models/{id}` **without the key** (public): `limits{max_context_length, max_completion_tokens}`, `quantization`, `capabilities{function_calling, parallel_tool_calls, vision, json_mode, structured_outputs, reasoning}` | `context`, `maxOutput`, `quantization`, `tools` (true/false), `toolsParallel` (true/false), `modalities.input`, `structured` (`json_object`, `json_schema`), `reasoning` (true/false) |
| `deepinfra` | `GET /v1/openai/models` **without the key** (an undocumented open listing, best-effort): the model's `metadata{context_length, max_tokens}` | `context`, `maxOutput` |
| `hf-router` | `GET /v1/models` **without the key**: `architecture.input_modalities` / `output_modalities`, `providers[]` with status `live` / `ok`: `context_length` (largest), `supports_tools` (any), `supports_structured_output` (any) | `modalities`, `context`, `tools` (true/false), `structured = [json_schema]` |
| `openai`, `fireworks`, `hyperbolic`, `deepseek`, `moonshot`, `nvidia-nim`, `sambanova` | nothing — recognised by hostname only (OpenAI's model listing carries no capability field) | only the offline registry, declared facts and runtime evidence |

A vendor lookup uses the configured `modelName` without Venice-style inline parameters (`:key=value` segments are dropped; an Ollama-style `:8b` tag stays) as the id; a 404 is a silent miss. Behind LiteLLM the capabilities come first from LiteLLM's own `/model_group/info` and `/model/info`. When the anonymous second hop identifies the upstream (or reads an Ollama upstream), the facts that upstream reports fill the fields LiteLLM left unset, keeping the upstream's evidence entry (for example `capabilities.context` from `venice:/models.model_spec.availableContextTokens`). For `context` and `maxOutput` the smaller figure wins: LiteLLM's comes from its cost map or the operator's `model_info` and is not enforced, while the upstream's (a vLLM `max_model_len`, an Ollama loaded window, a vendor listing's limit) is what a request meets. A positive `tools`, `toolsParallel` or `structured` crosses only when LiteLLM forwards the matching standard param for the model (`tools`, `parallel_tool_calls`, `response_format` in `supported_openai_params`; an unreadable list does not block it); a negative one always crosses. An Ollama upstream's `audio` input does not cross, since LiteLLM's Ollama providers translate text and image parts only. The upstream's reasoning report wins over LiteLLM's `supports_reasoning: false` (see [`reasoning`](#the-capabilities-block)). The upstream's `thinking.default` and its mandatory reasoning (OpenRouter `reasoning.mandatory`, Ollama `thinking.values: [true]`) cross as well, and a `webSearch` reported true opens the upstream's `web_search.*` knobs, which LiteLLM forwards as provider kwargs. Nothing crosses from an upstream that was not identified. A crossed fact counts as known, like one read from a backend reached directly, so the [runtime probes](#runtime-evidence) do not ask it again.

### Keys and anonymous endpoints

The model's `apiKey` goes only to the model's own host:

- **Key always.** Every engine probe to the model's own host carries the key: llama.cpp `/props`, SGLang `/model_info`, LiteLLM, each engine's `/v1/models`, and also the endpoints an engine documents as open — vLLM `/version` and `/tokenize`, TGI `/info`, every KoboldCpp GET, Ollama `/api/tags`, `/api/show`, `/api/ps`, LM Studio `/api/v1/models` and `/api/v0/models`. An auth proxy in front of the engine may answer a keyless request with a 404, a redirect to a login page or an HTML page, which would hide the engine, so on that host these never go out without the key (the anonymous LiteLLM hop below is the exception). The OpenRouter and Venice listings and the per-model vendor lookups (Anthropic `x-api-key`, Gemini `x-goog-api-key`, Mistral / Groq / xAI / Together bearer) carry it too.
- **Never a key.** Cerebras `/public/v1/models/{id}`, DeepInfra `/v1/openai/models` and the Hugging Face router `/v1/models` are read anonymously — they are public listings, so the key stays home. The LiteLLM second hop is anonymous too (no key ever goes to another host).

Nothing published or logged carries `apiUrl`, `apiKey`, `api_base`, upstream model ids or hostnames; the diagnostics trace redacts URL credentials.

### Offline registry

For a hosted vendor recognised by hostname — the `openai` stack included, since nothing but the hostname identifies it — detection also consults a generated, offline snapshot of two public model catalogues: [models.dev](https://models.dev/api.json) and LiteLLM's [`model_prices_and_context_window.json`](https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json), both MIT-licensed (recorded in the generated file's header together with the snapshot date). The snapshot is the **lowest-precedence source**: it fills only fields nothing else set, with evidence `registry:<name>@<date>`. It is never consulted for a self-hosted engine (a fingerprinted vLLM or Ollama serves whatever window and quantisation it was started with, and the snapshot would be a guess), nor for a models-config `apiStack` preset (a declared stack short-circuits to the static spec before probing), nor with `-ignore-host`.

The lookup tries the served model id, then the bare `modelName`, then the configured `modelName`: exact normalised id first across all candidates (lowercase, no `:key=value` segments), then a unique match on the segment after the last `/`. No fuzzy matching. A matched entry contributes `context`, `maxOutput`, `modalities`, and `reasoning`, `tools`, `structured` (`json_schema`), `webSearch`, `promptCache` — each **only when true**: LiteLLM omits what it does not know, so a false flag is indistinguishable from an absent one. The trace names which candidate matched (`registry: models.dev+litellm@2026-09-25 matched "served model id"`), never the id.

Regenerate with `make registry` from `proxy-router/` (or `go generate ./internal/apispec/registry/...`; the generator takes `-date=YYYY-MM-DD` so a re-run on the same day is byte-identical, and `-modelsdev` / `-litellm` to read local files instead of the network). It keeps LiteLLM `chat` and `responses` models, lowercases ids, strips leading `<provider>/` prefixes while each is a known provider id (a Hugging Face org such as `mistralai/` stays), drops `:key=value` segments (Ollama `:q4` and OpenRouter `:free` tags stay), and merges per id with the vendor of record preferred and models.dev winning over LiteLLM on conflicts. The Go source is capped at 1.5 MB; over the cap it drops LiteLLM-only entries first, then entries carrying no capability flag. Commit the regenerated `registry_data.go`.

### Runtime evidence

Detection reads service endpoints only. Facts that need an inference request come from `internal/modelhealth` in two layers, merged onto a **clone** of the cached detection result — the detector's cache never holds runtime evidence — and re-merged on every sweep until each fact is older than `MODEL_API_DETECT_TTL`.

**The health probe's own response (free, always on).** The ordinary arithmetic health probe already makes one chat request per sweep; its response is now read as evidence, with no extra request:

- the served `model` id refines `modelFamily` the way detection's served id does;
- `reasoning_content` / `reasoning` / `reasoning_details` or a `<think>` block in the answer sets `capabilities.reasoning = true` (`health-probe:reasoning_seen`);
- `x-litellm-*` response headers name `stack: litellm` when detection found no stack at all (evidence key `stack`, `health-probe:headers`);
- a 4xx whose body names the context window (OpenAI / vLLM `maximum context length is N tokens`, vLLM `exceeds model's maximum context length (N)`, llama.cpp `exceed_context_size_error` with `n_ctx`, TGI `must be <= N`, Anthropic `prompt is too long`) fills `capabilities.context` **only when unset** (the `health-probe:…` sources listed above);
- a 4xx that rejects request parameters (OpenAI `Unrecognized request argument supplied`, pydantic `extra_forbidden`, LiteLLM `UnsupportedParamsError … does not support parameters`) drops every binding whose `param` is that name or lies under it, leaving `bindings.<intent> = verify:rejected:<param>@<unix>`; `thinking.mode` and the derived `reasoning` are recomputed from the bindings that remain.

The `api` block is published on every `checkModel` outcome — a healthy, degraded or unhealthy probe, a model without a bid — and `declaredAt` is preserved across sweeps when the merged block is unchanged. Only the OpenAI adapter fills the response metadata; other adapters contribute nothing here.

**Verifier and capability probes (opt-in, off by default).** Two switches send **inference requests** — every one a chat completion with `max_tokens: 1` and the arithmetic prompt, whose verdict comes from the HTTP status, the error body and whether reasoning content was present, never from the answer:

| Variable | Default | What it sends |
|----------|---------|---------------|
| `MODEL_API_VERIFY_BINDINGS` | `false` | (a) When the block has a `reasoning.disable` binding of kind `body_param` or `template_kwarg` with a fixed value: the probe with that binding applied. 2xx without reasoning content → `verified: true` (`verify:reasoning.disable@<unix>`); 2xx with reasoning content → `verified: false` (`verify:reasoning_content_still_present@<unix>`), `capabilities.reasoning = true` and `thinking.mode: always_on` (`verify:reasoning_seen_with_disable@<unix>`); a 4xx naming the parameter → binding dropped (`verify:rejected:<param>@<unix>`); 401, 402, 403 and 429 are never read as a verdict (see below). `system_prompt` and `native_body_param` bindings are never sent. (b) When `capabilities.tools` is unknown: the probe with a dummy tool and `tool_choice: "auto"`. 2xx → `tools: true` (`verify:tools@<unix>`); vLLM's documented `"auto" tool choice requires --enable-auto-tool-choice` refusal → `tools: false` (`verify:tool_choice_auto@<unix>`); any other 4xx → unknown |
| `MODEL_API_PROBE_CAPABILITIES` | `false` | When `structured` lacks `json_schema`: the probe with `response_format: {type: json_schema, …}` — 2xx adds `json_schema` (`verify:json_schema@<unix>`). When `modalities.input` lacks `image`: the probe with one 1×1 PNG data-URL image part — 2xx adds `image` (`verify:image@<unix>`, `text` prepended). A refusal publishes nothing: a probe proves what it saw, not the absence of the rest. On `vllm`, when the `reasoning.disable` binding is a `template_kwarg` and the completion probe left it undecided: two `POST /v1/chat/completions/render` calls (no generation) with the kwarg at its off and on values — different `token_ids` verify the `reasoning.disable` and `reasoning.enable` template bindings, identical ones refute them (`verify:rendered_prompt_unchanged@<unix>`); with only the off value known and no evidence the template thinks by default, identical renders publish nothing |

Both switches reach every model that publishes an `api` block (declared, detected, or declared capabilities only; a model with no block is not probed): recognised self-hosted engines (`vllm`, `sglang`, `llamacpp`, `ollama`, `tgi`, `lmstudio`, `koboldcpp`), hosted vendors and gateways (`openai`, `anthropic`, `openrouter`, `venice`, `litellm` and every hostname-recognised vendor — `gemini`, `groq`, `together`, …), an upstream reached through a gateway (`via` set) and a backend detection could not name (a hosted vendor behind a custom domain is the likely case). There is no per-backend opt-out: on a hosted vendor or gateway, and most likely on an unnamed backend, every probe request is billed, so to keep hosted backends unprobed leave both switches off.

Pacing and cost: the probes run only after a **healthy** LLM probe (or a healthy guessed-LLM probe), **one completed run per `MODEL_API_DETECT_TTL` per model and spec** — the once-per-TTL key hashes the stack, the gateway and the bindings, so a models-config change to the bindings or a re-detection that changes them triggers a fresh verification before the TTL, while tool and capability facts carry over — with each request paced by `MODEL_HEALTH_CHECK_PROBE_DELAY` like the health probes and bounded by `MODEL_HEALTH_CHECK_TIMEOUT`. Expect up to six extra requests per model per run when both switches are on (the render check sends two, without generation); a stopped run and its resumption together can send a few more, since the resumption repeats the probe that was stopped. A run that establishes nothing still counts as done, so a backend that answers nothing usable is asked once per TTL, not once per sweep; a run cut short by shutdown records nothing and the next sweep retries. A **401, 402, 403 or 429** to any probe is an account or rate-limit answer, not a verdict on the feature, whatever its body says: the run stops there and sends nothing more, what it established before is published, and it does not count as done. The next healthy sweep resumes it once: it asks only what is still unknown (a `reasoning.disable` completion the stopped run answered is not sent again, nor is the render check then), and it counts as done whatever it meets, so a backend that keeps turning the caller away costs one stopped run and its resumption per TTL. Verdicts persist for the TTL (up to two when a resumed run carries them) and are republished on every sweep without new requests; after the TTL the probes run again. Turning a switch off lets its facts expire at the TTL. A declared `apiStack` spec is verified exactly like a detected one. The verifier's spec is the block with the runtime evidence already merged, so a binding an earlier sweep saw rejected is not sent again, and a question the block already answers is not asked.

Operator log lines: `model <id>: verify <probe>: <outcome> (HTTP <n>): <reason>` at `Info` for refuted, rejected and refused verdicts, at `Debug` otherwise, and at `Info` with `; run stopped, the rest is asked next sweep` appended for an account or rate-limit answer; the merge trace (`runtime evidence: …`) is at `Debug`.

### Known limits

- **vLLM tool calling** is not discoverable from any service endpoint (only in `VLLM_SERVER_DEV_MODE`); `tools` on vLLM comes from the verifier's tool probe or a declared `capabilities.tools` (the offline registry never applies to a fingerprinted engine), and its `false` means the server refused `tool_choice: "auto"` as configured, not that the model cannot call tools.
- **SGLang's grammar backend** (xgrammar, outlines, llguidance) is not detectable; `structured` on SGLang lists what every SGLang server accepts, not which backend enforces it. Likewise the vLLM and llama.cpp `structured` lists are server-wide.
- **Anonymous listings may change.** DeepInfra's `/v1/openai/models` is undocumented, the Hugging Face router aggregates several providers (facts are the best any live provider offers), and OpenRouter's listing fields follow its own release cadence; a changed shape silently yields fewer facts, never wrong ones.
- **Venice `supportsWebSearch`** is `true` for every text model on Venice today, so `webSearch: true` from `venice:/models.model_spec.capabilities.supportsWebSearch` says little about the model itself.
- **KoboldCpp's `vision` / `audio` flags** are documented upstream as "not always correct"; they are published as the backend's own report.
- **LiteLLM `supports_*` flags** default to false for models missing from its cost map, so only `true` crosses (except `supports_reasoning: false`), and **the registry** cannot distinguish false from unknown either.
- **LM Studio `trained_for_tool_use: false`** is not `tools: false` — LM Studio accepts `tools[]` for every model.
- **Family bindings are documented knobs.** Chat-template kwargs and system-prompt toggles are advertised from the model card; `verified` tells you which ones a probe has actually confirmed on your backend.

**Diagnostics CLI.** `go run ./cmd/apidetect [-config models-config.json] [-model <substring>] [-ignore-host] [-two-hop=false] [-timeout 15s] [-json] [-verify]` (from `proxy-router/`) runs detection for every model in a `models-config.json` and prints the stack (with the `via` gateway when there is one), family, source, thinking mode and default, bindings with their `[verified …]` / `[unverified: <evidence>]` marks, capabilities, the evidence map and every probe step. It never prints API keys or URL credentials. `-ignore-host` skips hostname recognition (what a custom domain would get; also skips the offline registry); `-two-hop=false` disables the LiteLLM second hop. `-verify` needs `-model` naming **exactly one** entry and then sends the binding verifier and capability probes to that model — up to six inference requests (the `reasoning.disable` completion, tools, `json_schema`, image, and two vLLM render calls) to the model's own host with the model's key — ignoring `MODEL_API_VERIFY_BINDINGS`, `MODEL_API_PROBE_CAPABILITIES`, the checker's once-per-TTL pacing and whether a field is already known; `-timeout` doubles as the per-probe budget. Like the checker it stops at the first 401, 402, 403 or 429 and reports how many probes it did not send. It prints a cost warning on stderr for hosted vendors, gateways, a spec reached via a gateway or an unidentified stack. The printed block is the detected spec with the verdicts merged (what the checker would publish); a `verify:` section lists the requests sent (method, path and status only — never the host, query or key), the verdicts and the merge trace, and `-json` adds `runtime`, `verifyTrace`, `verifyRequests`, `verifyVerdicts` and, after such a stop, `verifyNotSent`. Exit codes: `0` ok, `1` unusable config, no matching model, or an adapter / encode failure, `2` a flag combination the command cannot act on (`-verify` without `-model`, or `-model` matching several entries).

```json
{
  "modelId": "0x0000000000000000000000000000000000000000000000000000000000000008",
  "modelName": "Qwen3-235B-A22B",
  "apiType": "openai",
  "apiStack": "vllm",
  "apiUrl": "http://localhost:8000/v1/chat/completions",
  "modelFamily": "qwen3",
  "capabilities": {
    "context": 40960,
    "tools": true
  }
}
```

A published block for that model, after a sweep with `MODEL_API_VERIFY_BINDINGS=true`, looks like:

```json
"api": {
  "stack": "vllm",
  "modelFamily": "qwen3",
  "thinking": { "mode": "controllable" },
  "bindings": {
    "reasoning.disable": { "kind": "template_kwarg", "param": "chat_template_kwargs.enable_thinking", "paramType": "boolean", "value": false, "verified": true, "verifiedAt": 1790000000 },
    "reasoning.enable": { "kind": "template_kwarg", "param": "chat_template_kwargs.enable_thinking", "paramType": "boolean", "value": true }
  },
  "capabilities": {
    "context": 40960,
    "tools": true,
    "reasoning": true
  },
  "evidence": {
    "capabilities.context": "declared",
    "capabilities.tools": "declared",
    "capabilities.reasoning": "derived:bindings.reasoning",
    "bindings.reasoning.disable": "verify:reasoning.disable@1790000000"
  },
  "source": "declared",
  "declaredAt": 1790000000
}
```

## Examples

Models without `apiStack` (such as `llama2` below) get a detected `api` block.

```json
{
  "$schema": "./internal/config/models-config-schema.json",
  "models": [
    {
      "modelId": "0x0000000000000000000000000000000000000000000000000000000000000000",
      "modelName": "llama2",
      "apiType": "openai",
      "apiUrl": "http://localhost:8080/v1/chat/completions"
    },
    {
      "modelId": "0x0000000000000000000000000000000000000000000000000000000000000001",
      "modelName": "inference.sdxl.txt2img.v1",
      "apiType": "prodia-v2",
      "apiUrl": "https://inference.prodia.com/v2/job",
      "apiKey": "FILL_ME_IN"
    },
    {
      "modelId": "0x0000000000000000000000000000000000000000000000000000000000000002",
      "modelName": "SDXL1.0-base",
      "apiType": "hyperbolic-sd",
      "apiUrl": "https://api.hyperbolic.xyz/v1/image/generation",
      "apiKey": "FILL_ME_IN",
      "parameters": {
        "cfg_scale": "5",
        "steps": "30"
      }
    },
    {
      "modelId": "0x0000000000000000000000000000000000000000000000000000000000000003",
      "modelName": "claude-3-5-sonnet-20241022",
      "apiType": "claudeai",
      "apiStack": "anthropic",
      "apiUrl": "https://api.anthropic.com/v1/messages",
      "apiKey": "FILL_ME_IN"
    },
    {
      "modelId": "0x0000000000000000000000000000000000000000000000000000000000000004",
      "modelName": "gpt-4o-mini",
      "apiType": "openai",
      "apiUrl": "https://api.openai.com/v1/chat/completions",
      "apiKey": "FILL_ME_IN"
    },
    {
      "modelId": "0x0000000000000000000000000000000000000000000000000000000000000005",
      "modelName": "text-embedding-bge-m3",
      "apiType": "openai",
      "apiUrl": "https://api.venice.ai/api/v1/embeddings",
      "apiKey": "FILL_ME_IN"
    },
    {
      "modelId": "0x0000000000000000000000000000000000000000000000000000000000000006",
      "modelName": "tts-kokoro",
      "apiType": "openai",
      "apiUrl": "https://api.venice.ai/api/v1/audio/speech",
      "apiKey": "FILL_ME_IN"
    },
    {
      "modelId": "0x0000000000000000000000000000000000000000000000000000000000000007",
      "modelName": "whisper-1",
      "apiType": "openai",
      "apiUrl": "https://api.openai.com/v1/audio/transcriptions",
      "apiKey": "FILL_ME_IN"
    },
    {
      "modelId": "0x0000000000000000000000000000000000000000000000000000000000000009",
      "modelName": "gemini-2.5-flash",
      "apiType": "openai",
      "apiStack": "gemini",
      "apiUrl": "https://generativelanguage.googleapis.com/v1beta/openai/chat/completions",
      "apiKey": "FILL_ME_IN"
    },
    {
      "modelId": "0x00000000000000000000000000000000000000000000000000000000000000a1",
      "modelName": "jev-1.13.0",
      "apiType": "decisions",
      "apiUrl": "https://api.typesafe.ai/v1/systemone",
      "apiKey": "FILL_ME_IN"
    },
    {
      "modelId": "0x00000000000000000000000000000000000000000000000000000000000000a2",
      "modelName": "typesafe/jev-1.13",
      "apiType": "decisions",
      "apiUrl": "https://openrouter.ai/api/alpha/decisions",
      "apiKey": "FILL_ME_IN"
    },
    {
      "modelId": "0x00000000000000000000000000000000000000000000000000000000000000b1",
      "modelName": "dreamina-seedance-2-0-260128",
      "apiType": "byteplus-video",
      "apiUrl": "https://ark.ap-southeast.bytepluses.com/api/v3",
      "apiKey": "FILL_ME_IN"
    },
    {
      "modelId": "0x00000000000000000000000000000000000000000000000000000000000000b2",
      "modelName": "seedance-2.5-t2v",
      "apiType": "renderful",
      "apiUrl": "https://api.renderful.ai/api/v1",
      "apiKey": "FILL_ME_IN"
    }
  ]
}
```

> **Decisions (`apiType=decisions`).** `apiUrl` must be the **full** upstream Decisions / System One endpoint URL (embeddings parity — no path append). TypeSafe example: `https://api.typesafe.ai/v1/systemone`. OpenRouter example: `https://openrouter.ai/api/alpha/decisions`. `modelName` is the upstream model id (e.g. `jev-1.13.0` or `typesafe/jev-1.13`); the adapter overwrites any client body `model`. Consumers call `POST /v1/decisions` — see [Decisions](/consumers/decisions).

## Video models

`apiType` `byteplus-video` and `renderful` serve hosted video generation as [video jobs](/consumers/video), never chat. A consumer submits a job on a session. The provider sends it to the vendor with its own `apiKey` and relays the job's status. The key never leaves the provider.

| `apiType` | Vendor | `apiUrl` (API base) | `modelName` |
|-----------|--------|---------------------|-------------|
| `byteplus-video` | BytePlus ModelArk (Seedance) | `https://ark.ap-southeast.bytepluses.com/api/v3` | The Ark model id with its version, e.g. `dreamina-seedance-2-0-260128`, or a custom inference endpoint id |
| `renderful` | Renderful | `https://api.renderful.ai/api/v1` | The Renderful model id, e.g. `seedance-2.5-t2v` |

- `apiUrl` is the API base, not an endpoint: the adapter appends the task paths. The values above are also what the adapter uses when `apiUrl` is empty.
- **BytePlus:** activate the model for your account in the Ark console. Otherwise every job fails with `404 ModelNotOpen`, and the health probe cannot see it.
- **Renderful:** a first frame (image-to-video) works only when `modelName` ends in `-t2v`. The node sends those jobs to the `-i2v` sibling (`seedance-2.5-t2v` → `seedance-2.5-i2v`). Renderful takes the frame as `image_url` only.
- **Price:** there is no per-model `video` block; a leftover `"video"` key is ignored. The bid's `pricePerSecond` sets the price.
- **On chain:** register the model with a video tag (`video`, `t2v`, `i2v`, `text-to-video`, `text2video`, `image-to-video`, `image2video`) so `GET /blockchain/models` reports `ModelType` `VIDEO`. A model that also carries an `llm`, `stt`, `tts`, `embedding` or decisions tag keeps that type. Clients then send it chat, which a video `apiType` refuses.
- **Health:** a free vendor probe, never a render. See [Model health self-report](/providers/full/model-health).
- **Load:** consumers' status reads reach the vendor at most once per job every 5 s. The provider keeps each task record for 8 days.

**`modelName` sets the limits** that the node offers and advertises in the model's job guide (`video` in the `/healthcheck` and pong `models` lists). The guide also publishes `modelName` itself as `model_name`, so a custom inference endpoint id used there is public. A job outside them is refused before it reaches the vendor. Omitted fields default to 5 s, `16:9`, `720p` and no audio. Every model takes the aspect ratios `16:9`, `4:3`, `1:1`, `3:4`, `9:16` and `21:9`. The `adaptive` column says whether it also takes `adaptive`, which keeps the first frame's own ratio. A job with a first frame is sent as `adaptive` on every BytePlus model and on Renderful Seedance models.

`byteplus-video`: every model takes a first frame, as `image_url` or inline `image_b64`.

| `modelName` starts with | Duration (s) | Resolutions | `adaptive` | `generate_audio` |
|-------------------------|--------------|-------------|------------|------------------|
| `dreamina-seedance-2-5` | 4–30 | `480p`, `720p`, `1080p` | yes | yes |
| `dreamina-seedance-2-0-fast`, `dreamina-seedance-2-0-mini` | 4–15 | `480p`, `720p` | yes | yes |
| `dreamina-seedance-2-0` (other) | 4–15 | `480p`, `720p`, `1080p` | yes | yes |
| `seedance-1-5-pro` | 4–12 | `480p`, `720p`, `1080p` | yes | yes |
| `seedance-1-0-pro` | 2–12 | `480p`, `720p`, `1080p` | no | no |
| anything else, e.g. a custom inference endpoint id | 4–12 | `480p`, `720p` | no | no |

`renderful`: a first frame only for a `-t2v` `modelName`, as `image_url`.

| `modelName` starts with | Duration (s) | Resolutions | `adaptive` | `generate_audio` |
|-------------------------|--------------|-------------|------------|------------------|
| `seedance-2.0` | 4–15 | `480p`, `720p` | yes | yes |
| `seedance-1.5` | 4–12 | `480p`, `720p` | yes | yes |
| `seedance-1.0` | 2–12 | `720p`, `1080p` | yes | no |
| any other `seedance-`, e.g. `seedance-2.5-t2v` | 4–30 | `480p`, `720p` | yes | yes |
| anything else | 4–30 | `480p`, `720p` | yes | no |

## Reload without a restart

The file is read once at boot. Historically, adding or editing a model meant restarting the proxy-router, which cuts every open session — and each cut session can be closed out as a dispute against your success ratio. Since the release after v7.11 you can re-read the file in place:

```bash
curl -s -X POST -u 'admin:yourpassword' http://localhost:8082/config/models/reload
# {"added":["0x…"],"removed":[],"healthSweepQueued":true}
```

- Permission `system_config` (the admin user's `*` whitelist covers it).
- The file is parsed into a fresh table and swapped atomically. Requests already in flight keep the config they started with; the next request sees the new table. A new model is servable as soon as the call returns.
- **A file that fails to parse or validate returns `400` and leaves the running table untouched.** A half-edited file cannot empty a serving node. The error body names the problem: `{"error":"models config not reloaded, previous table still in force: …"}`.
- `added` / `removed` list the model IDs that changed relative to the previous table, sorted. An unchanged file returns both empty.
- `healthSweepQueued` is `true` when a [model health](/providers/full/model-health) sweep was queued so models with an active bid are probed now (same as `POST /healthcheck/models/refresh`). Models without a bid cost nothing until one is posted. A `tee`-tagged model added this way is attested during that sweep; with `MODEL_HEALTH_CHECK_DISABLED=true` it will not be attested until the next restart.
- Applies to the file at `MODELS_CONFIG_PATH`. A restart with a non-empty `MODELS_CONFIG_CONTENT` replaces that file first. With the variable empty, edit the file and reload.

On older releases the endpoint returns `404` — restart the proxy-router instead. Removing a model that has open sessions makes those sessions fail at the receiver; drop the bid first and let sessions drain.

## Inline content (for TEE / Akash)

For deployments where mounting a JSON file is impractical, set `MODELS_CONFIG_CONTENT` to a **single-line JSON string** with the exact same shape as above. On every start, a non-empty value replaces the file at `MODELS_CONFIG_PATH`, then the process loads that file. An empty value leaves the stored file. This is the standard approach in [TEE](/providers/full/secretvm-quickstart) and [Akash](/providers/full/proxy-router-akash) deployments. A missing file and an empty value starts the process with an empty model registry.
