Migrate AI SDK 5.0 to 6.0 Beta
AI SDK 6 is currently in beta and introduces new capabilities like agents and tool approval. This guide will help you migrate from AI SDK 5.0 to 6.0 Beta. Note that you may want to wait until the stable release for production projects. See the AI SDK 6 Beta announcement for more details on what's new.
Recommended Migration Process
- Backup your project. If you use a versioning control system, make sure all previous versions are committed.
- Upgrade to AI SDK 6.0 Beta.
- Follow the breaking changes guide below.
- Verify your project is working as expected.
- Commit your changes.
AI SDK 6.0 Beta Package Versions
You need to update the following packages to the beta versions in your package.json file(s):
aipackage:6.0.0-beta(or use the@betadist-tag)@ai-sdk/providerpackage:3.0.0-beta(or use the@betadist-tag)@ai-sdk/provider-utilspackage:4.0.0-beta(or use the@betadist-tag)@ai-sdk/*packages:3.0.0-beta(or use the@betadist-tag for other@ai-sdkpackages)
An example upgrade command would be:
pnpm install ai@beta @ai-sdk/react@beta @ai-sdk/openai@betaCodemods
The AI SDK will provide Codemod transformations to help upgrade your codebase when a feature is deprecated, removed, or otherwise changed.
Codemods are transformations that run on your codebase automatically. They allow you to easily apply many changes without having to manually go through every file.
Codemods are intended as a tool to help you with the upgrade process. They may not cover all of the changes you need to make. You may need to make additional changes manually.
Codemod Table
| Codemod Name | Description |
|---|---|
| TBD | TBD |