Skip to content

[FEATURE]: Support custom API parameter passthrough in variants for custom providers #27462

Closed as not planned

Description

@Innerpeace1990

Feature hasn't been suggested before

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Background:
When configuring a custom provider using @ai-sdk/openai-compatible (e.g., Zhipu AI, DeepSeek, Moonshot/Kimi), the variants field in the model configuration does not pass custom parameters through to the API request body.

Reproduction:
Configuration:

glm-5v-turbo: {
  name: GLM-5V-Turbo,
  variants: {
    think: { thinking: { type: enabled } },
    fast:  { thinking: { type: disabled } }
  }
}

The variant dropdown correctly shows Think and Fast options in the UI, but checking the API request logs reveals that the thinking parameter is not included in the request body sent to the provider's API.

Evidence:
Log entry (from error-level request logging):

{requestBodyValues:{model:glm-5v-turbo,max_tokens:32000,messages:[...]}}

Note: no thinking field present, despite the variant being selected.

Root cause:
Looking at the opencode config schema (config.json), the variants object per variant only defines a disabled property:

variants: {
  type: object,
  additionalProperties: {
    type: object,
    properties: {
      disabled: { type: boolean }
    }
  }
}

Custom properties like thinking are silently ignored since they are not recognized by the schema.

Built-in providers (OpenAI, Anthropic, Google) work correctly because opencode has hardcoded variant-to-parameter mapping logic for them. Custom providers using @ai-sdk/openai-compatible lack this mapping.

Related issues: #9397 (DeepSeek thinking bug), #25001 (Kimi thinking ignored), #6768 (CoT not retrieved despite thinkmode config). Note: these issues report specific model bugs, whereas this request addresses the systemic schema limitation for all custom providers.

Suggested enhancement:
Allow each variant to carry an options (or body / providerOptions) field that gets merged into the API request body when that variant is selected. Example:

variants: {
  think: {
    options: { thinking: { type: enabled } }
  },
  fast: {
    options: { thinking: { type: disabled } }
  }
}

This would give custom provider users the same variant switching capability that built-in provider users enjoy.

Environment:

  • OS: Windows 11 (Build 26200, 25H2)
  • opencode Desktop: v1.14.50
  • Provider: Zhipu AI (@ai-sdk/openai-compatible)
  • Model: glm-5v-turbo

Activity

  1. github-actions commented on Jul 14, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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