Skip to content

Updated input parameter support for OpenAI 5.1 models when reasoning effort = "None" #10932

Description

@choffer1120

Description

Logprobs, temperature and top-p are controllable parameters on gpt-5.1 when reasoning effort is set to "none". See OpenAI docs here

However, the AI SDK has a blanket rule disabling of these parameters for all reasoning models purely on model name/id:

if (isReasoningModel(this.modelId)) {
// remove unsupported settings for reasoning models
// see https://platform.openai.com/docs/guides/reasoning#limitations
if (baseArgs.temperature != null) {
baseArgs.temperature = undefined;
warnings.push({
type: 'unsupported',
feature: 'temperature',
details: 'temperature is not supported for reasoning models',
});
}
if (baseArgs.top_p != null) {
baseArgs.top_p = undefined;
warnings.push({
type: 'unsupported',
feature: 'topP',
details: 'topP is not supported for reasoning models',
});
}
if (baseArgs.frequency_penalty != null) {
baseArgs.frequency_penalty = undefined;
warnings.push({
type: 'unsupported',
feature: 'frequencyPenalty',
details: 'frequencyPenalty is not supported for reasoning models',
});
}
if (baseArgs.presence_penalty != null) {
baseArgs.presence_penalty = undefined;
warnings.push({
type: 'unsupported',
feature: 'presencePenalty',
details: 'presencePenalty is not supported for reasoning models',
});
}
if (baseArgs.logit_bias != null) {
baseArgs.logit_bias = undefined;
warnings.push({
type: 'other',
message: 'logitBias is not supported for reasoning models',
});
}
if (baseArgs.logprobs != null) {
baseArgs.logprobs = undefined;
warnings.push({
type: 'other',
message: 'logprobs is not supported for reasoning models',
});
}
if (baseArgs.top_logprobs != null) {
baseArgs.top_logprobs = undefined;
warnings.push({
type: 'other',
message: 'topLogprobs is not supported for reasoning models',
});
}

Assuming one would need to pass reasoning effort (if supplied) alongside the modelId to determine if isReasoningModel is true. But would be amazing if these could be opened up on AI SDK, we are heavy logprob users and will have to move back off the AI SDK in order to use 5.1 with no reasoning.

Thanks so much, and happy to take a crack at it if that would be easier 🫡

AI SDK Version

ai: "^5.0"
@ai-sdk/openai: "^2.0"

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai/corecore functions like generateText, streamText, etc. Provider utils, and provider spec.ai/providerrelated to a provider package. Must be assigned together with at least one `provider/*` labelmerged-mainprovider/amazon-bedrockIssues related to the @ai-sdk/amazon-bedrock providersupporttask-identify-issue-type-done

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions