← all repositories
vercel/ai

Vercel's AI SDK: one API, every model, actual UI glue

A TypeScript toolkit that swaps LLM providers without rewriting your app—and streams generative UI into React, Vue, or Svelte components.

25.7k stars TypeScript Language ModelsCoding Assistants
ai
Velocity · 7d
+22
★ / day
Trend
steady
star history

What it does The AI SDK is a provider-agnostic TypeScript library for building AI apps and agents. It wraps OpenAI, Anthropic, Google, and others behind a single generateText call, then pipes the results into framework-specific UI hooks so your chatbot doesn’t end up as a raw console.log.

The interesting bit The “generative UI” angle is the real hook. The SDK doesn’t just stream text; it streams typed tool invocations that your React (or Vue/Svelte) components render in real time—think “Generating image…” switching to a base64 <img> when the model finishes. That’s a lot of orchestration hidden behind a useChat hook.

Key highlights

  • Swap providers by changing a string ('anthropic/claude-opus-4.6''openai/gpt-5.4') or install per-provider packages for direct access
  • Structured output via Zod schemas, not regex prayer
  • ToolLoopAgent class for autonomous agents with tool use (shell access, image generation, etc.)
  • Framework-agnostic UI hooks with per-framework packages (@ai-sdk/react, etc.)
  • Ships with Vercel AI Gateway by default; BYO provider keys if you prefer

Caveats

  • Requires Node.js 22+, which is aggressive if you’re on LTS inertia
  • The agent examples lean heavily on Vercel Sandbox and OpenAI tools—portability of those specific tools is unclear
  • “Provider-agnostic” still means you trust Vercel’s gateway or manage N separate SDK packages

Verdict Worth a look if you’re building chat UIs in TypeScript and don’t want to rewrite your data layer every time a new model drops. Skip it if you’re all-in on Python or your AI needs are limited to a single cron job calling one API.

Frequently asked

What is vercel/ai?
A TypeScript toolkit that swaps LLM providers without rewriting your app—and streams generative UI into React, Vue, or Svelte components.
Is ai open source?
Yes — vercel/ai is an open-source project tracked on heatdrop.
What language is ai written in?
vercel/ai is primarily written in TypeScript.
How popular is ai?
vercel/ai has 25.7k stars on GitHub and is currently holding steady.
Where can I find ai?
vercel/ai is on GitHub at https://github.com/vercel/ai.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.