Repository navigation
Description
Problem Statement
OpenRouter became a built-in provider in #1522. Its preset has a list of five models, and
ocr uses that list as an allowlist for --model. OpenRouter serves hundreds of models, so
most valid model IDs fail:
$ ocr review --provider openrouter --model deepseek/deepseek-v4.1-flash
model "deepseek/deepseek-v4.1-flash" is not available for provider "openrouter"; available models: anthropic/claude-fable-5.1, openai/gpt-5.6-sol, anthropic/claude-opus-5, openai/gpt-6-astra, moonshotai/kimi-k3
The check is in tryProviderConfig in internal/llm/resolver.go. It compares --model
against the preset Models plus providers.openrouter.models, with an exact match.
The description of #1522 says users can enter other models by their exact ID. That works in
the ocr config model picker, but not with --model.
We run ocr in a review pipeline with a different OpenRouter model for each run, and we pick
the model on the command line. Before #1522 we used a custom provider for this. The built-in
provider is the better setup, but today it cannot run our models.
Proposed Solution
For openrouter, treat the preset model list as suggestions for the picker, not as an
allowlist for --model. Pass any model ID to OpenRouter and let OpenRouter reject an unknown
one.
The resolver already does this for ambient-auth providers such as Bedrock. The comment there
says the list "stays a picker for ocr config model; it does not gate an override". One way
to extend it is a field on Provider, for example OpenModelList bool, set on openrouter
and read in the same place as gateOverrideOnModelList. Other aggregator presets, such as
litellm or novita, could use the same field.
Alternatives Considered
- Add each model ID to
providers.openrouter.models. This works, but every new model needs a
config change on every machine, and the list duplicates the model name we already pass. - Keep a custom provider pointed at
https://openrouter.ai/api/v1. This works, but it means
we do not use the built-in provider at all. - Fetch the model list from
https://openrouter.ai/api/v1/models(the idea left open in
Add OpenRouter as a built-in provider #1540). This helps the picker, but a gate on a fetched list still fails when the fetch fails
or the catalog changes.
Affected Area
CLI / Commands, Configuration
Additional Context
- feat(llm): add OpenRouter to list of providers #1522 added the preset. Add OpenRouter as a built-in provider #1540 is the closed request for it.
- feat(providers): add AWS Bedrock as a built-in provider with native SigV4 auth #705 added the Bedrock exception to the same gate.
- Version: v1.12.11 (the gate is the same in v1.12.10).
Activity
wu21-web commentedon Oct 3, 2026
@moltar If valid models ID that are not in the default registry, you either
or
Note that the existance check is enforced by default. There is no way to bypass it.
Here is how:
lizhengfeng101 commentedon Oct 5, 2026
@moltar The fix has been merged in #1610, and the v1.12.12 release workflow is currently queued.
Once v1.12.12 is available, please have your team upgrade to v1.12.12 or later. You can then use any valid OpenRouter model ID with
--provider openrouter --model <model-id>without adding it to the configured model list. The preset list remains picker suggestions; OpenRouter validates the requested model ID.Thanks for reporting this and sharing your team’s use case!
moltar commentedon Oct 5, 2026
wot? 😆
moltar commentedon Oct 5, 2026
@lizhengfeng101 thanks 🤗
wu21-web commentedon Oct 5, 2026
You can register your usage in #1020 to help OCR improve by the way.