Overview
Vercel AI Chatbot (formerly AI Chatbot) is a free, open-source template built with Next.js and the AI SDK. It gives you a working chatbot application out of the box, so you can start from a complete project instead of wiring up the chat UI, routing, and model calls yourself.
It's aimed at developers who want to ship an AI chat app on Next.js. The template uses the App Router with React Server Components, shadcn/ui components styled with Tailwind CSS, Auth.js for sign-in, Neon Serverless Postgres for chat history, and Vercel Blob for file storage.
As a chat UI starter, it routes across multiple models through the Vercel AI Gateway, with per-model routing configured in lib/ai/models.ts. You can also switch to direct LLM providers such as OpenAI, Anthropic, or Cohere with a few lines of code.
What it does
- Built on Next.js App Router with React Server Components and Server Actions
- Uses the AI SDK for text, structured objects, tool calls, and chat hooks
- Multi-model routing via the Vercel AI Gateway, configured in lib/ai/models.ts
- shadcn/ui components with Tailwind CSS and Radix UI primitives
- Chat history and user data stored in Neon Serverless Postgres; files in Vercel Blob
- Authentication handled by Auth.js
Getting started
You can deploy your own copy to Vercel with one click, or run it locally with the Vercel CLI to pull environment variables. The steps below follow the README's local setup.
Install the Vercel CLI and link your project
Install the CLI globally, link the local instance to your Vercel and GitHub accounts, then pull the environment variables defined in .env.example.
npm i -g vercel
vercel link
vercel env pullInstall dependencies, migrate the database, and run
Install packages, apply the latest database changes, and start the dev server. The app runs on localhost:3000.
pnpm install
pnpm db:migrate
pnpm devConfigure model access (non-Vercel deployments)
On Vercel, AI Gateway auth is automatic via OIDC tokens. Elsewhere, set an AI Gateway API key in your .env.local file.
AI_GATEWAY_API_KEY=your_key_hereCommands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Bootstrapping a production-style AI chat app on Next.js without building the UI, routing, and persistence from scratch
- Prototyping with several models behind one interface by configuring per-model routing in lib/ai/models.ts
- Adding saved chat history and authenticated user accounts to a chatbot using Postgres and Auth.js
- Starting point for a custom assistant that you later point at a direct provider like OpenAI or Anthropic
How Vercel AI Chatbot compares
Vercel AI Chatbot alongside other open-source chat uis tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| Open WebUI | ★ 142k | A self-hosted web interface for chatting with local and API-based LLMs (Ollama, OpenAI-compatible) that adds RAG, web search, image generation, and multi-user access. |
| Lobe Chat | ★ 78.9k | An open-source chat UI with a plugin and agent marketplace, multi-model support, voice, vision, and one-click self-hosting. |
| AnythingLLM | ★ 61.8k | A desktop and self-hosted chat app focused on document Q&A and agents, letting you build private RAG workspaces over your own files and data sources. |
| Cherry Studio | ★ 47.5k | A cross-platform desktop chat client that connects to many cloud and local model providers and ships with hundreds of preset assistants and MCP support. |
| Chatbox | ★ 40.6k | A desktop and web chat client for ChatGPT, Claude, Gemini, Ollama, and other models, with local message storage and multi-provider switching. |
| LibreChat | ★ 39.5k | A self-hostable ChatGPT-style chat app that unifies many AI providers and adds agents, MCP support, artifacts, a code interpreter, and multi-user authentication. |
| Onyx | ★ 30.4k | Onyx is a self-hostable AI chat platform that adds RAG, web search, custom agents, code execution, and deep research on top of any major LLM provider. |
| Vercel AI Chatbot | ★ 20.5k | Open-source Next.js starter for building full-featured AI chatbots with the AI SDK |