Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Open-source AI chatbot template built with Next.js, the Vercel AI SDK, and Google Gemini.
The Next.js Gemini Chatbot is an open-source AI chatbot template from Vercel Labs that combines the Vercel AI SDK with Google Gemini models on a Next.js App Router foundation. It takes a Google Generative AI API key and optional authentication secrets as input and produces a deployable chat application with streaming responses, generative UI, and persistent chat history. The template runs on Next.js 14 and can be deployed to Vercel with a single click or run locally with pnpm dev.
The Next.js Gemini Chatbot is a GitHub template built by Vercel Labs that scaffolds a production-ready AI chat application using the Vercel AI SDK and Google Gemini gemini-1.5-pro as the default model. It accepts an API key and environment variables, then outputs a full chat interface with React Server Components, Server Actions, and NextAuth authentication. The template is officially maintained by Vercel Labs in the vercel-labs/gemini-chatbot repository, which has 1,347 stars on GitHub.
vercel env pull, then start with pnpm install and pnpm dev on localhost:3000.Deployment is one-click via Vercel's clone flow, which prompts for the AUTH_SECRET and GOOGLE_GENERATIVE_AI_API_KEY environment variables and provisions a Postgres database and Blob storage. For local development, the README instructs you to link your project with vercel link, download secrets with vercel env pull, then run pnpm install and pnpm dev. The app then connects to Gemini through the AI SDK, stores conversations in Postgres, and uses NextAuth for authentication.
Yes, the template uses Google Gemini models by default, so you need a GOOGLE_GENERATIVE_AI_API_KEY. You can also switch to OpenAI, Anthropic, or Cohere by changing the provider in the AI SDK configuration.
The template is designed to use Vercel Postgres for chat history. If you omit the database, the chat will still function but history persistence and user data storage will not work.
The template itself is open-source and free, but you pay for any API usage (Google Gemini, OpenAI, etc.) and for Vercel storage and serverless functions if you exceed free plan limits.
