General
AI
Overview
Learn about the built-in AI features powered by the Vercel AI SDK.
The Pro Next.js Drizzle starter kit includes powerful AI features powered by the Vercel AI SDK and OpenAI.
Chatbot
Build AI-powered chatbots with streaming responses.
Prompting
Learn how to use LLMs for text generation and prompting.
Architecture
The AI system is built with a hybrid architecture to support high-performance streaming while maintaining a type-safe tRPC API for CRUD operations.
| Feature | Technology | Reason |
|---|---|---|
| Streaming responses | API Route | tRPC doesn't support streaming |
| Chat CRUD | tRPC | Type-safe, cached queries |
| State management | Vercel AI SDK | useChat hook handles streaming |
Configuration
Add your OpenAI API key to the .env file to enable the AI features.
.env
OPENAI_API_KEY=sk-...Getting Your API Key Create an API key at
OpenAI Platform
. Make sure to keep it secure and never commit it to version control.
Supported Providers
The Vercel AI SDK supports multiple providers:
- OpenAI - GPT-4, GPT-3.5 and more
- Anthropic - Claude models
- Google - Gemini models
- Mistral - Mistral models
- And many more...
See the Vercel AI SDK documentation for a complete list of supported providers.