No description
Find a file
2024-11-06 15:21:28 +03:00
ai Add canvas interface (#461) 2024-10-30 16:01:24 +05:30
app Use predicted outputs for doc edits (#495) 2024-11-06 03:28:49 +03:00
components Add thinking placeholder message (#496) 2024-11-06 15:21:28 +03:00
db Remove connected rows when removing chat (#490) 2024-11-05 19:39:50 +03:00
hooks Start on new sidebar (#456) 2024-10-24 13:35:51 -07:00
lib Add message actions (#482) 2024-11-05 17:15:51 +03:00
public Refactor to use hooks (#436) 2024-10-11 18:00:22 +05:30
.env.example Tweak .env.example (#453) 2024-10-23 09:31:03 -07:00
.eslintrc.json Refactor to use hooks (#436) 2024-10-11 18:00:22 +05:30
.gitignore Start updating deps 2023-11-26 12:07:13 -06:00
components.json Use default shadcn styles and tweak prompt (#439) 2024-10-11 23:36:51 +05:30
drizzle.config.ts Refactor to use hooks (#436) 2024-10-11 18:00:22 +05:30
LICENSE Clean up deps 2024-08-24 23:23:37 -05:00
middleware.ts Refactor to use hooks (#436) 2024-10-11 18:00:22 +05:30
next-env.d.ts Refactor to use hooks (#436) 2024-10-11 18:00:22 +05:30
next.config.ts Persist input text in local storage (#472) 2024-10-31 21:02:05 +05:30
package.json Use predicted outputs for doc edits (#495) 2024-11-06 03:28:49 +03:00
pnpm-lock.yaml Use predicted outputs for doc edits (#495) 2024-11-06 03:28:49 +03:00
postcss.config.mjs Refactor to use hooks (#436) 2024-10-11 18:00:22 +05:30
prettier.config.cjs Start on new sidebar (#456) 2024-10-24 13:35:51 -07:00
README.md Refactor to use hooks (#436) 2024-10-11 18:00:22 +05:30
tailwind.config.ts Use geist icons and group history by ranges (#471) 2024-10-31 15:39:07 +05:30
tsconfig.json Start on new sidebar (#456) 2024-10-24 13:35:51 -07:00

Next.js 14 and App Router-ready AI chatbot.

Next.js AI Chatbot

An Open-Source AI Chatbot Template Built With Next.js and the AI SDK by Vercel.

Features · Model Providers · Deploy Your Own · Running locally


Features

  • Next.js App Router
    • Advanced routing for seamless navigation and performance
    • React Server Components (RSCs) and Server Actions for server-side rendering and increased performance
  • AI SDK
    • Unified API for generating text, structured objects, and tool calls with LLMs
    • Hooks for building dynamic chat and generative user interfaces
    • Supports OpenAI (default), Anthropic, Cohere, and other model providers
  • shadcn/ui
  • Data Persistence
  • NextAuth.js
    • Simple and secure authentication

Model Providers

This template ships with OpenAI gpt-4o as the default. However, with the AI SDK, you can switch LLM providers to OpenAI, Anthropic, Cohere, and many more with just a few lines of code.

Deploy Your Own

You can deploy your own version of the Next.js AI 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 Next.js AI 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 OpenAI 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 dev

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