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.
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
- SDKs and Abstraction Layers: Provider SDKs vs. the AI SDKModule 1 · LLM Fundamentals for Builders
- Building a Streaming Chat FeatureModule 3 · Building Core AI FeaturesFree
- Generative UI: Rendering Components from Model OutputModule 4 · Structured Outputs & Tool Use
- LLM Gateways and Provider FallbacksModule 6 · Choosing, Routing & Running Models
Related terms
Go from definitions to doing
Learn to build AI-powered apps in 132 practical lessons.