Skip to content

Latest commit

 

History

History
54 lines (35 loc) · 1.55 KB

File metadata and controls

54 lines (35 loc) · 1.55 KB

Generative UI with Google Gemini

An open-source AI chatbot app template built with Next.js, the Vercel AI SDK, Google Gemini, and Vercel KV.

Features

  • Next.js App Router
  • React Server Components (RSCs), Suspense, and Server Actions
  • Vercel AI SDK for streaming chat UI
  • Google Gemini as the default chat model
  • shadcn/ui for reusable components
  • Chat History, rate limiting, and session storage with Vercel KV
  • Dark mode support
  • NextAuth.js for authentication

Running Locally

To run the Next.js AI Chatbot locally, follow these steps:

  1. Install dependencies:
pnpm install
  1. Set up your environment variables:

Create a .env.local file in the root directory of the project with the following variables:

# Get your Google Gemini API Key from: https://ai.google.dev/aistudio
GOOGLE_GENERATIVE_AI_API_KEY=XXXXXXXX

# Instructions to create KV database: https://vercel.com/docs/storage/vercel-kv/quickstart
KV_URL=XXXXXXXX
KV_REST_API_URL=XXXXXXXX
KV_REST_API_TOKEN=XXXXXXXX
KV_REST_API_READ_ONLY_TOKEN=XXXXXXXX

  1. Start the development server:
pnpm i
pnpm dev

Your app should now be running on localhost:3000.

This repository is inspired from the repository template with an additional dark mode UI feature . For more information about the Vercel AI SDK, visit the official documentation.