chatbot README

The project's README from github.com/vercel/chatbot. As one markdown file: README.md.

Chatbot

Chatbot

Chatbot (formerly AI Chatbot) is a free, open-source template built with Next.js and the AI SDK that helps you quickly build powerful chatbot applications.

Read Docs · Features · Model Providers · Deploy Your Own · Running locally


Features

Model Providers

This template uses the Vercel AI Gateway to access multiple AI models through a unified interface. Models are configured in lib/ai/models.ts with per-model provider routing. Included models: Mistral, Moonshot, DeepSeek, OpenAI, and xAI.

AI Gateway Authentication

For Vercel deployments: Authentication is handled automatically via OIDC tokens.

For non-Vercel deployments: You need to provide an AI Gateway API key by setting the AI_GATEWAY_API_KEY environment variable in your .env.local file.

With the AI SDK, you can also switch to direct LLM providers like OpenAI, Anthropic, Cohere, and many more with just a few lines of code.

Deploy Your Own

You can deploy your own version of Chatbot to Vercel with one click:

Deploy with Vercel

Running locally

You will need to use the environment variables defined in .env.example to run Chatbot. It's recommended you use Vercel Environment Variables for this, but a .env file is all that is necessary.

Note: You should not commit your .env file or it will expose secrets that will allow others to control access to your various AI and authentication provider accounts.

  1. Install Vercel CLI: npm i -g vercel
  2. Link local instance with Vercel and GitHub accounts (creates .vercel directory): vercel link
  3. Download your environment variables: vercel env pull
pnpm install
pnpm db:migrate # Setup database or apply latest database changes
pnpm dev

Your app template should now be running on localhost:3000.

chatbot (vercel/chatbot)

Searching Database…

What is this?An open-source AI chatbot template built by Vercel with Next.js and the AI SDK, meant as a starting point for building your own chatbot applications.
So it's a working chatbot app, or more of a code starting point?It's a hackable template: a complete, runnable chatbot app (chat UI, auth, chat history, file storage) that you deploy and customize, not a hosted finished product.
How do I get it running locally?Install the Vercel CLI (npm i -g vercel), run vercel link, then vercel env pull to download your environment variables — after that the app runs on localhost:3000.
Do I need my own API key for the AI models?Deployed on Vercel, AI Gateway authentication is automatic via OIDC tokens. Running anywhere else, you must set the AI_GATEWAY_API_KEY variable in .env.local yourself.
Any setup pitfalls I should know about?You must fill in the environment variables from .env.example, and never commit your .env file — it exposes secrets that let others control your AI and authentication accounts.
Is there a one-click way to deploy it?Yes — the Deploy Your Own section lets you deploy your own copy of Chatbot to Vercel with one click.
Can I use providers beyond the ones on the AI Gateway?Yes — with just a few lines of code you can switch the AI SDK to direct LLM providers like OpenAI, Anthropic, or Cohere.
What is the interface built with?shadcn/ui components styled with Tailwind CSS, using Radix UI primitives underneath for accessibility and flexibility.
Creator
vercel
Size
6.2 MB
Stars
21K
Updated
CommitJul 08
Age
3y
Commits · 90 Days