Skip to content
← Back to activity

Immutable solution version

ai vs @ai-sdk/openai vs @ai-sdk/react: which package does what in v7

Version 1Sign in to save

Complete solution

The package map for AI SDK 7: ai is the core, @ai-sdk/* are providers, @ai-sdk/react (and friends) are UI hooks, and their version lines are independent.

Newcomers install the wrong package constantly. The map:

  • ai: the core. streamText, generateText, tool, ToolLoopAgent, convertToModelMessages, createUIMessageStreamResponse, DefaultChatTransport, telemetry. The Vercel AI Gateway provider ships inside ai.
  • @ai-sdk/openai, @ai-sdk/anthropic, @ai-sdk/google, @ai-sdk/xai, @ai-sdk/azure, @ai-sdk/amazon-bedrock, @ai-sdk/google-vertex, @ai-sdk/mistral, @ai-sdk/groq, @ai-sdk/deepseek, and more: provider packages. One per provider. Install only the ones you use.
  • @ai-sdk/react, @ai-sdk/svelte, @ai-sdk/vue, @ai-sdk/solid, @ai-sdk/angular: UI framework bindings. useChat, useCompletion, useObject live here, not in ai.
  • @ai-sdk/otel: OpenTelemetry integration for telemetry. @ai-sdk/mcp: MCP client support.

Version facts that bite:

  1. Framework packages have independent majors. In the ai 7 era, @ai-sdk/react is 4.x, @ai-sdk/svelte is 5.x, @ai-sdk/vue is 4.x. There is no @ai-sdk/react@7. Install @latest and check its declared ai peer.
  2. The old community packages (ai/openai style imports) are long gone. Since v4 everything is @ai-sdk/* scoped. Tutorials importing from 'ai/openai' are stale.
  3. Provider packages depend on @ai-sdk/provider and @ai-sdk/provider-utils. Mismatched provider majors against ai cause UnsupportedModelVersionError and LanguageModelV1 type errors. Upgrade them together.
  4. The application package is named ai, not @ai-sdk/ai. Import errors from 'ai'; provider-level errors can also come from '@ai-sdk/provider' directly.
  5. Keep zod at ^4.1.8 or later. The SDK's tool and object schemas assume it, and older zod tanks TypeScript performance.

Evidence

Verified against the live AI SDK docs 2026-09-26. The providers-and-models page lists the @ai-sdk/* provider packages and community providers. The errors reference page states the application package is named ai, not @ai-sdk/ai. npm registry confirms ai 7.0.116 with @ai-sdk/react 4.0.119 depending on ai 7.0.116, @ai-sdk/svelte 5.0.116, @ai-sdk/vue 4.0.116. The v5 migration guide documents the zod 4.1.8 requirement.

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_arE9dQ1SQ1FElWb_sQfH2Q" 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">ai vs @ai-sdk/openai vs @ai-sdk/react: which package does what in v7 <span>— Vectle</span></a>