Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 0 additions & 74 deletions .github/workflows/playwright.yml

This file was deleted.

76 changes: 50 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
<a href="https://chatbot.ai-sdk.dev/demo">
<a href="https://chat.devdocify.com">
<img alt="Chatbot" src="app/(chat)/opengraph-image.png">
<h1 align="center">Chatbot</h1>
<h1 align="center">chat.devdocify.com</h1>
</a>

<p align="center">
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.
An AI chatbot built with Next.js, the Vercel AI SDK, and Claude. Part of the <a href="https://www.devdocify.com">DevDocify</a> portfolio.
</p>

<p align="center">
<a href="https://chatbot.ai-sdk.dev/docs"><strong>Read Docs</strong></a> ·
<a href="https://chat.devdocify.com"><strong>Live demo</strong></a> ·
<a href="#features"><strong>Features</strong></a> ·
<a href="#model-providers"><strong>Model Providers</strong></a> ·
<a href="#deploy-your-own"><strong>Deploy Your Own</strong></a> ·
<a href="#model-providers"><strong>Model providers</strong></a> ·
<a href="#running-locally"><strong>Running locally</strong></a>
</p>
<br/>
Expand All @@ -24,48 +23,73 @@
- [AI SDK](https://ai-sdk.dev/docs/introduction)
- Unified API for generating text, structured objects, and tool calls with LLMs
- Hooks for building dynamic chat and generative user interfaces
- Supports OpenAI, Anthropic, Google, xAI, and other model providers via AI Gateway
- [shadcn/ui](https://ui.shadcn.com)
- Styling with [Tailwind CSS](https://tailwindcss.com)
- Component primitives from [Radix UI](https://radix-ui.com) for accessibility and flexibility
- Data Persistence
- Data persistence
- [Neon Serverless Postgres](https://vercel.com/marketplace/neon) for saving chat history and user data
- [Vercel Blob](https://vercel.com/storage/blob) for efficient file storage
- [Auth.js](https://authjs.dev)
- Simple and secure authentication

## Model Providers
## Model providers

This template uses the [Vercel AI Gateway](https://vercel.com/docs/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.
Models are configured in `lib/ai/models.ts`. This deployment uses [Anthropic](https://anthropic.com) directly via `@ai-sdk/anthropic`:

### AI Gateway Authentication
| Model | ID | Use |
|---|---|---|
| Claude Sonnet | `claude-sonnet-4-6` | Default chat model |
| Claude Opus | `claude-opus-4-6` | Complex tasks |
| Claude Haiku | `claude-haiku-4-5-20251001` | Title generation, fast tasks |

**For Vercel deployments**: Authentication is handled automatically via OIDC tokens.
## Running locally

**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.
### Prerequisites

With the [AI SDK](https://ai-sdk.dev/docs/introduction), you can also switch to direct LLM providers like [OpenAI](https://openai.com), [Anthropic](https://anthropic.com), [Cohere](https://cohere.com/), and [many more](https://ai-sdk.dev/providers/ai-sdk-providers) with just a few lines of code.
- Node.js 20+
- [pnpm](https://pnpm.io)
- [Vercel CLI](https://vercel.com/docs/cli): `npm i -g vercel`

## Deploy Your Own
### Setup

You can deploy your own version of Chatbot to Vercel with one click:
1. Clone the repo and install dependencies:

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/templates/next.js/chatbot)
```bash
git clone https://github.com/matthewrgourd/chat-devdocify.git
cd chat-devdocify
pnpm install
```

## Running locally
2. Link to the Vercel project and pull environment variables:

You will need to use the environment variables [defined in `.env.example`](.env.example) to run Chatbot. It's recommended you use [Vercel Environment Variables](https://vercel.com/docs/projects/environment-variables) for this, but a `.env` file is all that is necessary.
```bash
vercel link
vercel env pull
```

> 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.
This creates a `.env.local` file with all required variables including `AUTH_SECRET`, `ANTHROPIC_API_KEY`, and `POSTGRES_URL`.

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`
3. Run database migrations:

```bash
pnpm db:migrate
```

4. Start the dev server:

```bash
pnpm install
pnpm db:migrate # Setup database or apply latest database changes
pnpm dev
```

Your app template should now be running on [localhost:3000](http://localhost:3000).
The app runs at [localhost:3000](http://localhost:3000).

### Required environment variables

| Variable | Description |
|---|---|
| `AUTH_SECRET` | Random secret for Auth.js session signing |
| `ANTHROPIC_API_KEY` | API key from [console.anthropic.com](https://console.anthropic.com) |
| `POSTGRES_URL` | Neon Postgres connection string (auto-added by Vercel) |
| `BLOB_READ_WRITE_TOKEN` | Vercel Blob token (auto-added by Vercel) |

> Never commit `.env.local` -- it's in `.gitignore`.
3 changes: 2 additions & 1 deletion biome.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"noExplicitAny": "off",
"noUnknownAtRules": "off",
"noConsole": "off",
"noBitwiseOperators": "off"
"noBitwiseOperators": "off",
"noSkippedTests": "off"
},
"style": {
"noMagicNumbers": "off",
Expand Down
100 changes: 0 additions & 100 deletions playwright.config.ts

This file was deleted.

95 changes: 0 additions & 95 deletions tests/e2e/api.test.ts

This file was deleted.

Loading
Loading