Skip to content

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

Closed

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.

Activity

  1. thdxr commented on Jul 14, 2025

    @thdxr
    Member

    interesting - we i set them like this

              openaiCompatible: {
                cache_control: { type: "ephemeral" },
              },
    
  2. AurelienTollard commented on Jul 14, 2025

    @AurelienTollard
    ContributorAuthor

    From what I see openaiCompatible field is only used from within the prompt option definition, rather than at the model/provider level

  3. rekram1-node commented on Dec 28, 2025

    @rekram1-node
    Collaborator

    [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

  4. added a commit that references this issue on Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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