Skip to content

Model options are not forwarded for openai-compatible providers unless provider.name option is given #971

Description

@AurelienTollard

Custom model options are not forwarded correctly when provider are using @ai-sdk\openai-compatible.
This can be mitigated by explicitly indicating "name" value in the provider config. E.g:

    "openrouter": {
      "options": { 
        "name": "OpenRouter" // models.options is not forwarded without this
      },
      "models": {
        "qwen/qwen3-235b-a22b": {
          "name": "Qwen3",
          "tool_call": false,
          "options": {
            "OpenRouter": {
              "provider": {
                "order": [
                  "cerebras"
                ],
                "allow_fallbacks": false
              }
            }
          }
        }
      }
    }

This is due to @ai-sdk\openai-compatible searching for providerOptions based on the provideerOptionsName attribute, which is not set by opencode by default. ai-sdk code responsible for option selection.

Metadata

Metadata

Assignees

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