Backport: fix(anthropic): allow both temperature and topP for non-Anthropic models#14056
Merged
Backport: fix(anthropic): allow both temperature and topP for non-Anthropic models#14056
Conversation
…hropic models The temperature/topP mutual exclusivity check was applied to all models using the @ai-sdk/anthropic provider, but providers like Minimax that use the Anthropic-compatible API may require both parameters. - Introduce `isAnthropicModel` derived from `isKnownModel` or `claude-` prefix - Only enforce temperature/topP mutual exclusivity for Anthropic models Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
lgrammel
approved these changes
Apr 2, 2026
Contributor
|
🚀 Published in:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
Port of #14052 to
main.The
@ai-sdk/anthropicprovider enforces temperature/topP mutual exclusivity for all models, matching a constraint in the Anthropic API. However, providers like Minimax use the Anthropic-compatible API endpoint with non-Anthropic models (e.g.MiniMax-M2.7) that require bothtemperatureandtop_pto be set simultaneously.Summary
isAnthropicModelvariable derived fromisKnownModel || modelId.startsWith('claude-')Checklist
pnpm changesetin the project root)Related Issues
Backport of #14052