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.

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.

FeatureTechnologyReason
Streaming responsesAPI RoutetRPC doesn't support streaming
Chat CRUDtRPCType-safe, cached queries
State managementVercel AI SDKuseChat hook handles streaming

Configuration

Add your OpenAI API key to the .env file to enable the AI features.

.env
OPENAI_API_KEY=sk-...

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.