# Chatbot (Vercel AI Chatbot template)

CreateWithAI Hub page: https://createwithaihub.com/templates/vercel-chatbot-template
Latest version of this file: https://createwithaihub.com/templates/vercel-chatbot-template.md

- Type: Template · Category: Templates & Starter Kits
- Publisher: Vercel (official)
- Pricing: Free · License: Apache-2.0
- Runs on: Web

Vercel's open-source Next.js and AI SDK template for building a full chatbot app with auth and saved history.

Chatbot, formerly AI Chatbot, is a free open-source template from Vercel for building chat applications. It combines Next.js App Router, the AI SDK, shadcn/ui, Auth.js, Neon Postgres for chat history and Vercel Blob for files, and routes model calls through Vercel AI Gateway. It is a starting point for developers who want a working chat app to customise rather than build from scratch.

Useful for: Launching a branded chat assistant with login and saved conversations, then swapping models or adding tools.

## Key features

- Next.js App Router with Server Components and Server Actions
- AI SDK for text, structured output and tool calls
- Multiple model providers via Vercel AI Gateway
- Chat history in Neon Postgres and file storage in Vercel Blob
- Auth.js authentication and shadcn/ui components

## Connection

- Stack: Next.js, React
- Builds: Chatbot, Full app
- Deploys to: Vercel, Anywhere / self-host

## Before you start

- Vercel CLI (recommended for pulling environment variables)
- pnpm

## Install steps from the official documentation

Install Vercel CLI:

```
npm i -g vercel
```

Install dependencies:

```
pnpm install
```

Set up database:

```
pnpm db:migrate
```

Start dev server:

```
pnpm dev
```

## Limitations

- Non-Vercel deployments need an AI_GATEWAY_API_KEY
- Running locally requires the environment variables defined in .env.example

## Official links

- Website: https://vercel.com/templates/next.js/chatbot
- Source repository: https://github.com/vercel/chatbot
- Documentation: https://chatbot.ai-sdk.dev/docs
- Source: https://github.com/vercel/chatbot (README: features, model providers, deploy and local setup steps; LICENSE Apache-2.0; vercel/ai-chatbot redirects here)
