@ai-sdk/provider 4.0.23 Adds Portable 'max' Reasoning Level
The @ai-sdk/provider library introduces the portable 'max' reasoning level for consistent, advanced model selection across providers, with new compatibility considerations and fallback support.
What changed?
@ai-sdk/provider version 4.0.23 introduces a portable 'max' reasoning level. This change standardizes the maximum available reasoning power across supported language model providers, using internal mappings, compatibility coercions, and fallback logic. Third-party providers and consumers using exhaustive switch statements or 'Record' mappings in TypeScript must explicitly handle the new 'max' value. Compatibility warnings are now returned for some providers when unsupported reasoning levels are requested, and some fallback behaviors have changed.
Why does it matter to an everyday developer?
The ability to specify a portable 'max' reasoning level allows developers to more easily target the best available model behavior across provider backends without vendor-specific configuration. This simplifies advanced use cases that demand maximum reasoning capability. However, developers relying on TypeScript exhaustiveness checks must update their code to accommodate the new 'max' option, or their builds may break. New warning and fallback behaviors may also affect quality and observability in multi-provider scenarios.
What can the developer do now?
Developers should update any exhaustive switch statements or typings that enumerate reasoning levels to handle 'max'. For multi-provider workflows, review how compatibility warnings and new fallback behaviors may affect existing logic, especially for Amazon Bedrock and Fireworks integrations. Test requests using 'reasoning: "max"' and check compatibility warnings in generation and streaming results. For third-party or custom provider implementations, ensure 'max' is correctly mapped or handled before upgrading to this version.
