Skip to content
/ ai-chatbot Public template
forked from vercel/ai-chatbot

A full-featured, hackable Next.js AI chatbot built by Vercel Labs

License

Notifications You must be signed in to change notification settings

garmeeh/ai-chatbot

 
 

Repository files navigation

Next.js 13 and app template Router-ready AI chatbot.

Next.js AI Chatbot

An open-source AI chatbot app template built with Next.js, the Vercel AI SDK, OpenAI, upstash and Clerk.

Features · Model Providers · Running locally · Credits


Features

  • Next.js App Router
  • React Server Components (RSCs), Suspense, and Server Actions
  • Vercel AI SDK for streaming chat UI
  • Support for OpenAI (default), Anthropic, Hugging Face, or custom AI chat models and/or LangChain
  • Edge runtime-ready
  • shadcn/ui
  • Chat History, rate limiting, and session storage with Upstash
  • Clerk for authentication

Model Providers

This template ships with OpenAI gpt-3.5-turbo as the default. However, thanks to the Vercel AI SDK, you can switch LLM providers to Anthropic, Hugging Face, or using LangChain with just a few lines of code.

upstash

You will need to set up an upstash account and create a Redis Database. Only takes a few clicks!

Remember to update your environment variables (UPSTASH_URL, UPSTASH_KEY) in the .env file with the appropriate credentials provided during the setup process.

Clerk

You will need to set up a Clerk account and create a Clerk application. This also only takes a few clicks!

Remember to update your environment variables (NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY, CLERK_SECRET_KEY) in the .env file with the appropriate credentials provided during the setup process.

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.

Credits

This template is a fork of the main AI Chatbot from the Vercel team and other contributors. It has been modified to use Upstash and Clerk.

View Origanal template

About

A full-featured, hackable Next.js AI chatbot built by Vercel Labs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 95.1%
  • JavaScript 3.6%
  • CSS 1.3%