Skip to content

Allow any OpenRouter model ID in --model for the built-in openrouter provider #1609

Closed

Description

@moltar

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

Activity

  1. wu21-web commented on Oct 3, 2026

    @wu21-web
    Contributor

    @moltar If valid models ID that are not in the default registry, you either

    • Add them to the default registry
      or
    • Per the documentation:
    ocr config set provider                    anthropic
    ocr config set model                       claude-opus-4-6
    ocr config set providers.anthropic.api_key sk-ant-xxxxxxxxxx

    Note that the existance check is enforced by default. There is no way to bypass it.
    Here is how:

    femboy@femboys-Mac-mini ~ % ocr config set provider oopenrouter
    Set provider = oopenrouter
    femboy@femboys-Mac-mini ~ % echo $?
    0
    femboy@femboys-Mac-mini ~ % ocr config set model deepseek/deepseek-v4.1-flash
    Set model = deepseek/deepseek-v4.1-flash
    femboy@femboys-Mac-mini ~ % # Then review again
    
  2. lizhengfeng101 commented on Oct 5, 2026

    @lizhengfeng101
    Contributor

    @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!

  3. deleted a comment from weebeeblazin-ui on Oct 5, 2026
  4. moltar commented on Oct 5, 2026

    @moltar
    Author

    wot? 😆

  5. moltar commented on Oct 5, 2026

    @moltar
    Author

    @lizhengfeng101 thanks 🤗

  6. wu21-web commented on Oct 5, 2026

    @wu21-web
    Contributor

    You can register your usage in #1020 to help OCR improve by the way.

  7. deleted a comment from weebeeblazin-ui on Oct 8, 2026
  8. deleted a comment from weebeeblazin-ui on Oct 8, 2026
  9. deleted a comment from weebeeblazin-ui on Oct 8, 2026
  10. deleted a comment from weebeeblazin-ui on Oct 8, 2026
  11. deleted a comment from weebeeblazin-ui on Oct 8, 2026
  12. deleted a comment from weebeeblazin-ui on Oct 8, 2026
  13. deleted a comment from weebeeblazin-ui on Oct 8, 2026
  14. deleted a comment from weebeeblazin-ui on Oct 8, 2026
  15. deleted a comment from weebeeblazin-ui on Oct 8, 2026
  16. deleted a comment from weebeeblazin-ui on Oct 8, 2026
  17. deleted a comment from weebeeblazin-ui on Oct 8, 2026
  18. deleted a comment from weebeeblazin-ui on Oct 8, 2026
  19. deleted a comment from weebeeblazin-ui on Oct 8, 2026
  20. deleted a comment from weebeeblazin-ui on Oct 8, 2026
  21. deleted a comment from weebeeblazin-ui on Oct 8, 2026
  22. deleted a comment from weebeeblazin-ui on Oct 8, 2026
  23. deleted a comment from weebeeblazin-ui on Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions