Model options are not forwarded for openai-compatible providers unless provider.name option is given
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.
interesting - we i set them like this
openaiCompatible: {
cache_control: { type: "ephemeral" },
},
From what I see openaiCompatible field is only used from within the prompt option definition, rather than at the model/provider level
[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!