AI SDK
Provider-agnostic TypeScript toolkit for building AI apps and agents with any LLM.
Repository Health
Technical Analysis
The AI SDK is Vercel’s open-source TypeScript toolkit for building AI-powered applications and agents. It provides a single, unified API for text generation, structured output, image/speech/video generation, embeddings, and reranking across dozens of model providers (OpenAI, Anthropic, Google, xAI, and more), so switching providers or models is a one-line change rather than a rewrite.
Beyond the core generation functions, the SDK ships framework-agnostic UI hooks (@ai-sdk/react, @ai-sdk/vue, @ai-sdk/svelte, @ai-sdk/angular) for building chat and generative interfaces, a ToolLoopAgent abstraction for building tool-using agents, and first-class support for streaming, tool calling, and the Model Context Protocol (MCP). It is maintained by the Next.js/Vercel team and used across a large ecosystem of provider and framework integration packages published under the @ai-sdk/* namespace.
What You Get
- Unified
generateText/streamText/generateObjectAPIs that work identically across OpenAI, Anthropic, Google, xAI, Groq, Mistral, and dozens of other providers - A
ToolLoopAgentclass for building tool-calling agents with structured tool definitions, approval flows, and streaming UI message output - Framework-agnostic UI hooks (
@ai-sdk/react,@ai-sdk/vue,@ai-sdk/svelte,@ai-sdk/angular) for wiring chat and generative UI into any frontend - Built-in Model Context Protocol (MCP) client support for connecting agents to external tool servers
- First-class Zod/Valibot schema integration for structured output and typed tool inputs/outputs
- Access to the Vercel AI Gateway by default, or direct provider SDKs installed independently (
@ai-sdk/openai,@ai-sdk/anthropic, etc.)
Common Use Cases
- Building a chatbot or conversational UI with streaming responses in a Next.js, React, Vue, or Svelte app
- Generating structured JSON output (e.g. extracting data, generating recipes/forms) validated against a Zod schema
- Building tool-using agents that call external APIs, run code in a sandbox, or query internal systems
- Swapping between LLM providers (OpenAI, Anthropic, Google) without rewriting application logic
- Adding AI image, speech, or video generation to a product using a consistent API across providers
Under The Hood
Architecture: The repo is a pnpm/Turborepo monorepo with the ai core package (packages/ai/src) built around directory-scoped modules — generate-text, generate-object, generate-image, generate-speech, generate-video, embed, rerank, agent, middleware, registry, ui, ui-message-stream, realtime, and telemetry. Every generation function resolves a caller-supplied model string or instance through model/resolve-model.ts into a versioned LanguageModelV3/V4 (or embedding/image/speech/video equivalent) contract defined in the separate @ai-sdk/provider package, then normalizes provider-specific quirks via adapter functions like as-language-model-v4.ts. This adapter-and-versioned-contract layering is what lets generateText({ model: 'openai/gpt-5.4' }) and generateText({ model: anthropic('claude-opus-4-6') }) share identical downstream logic. The agent/tool-loop-agent.ts module builds a stateful tool-calling loop on top of generate-text, and ui-message-stream bridges that loop to framework hooks (@ai-sdk/react’s useChat) over a typed streaming protocol.
Tech Stack: Pure TypeScript (81% of the codebase) built with tsup, type-checked via tsc --build project references, and tested with Vitest across separate Node and edge-runtime configs (vitest.node.config.js / vitest.edge.config.js) to guarantee edge-runtime compatibility. The workspace uses pnpm workspaces plus Turborepo for task orchestration across ~80 packages, Changesets for versioned releases, and oxlint/ultracite for linting. Zod (with Valibot as an alternative) is a peer dependency used throughout for schema validation of structured output and tool I/O.
Code Quality: The ai package alone has 127 *.test.ts/*.test-d.ts files (colocated with source, including type-level tests via test-d.ts and snapshot tests), covering tool execution, streaming, schema resolution, and error paths explicitly — errors are modeled as typed classes under src/error/ rather than thrown generically. Naming is consistent (generate-*, stream-*, as-*-model-v*) and modules are small and single-purpose, which keeps the large surface area navigable despite the monorepo’s size.
API Design: The public API is deliberately minimal at the entry point — a handful of verbs (generateText, streamText, generateObject, embed, tool) cover the majority of use cases, with provider selection reduced to a model string or a one-line import { anthropic } from '@ai-sdk/anthropic'. Getting started requires only npm install ai plus one provider package; the README’s own quickstart is under 10 lines of code. Consistent naming conventions across sibling functions (generateImage/generateSpeech/generateVideo mirroring generateText) minimize the learning curve for anyone who has used one function in the family.
Used by 581 apps in this directory
Suna
AI Agents
Turn your company into a git repo — one config, one command center, a workforce of AI agents that runs the real work around the clock.
Supabase
Authentication · Databases · Developer Tools
The open-source Postgres development platform that replaces Firebase with authentication, real-time APIs, edge functions, storage, and vector embeddings — all built on PostgreSQL.
Supabase
Authentication · Databases · Developer Tools
The open-source Postgres development platform that replaces Firebase with authentication, real-time APIs, edge functions, storage, and vector embeddings — all built on PostgreSQL.
Supabase
Authentication · Databases · Developer Tools
The open-source Postgres development platform that replaces Firebase with authentication, real-time APIs, edge functions, storage, and vector embeddings — all built on PostgreSQL.
Supabase
Authentication · Databases · Developer Tools
The open-source Postgres development platform that replaces Firebase with authentication, real-time APIs, edge functions, storage, and vector embeddings — all built on PostgreSQL.
Supabase
Authentication · Databases · Developer Tools
The open-source Postgres development platform that replaces Firebase with authentication, real-time APIs, edge functions, storage, and vector embeddings — all built on PostgreSQL.
Supabase
Authentication · Databases · Developer Tools
The open-source Postgres development platform that replaces Firebase with authentication, real-time APIs, edge functions, storage, and vector embeddings — all built on PostgreSQL.
Supabase
Authentication · Databases · Developer Tools
The open-source Postgres development platform that replaces Firebase with authentication, real-time APIs, edge functions, storage, and vector embeddings — all built on PostgreSQL.
superglue
AI Agents · Data Engineering · Developer Tools
superglue is an AI-agent-driven integration engine that turns plain-English descriptions of enterprise systems into production-grade API tools, ERP/CRM connectors, and data pipelines — self-hosted or cloud, Y Combinator-backed (W25).