feat(models): take provider metadata for allowlist models from /models
With allowlist (the default since #1384), configured models were served without the provider's own metadata: the registry skipped /models entirely, so context window, max output, pricing and model type came only from the model catalog, and models the catalog doesn't know had none.
Now an allowlist provider calls /models once per refresh for metadata only:
- The inventory is still exactly the configured list. Upstream-only models are never added, and configured models upstream doesn't list are still served.
- The call is best-effort (10s timeout). A failure is logged at warn, a missing
/modelsendpoint (404/405) silently, and neither changes the inventory or provider health. Health keeps following the availability check. GOMODEL_OFFLINE=trueturns the call off, so air-gapped installs make no listing calls for allowlist providers.
History: the first version of #268 called /models in allowlist mode; a later commit there dropped the call while fixing hidden allowlist listing errors, which also dropped the metadata.
Docs (en/de/pl/zh), .env.template, config.example.yaml and the dashboard hint are updated for the new behavior.
Summary by CodeRabbit
- New Features
- Allowlist mode can retrieve metadata for configured models from the provider’s
/modelsendpoint without adding other models. If a request fails, the last successfully retrieved metadata is retained. - Metadata retrieval is enabled by default. Set
ALLOWLIST_UPSTREAM_METADATA=falseto disable it; offline mode also disables these requests without affecting inference.
- Allowlist mode can retrieve metadata for configured models from the provider’s
- Behavior Changes
- Configured model lists now limit available models by default; requests for other models return 404. Use
fallbackormergemode to change how configured and provider-listed models are combined.
- Configured model lists now limit available models by default; requests for other models return 404. Use
- Documentation
- Updated configuration and provider guidance, including model-mode examples and dashboard descriptions.
Setting: ALLOWLIST_UPSTREAM_METADATA (YAML models.allowlist_upstream_metadata, default true) turns the allowlist metadata call off on its own; GOMODEL_OFFLINE=true forces it off. The Models modes table drops its "Calls upstream /models" column (every mode now calls it) in favor of a note on what allowlist uses it for.