AI SDK
The AI SDK is the TypeScript toolkit designed to help developers build AI-powered applications with React, Next.js, Vue, Svelte, Node.js, and more.
Why use the AI SDK?
Integrating large language models (LLMs) into applications is complicated and heavily dependent on the specific model provider you use.
- AI SDK Core: A unified API for generating text, structured objects, and tool calls with LLMs.
- AI SDK UI: A set of framework-agnostic hooks for quickly building chat and generative user interface.
Model Providers
The AI SDK supports multiple model providers.
OpenAI
Image InputObject GenerationTool UsageTool Streaming
Azure
Image InputObject GenerationTool UsageTool Streaming
Anthropic
Image InputObject GenerationTool UsageTool Streaming
Amazon Bedrock
Image InputObject GenerationTool UsageTool Streaming
Google Generative AI
Image InputObject GenerationTool UsageTool Streaming
Google Vertex AI
Image InputObject GenerationTool UsageTool Streaming
Mistral
Image InputObject GenerationTool UsageTool Streaming
Groq
Object GenerationTool UsageTool Streaming
Perplexity
Object GenerationTool UsageTool Streaming
Fireworks
Object GenerationTool UsageTool Streaming
Cohere
Templates
We've built some templates that include AI SDK integrations for different use cases, providers, and frameworks. You can use these templates to get started with your AI-powered application.
Starter Kits
Chatbot Starter Template
Uses the AI SDK and Next.js. Features persistence, multi-modal chat, and more.
Internal Knowledge Base (RAG)
Uses AI SDK Language Model Middleware for RAG and enforcing guardrails.
Multi-Modal Chat
Uses Next.js and AI SDK useChat hook for multi-modal message chat interface.
Semantic Image Search
An AI semantic image search app template built with Next.js, AI SDK, and Postgres.
Natural Language PostgreSQL
Query PostgreSQL using natural language with AI SDK and GPT-4o.
Feature Exploration
Feature Flags Example
AI SDK with Next.js, Feature Flags, and Edge Config for dynamic model switching.
Chatbot with Telemetry
AI SDK chatbot with OpenTelemetry support.
Structured Object Streaming
Uses AI SDK useObject hook to stream structured object generation.
Multi-Step Tools
Uses AI SDK streamText function to handle multiple tool steps automatically.
Frameworks
Next.js OpenAI Starter
Uses OpenAI GPT-4, AI SDK, and Next.js.
Nuxt OpenAI Starter
Uses OpenAI GPT-4, AI SDK, and Nuxt.js.
SvelteKit OpenAI Starter
Uses OpenAI GPT-4, AI SDK, and SvelteKit.
Solid OpenAI Starter
Uses OpenAI GPT-4, AI SDK, and Solid.
Generative UI
Gemini Chatbot
Uses Google Gemini, AI SDK, and Next.js.
Generative UI with RSC (experimental)
Uses Next.js, AI SDK, and streamUI to create generative UIs with React Server Components.
Security
Bot Protection
Uses Kasada, OpenAI GPT-4, AI SDK, and Next.js.
Rate Limiting
Uses Vercel KV, OpenAI GPT-4, AI SDK, and Next.js.
Join our Community
If you have questions about anything related to the AI SDK, you're always welcome to ask our community on GitHub Discussions.