Capability · Framework — orchestration

Vercel AI SDK

The Vercel AI SDK is the de-facto TypeScript toolkit for building LLM apps, especially on the web. It gives you one API for `generateText`, `streamText`, `generateObject`, and `streamObject` that works across providers, plus React hooks (`useChat`, `useCompletion`) for drop-in chat UIs and an agent framework with tool use. Most TypeScript-first AI apps (including many open-source templates on Vercel) use it as their backbone.

Framework facts

Category
orchestration
Language
TypeScript
License
Apache 2.0
Repository
https://github.com/vercel/ai

Install

npm install ai @ai-sdk/anthropic zod

Quickstart

import { anthropic } from '@ai-sdk/anthropic';
import { generateObject } from 'ai';
import { z } from 'zod';

const { object } = await generateObject({
  model: anthropic('claude-opus-4-7'),
  schema: z.object({
    recipe: z.object({ name: z.string(), ingredients: z.array(z.string()) })
  }),
  prompt: 'Generate a lasagna recipe.'
});

Alternatives

  • LangChain JS — more framework-heavy
  • LlamaIndex TS — RAG-focused
  • Mastra — TypeScript agent framework
  • Genkit — Google's alternative

Frequently asked questions

Vercel AI SDK or LangChain JS?

For most TypeScript app developers, Vercel AI SDK is simpler and better documented. LangChain JS wins when you need its agent abstractions, retrievers, or ecosystem of loaders. Many teams use AI SDK for the app layer and LangChain JS where they need its primitives.

Do I need to deploy on Vercel?

No — the SDK is fully open-source and runs on Node, Bun, Deno, Cloudflare Workers, or any JS runtime. Vercel maintains it but you can use it anywhere.

Sources

  1. Vercel AI SDK — docs — accessed 2026-04-20
  2. Vercel AI on GitHub — accessed 2026-04-20