vercel-labs/gemini-chatbot

Build your own generative UI chatbot using the Vercel AI SDK and Google Gemini

What it solves

Building an AI chatbot from scratch means wiring up model APIs, managing chat history, handling user authentication, and creating a polished interface. This template packages all of that into a working starting point, so developers can skip the boilerplate and focus on customizing their own assistant.

How it works

The app is built on Next.js 14 with the App Router, using React Server Components and Server Actions for fast, server-side rendering. At its core is Vercel's AI SDK, which provides a unified way to generate text, structured objects, and tool calls across multiple LLM providers—Google Gemini is the default model, but you can switch to OpenAI, Anthropic, Cohere, and others with just a few lines of code.

Chat history and user data are stored in Vercel Postgres, file uploads go to Vercel Blob, and user sign-in is handled by NextAuth.js. The UI is assembled with shadcn/ui components styled by Tailwind CSS, with Radix UI primitives for accessibility.

Running locally requires pulling environment variables with the Vercel CLI and installing dependencies with pnpm. Deploying your own copy is a one-click operation on Vercel.

Who it’s for

Developers who want a functional, easy-to-extend AI chatbot without building everything from scratch. It's particularly well-suited for teams already using Vercel's ecosystem, since it integrates cleanly with Vercel Postgres, Blob, and one-click hosting.

Highlights

  • Next.js 14 App Router with React Server Components and Server Actions for performance.
  • AI SDK unified API for text, structured objects, and tool calls across many providers.
  • Default Google Gemini 1.5 Pro, switchable to OpenAI, Anthropic, Cohere, and more with minimal changes.
  • Persistence via Vercel Postgres for chat history and user data, plus Vercel Blob for object storage.
  • Authentication included through NextAuth.js.
  • Styling with shadcn/ui, Tailwind CSS, and Radix UI primitives.
  • One-click deployment to Vercel and simple local setup with the Vercel CLI.

Related

  • Project
  • Project
  • Project
  • Project