🧬Vercel AI SDK
Also known as AI SDK, AI SDK by Vercel, AI SDK Core
A TypeScript kit for AI apps. One set of calls works with every model.
Think of it like
It is like one key for every door in the house.
Example
Emma builds a chat page in Next.js. streamText sends the reply in small pieces, and a hook on the page shows each piece as it arrives.
Why it matters
Web developers can add a chat that streams, without writing the hard parts. Changing models does not mean a rewrite.
Definition
Example code
typescript
import { streamText } from "ai";
const result = streamText({
model: "anthropic/claude-sonnet-5.5",
messages: [{ role: "user", content: "Hello!" }],
});
for await (const delta of result.textStream) {
process.stdout.write(delta);
}Common mistake
Key takeaways
- 1Core and UI. Calls on the server, hooks on the page.
- 2Any provider. Change one model name.
- 3Built for streaming. Replies show as they arrive.