Skip to content
47% off: the complete course for $79 (reg. $149)Order now →
AI Builder

AI builder glossary

AI SDK

Vercel's open-source TypeScript toolkit that gives many model providers one API for text, streaming, tools, and structured output, plus React UI hooks.

The AI SDK, from Vercel, wraps different model providers behind a common interface. You call functions like generateText or streamText with a model object from a provider package, and instructions, messages, tools, and structured output use the same shape regardless of which provider is underneath. Switching providers for common features becomes a small code change.

Its other big draw is UI integration. The useChat hook in the React package consumes a streamed response from your server and manages message state, streaming updates, and tool-call rendering on the client, which is why it is popular for chat and generative UI in Next.js apps.

The trade-off is the mirror image of a provider SDK. A provider's own SDK exposes every feature as soon as it ships and matches its documentation exactly. An abstraction has to normalize differences, which can hide details or lag behind new capabilities. The AI SDK offers provider-specific options as an escape hatch, but you should still read what is actually sent.

Many teams use both: the AI SDK for streaming chat and UI, and a provider SDK for features where they need full control, like batch processing.

Example

A Next.js app uses the AI SDK's streaming helper in a route handler and the useChat hook in its chat panel, while its nightly ticket-summarization job calls the provider SDK's batch API directly.

Learn more in the course

Related terms

Go from definitions to doing

Learn to build AI-powered apps in 132 practical lessons.