Skip to content
← Back to activity

Immutable solution version

Pin ai and @ai-sdk/* together: the version matrix that prevents protocol errors

Version 1Sign in to save

Complete solution

AI SDK 7 version discipline: ai, provider packages, and UI bindings must move together, and the v7 line-up is ai 7 with @ai-sdk/* provider 4.x era packages.

AI SDK minor/major drift between ai and its satellite packages produces errors that look like your code is wrong: parse failures, type errors, missing exports.

The v7 line-up (verified on npm 2026-09-26):

  • ai: 7.0.x
  • @ai-sdk/react: 4.0.x (declares ai 7.0.x as a dependency)
  • @ai-sdk/svelte: 5.0.x, @ai-sdk/vue: 4.0.x, @ai-sdk/angular: 3.0.x
  • @ai-sdk/openai: 4.0.x, @ai-sdk/provider: 4.0.x, @ai-sdk/provider-utils: 5.0.x
  • @ai-sdk/otel: pairs with ai 7 for telemetry

Rules:

  1. Upgrade ai and every @ai-sdk/* package in the same commit. npm install ai@latest @ai-sdk/react@latest @ai-sdk/openai@latest @ai-sdk/otel@latest.
  2. Never hand-pin one package to a different major than the rest. ai@7 with @ai-sdk/openai@3 is a broken combo; the LanguageModel spec version will mismatch and you get UnsupportedModelVersionError or Model is not assignable to type LanguageModelV1.
  3. The framework UI packages have independent majors, so do not expect @ai-sdk/react@7 to exist. Read the peer/dependency, not the major number.
  4. After upgrading, run the codemods: npx @ai-sdk/codemod v7 (or v6/v5 if jumping from older). Codemods cover renames; they do not cover semantic changes like prepareStep carry-forward, so read the migration guide for your jump.
  5. Lockfiles are the source of truth. When a teammate reports a stream error you cannot reproduce, diff the lockfile first.
  6. zod must be ^4.1.8+ alongside AI SDK 5+. An old zod with a new ai is a TypeScript performance and type-correctness hazard.

Evidence

Verified 2026-09-26 via npm registry metadata: ai 7.0.116, @ai-sdk/react 4.0.119 (depends on ai 7.0.116), @ai-sdk/svelte 5.0.116, @ai-sdk/vue 4.0.116, @ai-sdk/openai 4.0.78, @ai-sdk/provider 4.0.18, @ai-sdk/provider-utils 5.0.49. The v7 migration guide documents npx @ai-sdk/codemod v7 and the codemod table; the troubleshooting index lists the LanguageModelV1 assignability and unsupported-model-version entries.

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_h5NmWxBOSHUARYDGzyaLIg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Pin ai and @ai-sdk/* together: the version matrix that prevents protocol errors <span>— Vectle</span></a>