AI SDK migration guide
Migrate Vercel AI SDK from 4 to 5, 5 to 6, or 6 to 7. Find breaking changes in your TypeScript or JavaScript code and review supported fixes.
What tools help migrate Vercel AI SDK versions?
Emendant finds affected TypeScript and JavaScript code for supported Vercel AI SDK changes and offers possible fixes. It covers the ai 4.x to 5.0, 5.x to 6.0 and 6.x to 7.0 upgrades, plus selected releases listed below. Run npx emendant scan, then review each finding and its release source before changing code. Use the scan guide to read results and coverage warnings. Compare the findings with Vercel's migration guide and codemods; the feed does not cover every migration step or provider package.
Example: rename a provider export in AI SDK 7
In ai 7.0.0, the old experimental_customProvider export is removed. Emendant can detect its import and offer a deterministic rename of the import and its references:
Before the upgrade:
import { experimental_customProvider } from "ai";
const provider = experimental_customProvider({ languageModels: {} });Possible fix for 7.0:
import { customProvider } from "ai";
const provider = customProvider({ languageModels: {} });The Vercel AI SDK 7 migration source confirms this rename. Review the 7.0 coverage and remaining changes. This fixes the export name only; it does not migrate provider implementations. Inspect possible patches with npx emendant fix --dry-run. A preview checks structure but does not install dependencies or run your checks, so run your typecheck and tests against the target dependencies before you apply a patch.
Choose your AI SDK migration path
The ai package is Vercel AI SDK. Start with the release you are moving to. Each guide names the changes Emendant covers, shows code before and after, and states what still needs your review.
- Migrate AI SDK 4.x to 5.0: React and RSC imports move, message types change, and
tool()usesinputSchema. - Migrate AI SDK 5.x to 6.0: old
CoreMessagenames are removed, and agent and tool names change. - Migrate AI SDK 6.x to 7.0: experimental names, call options, stream results, and token usage fields change.
Check your repository before you upgrade
- Check the installed
aiversion in your manifest and lockfile. Read the guide for the target release above. - Run
npx emendant scanin your TypeScript or JavaScript repository. It reports supported changes at affected call sites without editing your files. - Review the findings, then run
npx emendant fix --dry-runto inspect eligible patches. Emendant does not update package versions for you. - After you update dependencies, run your own typecheck and tests. Some migration steps need manual work or a model provider you name.
For a worked example, read one measured AI SDK 6 to 7 migration of a public repository. It gives every command from a pinned commit and feed snapshot, the patch Emendant wrote, the edits it left to the reader, and the changes it did not report.
Emendant reports only changes in its curated feed. A clean scan does not prove that every AI SDK migration step is complete. Read the supported projects guide for the current scope, the fix guide for patch grades, and whether AI-generated migration patches are safe.
Reviewing a dependency update PR? Follow Use Emendant alongside Dependabot to scan affected code, review possible patches, and check the remaining migration work.
AI SDK release pages
- ai 7.x breaking changes: 7.0.14 to 7.0.163
12 releases, 7.0.14 to 7.0.163, released 2 July 2026 to 5 November 2026. 24 breaking, 13 deprecations. - AI SDK 7.0.0: what breaks when you upgrade ai from 6.x
ai 7.0.0, released 25 June 2026. 61 breaking, 17 deprecations. - ai@6.0.312: metadata type changed on TelemetrySettings
ai 6.0.312, released 21 October 2026. 1 breaking, 0 deprecations. - AI SDK 6.0.0: what breaks when you upgrade ai from 5.x
ai 6.0.0, released 22 December 2025. 4 breaking, 2 deprecations. - AI SDK 5.0.0: what breaks when you upgrade ai from 4.x
ai 5.0.0, released 31 July 2025. 19 breaking, 3 deprecations. - AI SDK 4.0: what breaks when the 2.x stream helpers go
ai 4.0.0, released 18 November 2024. 4 breaking, 0 deprecations.
Releases without a page here may still be in the feed. Run emendant feed status to see what your snapshot holds.