# Chatbot

> Free, open-source Next.js and AI SDK template from Vercel for building customizable AI chatbot applications.

Chatbot (formerly AI Chatbot) is a free, open-source template from Vercel, built with Next.js and the AI SDK, for building chatbot applications without starting from scratch. It includes chat history persistence, authentication, file attachments, and sharing, and can be deployed to Vercel or run locally.

## What It Is

Chatbot is an application template rather than a hosted service. Developers clone or deploy it and then customize the interface, models, and behavior. It uses the Next.js App Router with React Server Components and Server Actions, and the AI SDK provides a unified API for text generation, structured objects, and tool calls, plus hooks for chat and generative user interfaces.

## Features and Customization

The docs list generative user interfaces, custom artifacts for specific workflows, in-browser code execution with text or image output, and multimodal attachments. Users can register and sign in with email and password, and can control the visibility of shared chats. Customization docs cover artifacts, fonts, models and providers, resumable streams, testing, theming, and tool approval.

## Models and Data Layer

The template uses the Vercel AI Gateway to reach multiple models through one interface. Models are configured in lib/ai/models.ts, and the included models are from Mistral, Moonshot, DeepSeek, OpenAI, and xAI. On Vercel, gateway authentication uses OIDC tokens, while other deployments need an AI_GATEWAY_API_KEY. The AI SDK can also switch to direct providers such as OpenAI or Anthropic. Chat history and user data are stored in Neon Serverless Postgres, files in Vercel Blob, and authentication runs through Auth.js. The UI uses shadcn/ui with Tailwind CSS and Radix UI.

## Setup Path

For local use, set the environment variables defined in .env.example, optionally via the Vercel CLI (vercel link and vercel env pull). Then run pnpm install, pnpm db:migrate, and pnpm dev to serve the app on localhost:3000. A one-click Vercel deploy is also available.

## Features
- Next.js App Router with React Server Components and Server Actions
- AI SDK unified API for text, structured objects, and tool calls
- Generative user interfaces
- Custom artifacts
- In-browser code execution
- Multimodal file and image attachments
- Built-in email/password authentication
- Chat sharing with visibility control
- Chat history persistence
- Resumable streams
- Tool approval
- Theming and font customization
- One-click Vercel deployment

## Integrations
Vercel AI Gateway, OpenAI, Anthropic, Google, xAI, Mistral, Moonshot, DeepSeek, Neon Serverless Postgres, Vercel Blob, Auth.js, shadcn/ui, Tailwind CSS, Radix UI

## Platforms
WEB, API, CLI

## Pricing
Open Source

## Links
- Website: https://chatbot.ai-sdk.dev
- Documentation: https://chatbot.ai-sdk.dev/docs
- Repository: https://github.com/vercel/chatbot
- EveryDev.ai: https://www.everydev.ai/tools/vercel-chatbot
