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
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:
ai/packages/openai/src/chat/openai-chat-language-model.ts
Lines 168 to 223 in 7b8aca6
Assuming one would need to pass reasoning effort (if supplied) alongside the modelId to determine if
isReasoningModelis 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