One TypeScript SDK across providers

The Vercel AI SDK is a TypeScript toolkit that gives you one interface to many LLM providers. Instead of learning each vendor’s SDK and rewriting code to switch models, you call generateText or streamText with a model from any provider, and the SDK handles the differences. It adds first-class streaming, tool calling, structured output, and UI hooks like useChat, with framework support across React, Vue, Svelte, and Next.js. At 24,899 stars as of 2026-06 and pushing releases constantly, it is the default way to build LLM features in TypeScript. Its package metadata lists it under the Apache License.

The core value is provider independence with a thin, typed surface, rather than a heavy framework.

What it does

The main functions are small and composable: generateText for a single completion, streamText for streaming, and generateObject for structured, schema-validated output via Zod. Tool calling is built in, so a model can invoke your functions and you get typed results. On the UI side, useChat manages a streaming conversation, and the SDK can render generative UI where a tool result becomes a React component. You add a provider package (@ai-sdk/openai, @ai-sdk/anthropic, and so on) and switch models by changing one argument.

Install

npm install ai
npm install @ai-sdk/openai
import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
const { text } = await generateText({ model: openai('gpt-5'), prompt: 'Hello' });

For UI, add the framework package (@ai-sdk/react and similar). The SDK does not require Vercel hosting or Next.js; the core works in any Node or edge runtime.

Breaking changes between major versions

This is the practical thing to plan for. The SDK moves fast and has shipped breaking changes across major versions, renaming callbacks and reshaping APIs as it matures. An upgrade is rarely a no-op: callback names, agent APIs, and option shapes have changed between releases, and the large open-issue count partly reflects the surface area of supporting many providers through fast-moving versions. Pin your version, read the migration guide before upgrading, and budget time for it, especially if you depend on tool calling or UI hooks where behavior has shifted.

Where it fits, and where it doesn’t

The Vercel AI SDK is the right default when you build LLM features in TypeScript and want to stay provider-flexible, when streaming and tool calling matter, or when you want typed structured output without hand-rolling parsing. It is light, composable, and not locked to Vercel.

Its limits show at the edges. It is an SDK, not a heavy orchestration framework, so complex multi-step agent workflows and elaborate retrieval pipelines are more DIY than in a framework built for that. Provider behavior is not perfectly uniform: tool calling and message handling differ enough between, say, Google and Anthropic that migrating across providers needs testing. And the fast release pace means version churn is part of the cost.

vercel/ai versus the alternatives

Vercel AI SDKper-provider SDKsheavy framework (LangChain.js)
Interfaceone unified APIone per vendorframework abstractions
Provider switchingchange one argumentrewrite per vendorconfigurable, heavier
Streaming and UIfirst-class hooksvariesavailable, less direct
Weightlight SDKlight per vendorheavy
Best forprovider-flexible TS appsone fixed vendorcomplex orchestration

Counts where shown are from GitHub as of June 2026. Using a single vendor’s SDK is simplest if you will never switch providers. A heavy framework like LangChain.js offers deeper abstractions for complex agent and retrieval pipelines, at the cost of weight. The Vercel AI SDK sits in between: provider-flexible and light, which is why it became the common default for TypeScript LLM apps.

The star curve

The star curve rose steadily with the wave of TypeScript LLM apps, helped by tight Next.js integration and the appeal of writing once and swapping models freely. The constant release cadence reflects a tool under heavy active development rather than a finished one.

What the issue tracker warns you about

The recurring themes follow from supporting many providers fast. Tool calling and message handling differ across providers, so behavior that works on one can break on another, particularly around how messages are merged and how tool results are serialized. Streaming and UI hooks have had stability issues in edge cases like overlapping resumes. Structured-output validation with Zod has hit provider-specific snags. And the version churn means upgrades carry breaking changes. The large open-issue count is less a red flag than a reflection of the SDK’s breadth and pace.

For the React chat UI that pairs with this SDK, see assistant-ui. For the agents and apps you would build with it, see cline and OpenHands. For memory to add to those agents, see Mem0. For what is trending, see LLM tooling, the daily digest, and the weekly report.

FAQ

What is the Vercel AI SDK? A TypeScript toolkit that gives you one interface to many LLM providers, with streaming, tool calling, structured output, and UI hooks. You write once and switch models by changing a single argument, instead of learning each vendor’s SDK.

Can I use the Vercel AI SDK without Vercel or Next.js? Yes. The core ai package works in any Node or edge runtime and does not require Vercel hosting. The React hooks need React but not Next.js; only some server-component features are Next.js-specific.

Vercel AI SDK vs LangChain, which should I use? The Vercel AI SDK is a light, provider-flexible SDK, ideal for building LLM features quickly in TypeScript. LangChain offers heavier abstractions for complex agent and retrieval orchestration. Use the AI SDK for most app features, a heavier framework when you need deep orchestration.

Are upgrades between versions safe? Not automatically. The SDK has shipped breaking changes across major versions, renaming callbacks and reshaping APIs. Pin your version and read the migration guide before upgrading, especially if you rely on tool calling or UI hooks.

Does tool calling behave the same across providers? Not exactly. Message merging and tool-result handling differ between providers, so a tool setup that works with one can need adjustment for another. Test tool calling when you switch providers.