# vercel/chatbot: a Next.js AI chat template you fork, not install

> Vercel's Chatbot is an open source Next.js starter that wires the AI SDK, Auth.js, Drizzle and Neon Postgres into a working chat product. It is a template for developers, not a hosted assistant, and its depth is in the plumbing rather than the prompt box.

**vercel/chatbot** — A full-featured, hackable Next.js AI chatbot built by Vercel

- Repository: https://github.com/vercel/chatbot
- Website: https://chatbot.ai-sdk.dev
- Stars: 20,980 · Forks: 6,751
- Language: TypeScript
- License: NOASSERTION
- Published: 2026-09-14 · Updated: 2026-09-14 · Language: en
- Canonical page: https://hysenlabs.com/projects/vercel-chatbot

## What vercel/chatbot actually gives you

The README calls it a free, open-source template built with Next.js and the AI SDK that helps you quickly build chatbot applications. That word, template, is doing the heavy lifting. This is not a product you point at your documents and hand to a support team. It is a starting repository for a developer who has decided to build a chat interface and would rather not spend the first two weeks on authentication, message persistence and streaming.

The intended user is a TypeScript developer working in the Next.js App Router. The repository is a pnpm workspace with app/, components/, lib/, hooks/ and tests/ directories, a drizzle.config.ts, a playwright.config.ts and a biome.jsonc. Everything a Next.js application needs is present, which means the cost of adopting it is mostly the cost of understanding someone else's structure. If you have never worked with React Server Components or Server Actions, the README points at both as features, and both shape how the chat route is organised.

The value proposition is narrow and real: a chat UI with streaming, a message store, sign-in, file attachments and model selection already assembled. The README does not claim to be more than that, and the repository name changed from AI Chatbot to Chatbot, which suggests Vercel treats it as a flagship example of the AI SDK rather than a standalone product.

## How the stack fits together

Four layers are visible from the README and the repository layout. The front end is Next.js App Router with shadcn/ui components, Tailwind CSS for styling and Radix UI primitives underneath. The model layer is the AI SDK, which the README describes as a unified API for generating text, structured objects and tool calls with LLMs, plus hooks for building dynamic chat interfaces.

Persistence is split in two. Neon Serverless Postgres holds chat history and user data, and Vercel Blob handles file storage. The repository confirms the database side with drizzle.config.ts, a lib/db directory containing a migrate script, and package.json scripts named db:generate, db:migrate, db:studio, db:push, db:pull, db:check and db:up. Drizzle is the ORM, and migrations are plain TypeScript run through tsx rather than a separate migration binary.

Authentication is Auth.js, described in the README as simple and secure authentication. The environment example lists AUTH_SECRET as the only auth variable, with a comment suggesting openssl rand -base64 32 to generate it.

Model routing goes through the Vercel AI Gateway. Models are configured in lib/ai/models.ts with per-model provider routing, and the README names Mistral, Moonshot, DeepSeek, OpenAI and xAI as included. That file is the seam where you change which models appear in the picker.

## Running vercel/chatbot locally and sending a first message

The README recommends the Vercel CLI for environment handling. Install it globally, link the local directory to a Vercel project, then pull the environment variables down. The link step creates a .vercel directory in the project.

```bash
npm i -g vercel
vercel link
vercel env pull
```

After that, the README gives three commands: install dependencies, apply database migrations, start the dev server.

```bash
pnpm install
pnpm db:migrate
pnpm dev
```

The README states the template should then be running on localhost:3000. The migrate step is not optional. It sets up the database or applies the latest changes, and the build script in package.json runs the same migration before next build, so a deployment without a reachable database fails at build time rather than at runtime.

If you are not deploying to Vercel, the README says authentication for the AI Gateway is not automatic. You supply an AI Gateway API key instead. The environment example names the variable AI_GATEWAY_API_KEY and comments that it is required for non-Vercel deployments, since Vercel uses OIDC automatically.

The remaining variables in .env.example are BLOB_READ_WRITE_TOKEN for Vercel Blob, POSTGRES_URL for the database and REDIS_URL for Redis. The README warns against committing the .env file, because the secrets in it control access to your AI and authentication provider accounts. Once the server is up, sign in, pick a model from the list defined in lib/ai/models.ts, and send a message. The first reply is the point at which every layer has to be correct at once.

## The Vercel services assumption is the real constraint

The README is explicit that Vercel deployments get AI Gateway authentication through OIDC tokens automatically, while everything else needs an API key. That is a fair split, but the dependency list runs deeper than the gateway. Vercel Blob and Neon Serverless Postgres are named as the storage layer, and REDIS_URL appears in the environment example. Running this template outside Vercel means assembling equivalent services and rewriting the client code that talks to them.

The README does not document how to swap Vercel Blob for S3 or a local filesystem. It does not describe a Redis-free mode, and it does not say what breaks when Redis is absent. The AI Gateway itself is a routing layer with a cost model that the README does not discuss. If your organisation requires direct provider contracts, the README notes that the AI SDK supports switching to direct providers such as OpenAI, Anthropic and Cohere with a few lines of code, but it does not show those lines, and the per-model routing in lib/ai/models.ts would need to be reworked.

There is also a version constraint worth checking before you start. The package.json pins next at 16 and ai at 7.0.15, with @ai-sdk/react at 4.0.16. Those are recent major versions. If your existing application is on an older Next.js release, this is not a library you add to it. It is a repository you start from or copy out of.

## Where a hosted assistant is the better answer

If your goal is a chatbot that answers questions about your own documents, the shortest path is not this repository. Retrieval over a document set, evaluation of answer quality and an admin surface for non-engineers are all work you would do on top. The README describes chat history, user data and file storage, not retrieval, embeddings or document ingestion. Nothing in the file list suggests a vector store.

A managed assistant product handles ingestion, citation and evaluation for you, at the cost of control over the interface and the model. The trade is straightforward. You give up the ability to edit the prompt path, the message schema and the model picker, and in return you skip the migration script, the auth configuration and the Blob token.

There is a middle case worth naming. If you already run a Next.js application and only need a chat pane inside it, copying the relevant components and the AI SDK route handler out of this repository is more sensible than adopting the whole template. The repository is structured as an application, not as a component library, so extraction is manual work. The README offers no guidance on partial adoption.

## Maintenance, licensing and upgrade cost

The repository is not archived, and the last push was on 2026-07-08. That is roughly two months before the date of this article, so the codebase is being touched, though the absence of any retrieved releases means there is no published version history to read. The package.json version is 3.1.0, and the README notes the project was formerly called AI Chatbot, so the name change is part of the version 3 line.

Upgrade cost concentrates in three places. The ai package is pinned at 7.0.15 and @ai-sdk/react at 4.0.16, both major versions, so AI SDK upgrades will need reading. The database schema is managed through Drizzle migrations in lib/db, and the build script runs them automatically, which means a schema change ships with the deploy rather than as a separate step. The lint and format tooling is ultracite, exposed as pnpm check and pnpm fix, with husky installed through the prepare script.

The licence field is reported as NOASSERTION, which means the repository metadata does not declare a recognised licence identifier. A LICENSE file exists at the top level, so the terms are stated there rather than in package metadata. Read that file before you ship anything derived from this repository, and treat the question as one for whoever handles licensing at your organisation rather than something the README settles.

## Conclusion

Adopt vercel/chatbot if you are a TypeScript developer who wants a working Next.js chat surface with auth, persistence and streaming already wired, and you are willing to run Postgres and Redis alongside it. Skip it if you want a chatbot you can point at a document set and hand to a support team, or if you cannot use Vercel Blob and Neon. Before you commit, run pnpm db:migrate against a throwaway database and confirm that the model list in lib/ai/models.ts matches the providers you actually have keys for.

## FAQ

### Is vercel/chatbot the same as ChatGPT?

No. vercel/chatbot is an open source Next.js template that you deploy yourself, and it routes requests to models including OpenAI, Anthropic and xAI through the Vercel AI Gateway. ChatGPT is a hosted product. The only overlap is that both can send prompts to OpenAI models.

### Can I use vercel/chatbot for free?

The README describes it as a free, open-source template, so the code itself costs nothing. Running it still requires a Postgres database, Vercel Blob storage and, on non-Vercel deployments, an AI_GATEWAY_API_KEY, all of which have their own terms.

### How do I install vercel/chatbot?

The README recommends installing the Vercel CLI, running vercel link and vercel env pull to fetch environment variables, then running pnpm install, pnpm db:migrate and pnpm dev. The template then runs on localhost:3000.

### How do I use vercel/chatbot?

Start the dev server, sign in through the included Auth.js setup, choose a model from the list configured in lib/ai/models.ts, and send a message. Chat history and user data are stored in Neon Serverless Postgres, and file attachments go to Vercel Blob.

### What are the top 3 most popular AI chatbots?

This is not something the vercel/chatbot README or repository files address, so it is out of scope here. The README only names the model providers the template can route to: Mistral, Moonshot, DeepSeek, OpenAI and xAI.

## Sources

- [Issues](https://github.com/vercel/chatbot/issues)
- [Project website](https://chatbot.ai-sdk.dev)
- [README](https://github.com/vercel/chatbot/blob/main/README.md)
- [vercel/chatbot on GitHub](https://github.com/vercel/chatbot)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/vercel-chatbot
