Esta página se muestra en inglés. Una traducción al español está en curso.
SkillsApr 6, 2026·2 min de lectura

Next.js AI Chatbot — Vercel Reference App Template

Production-ready AI chatbot template by Vercel using Next.js, AI SDK, shadcn/ui, and Auth.js. Supports Claude, GPT-4, and Gemini. Streaming, tool use, file uploads, and conversation history. 8,000+ stars.

Introducción

Next.js AI Chatbot is Vercel's official reference application for building production AI chatbots with 8,000+ GitHub stars. Built with Next.js App Router, Vercel AI SDK, shadcn/ui, and Auth.js, it includes streaming responses, tool use, file uploads, conversation history with PostgreSQL, and multi-model support (Claude, GPT-4, Gemini). This is the exact template Vercel uses internally and recommends for production deployments. Best for developers who want a battle-tested starting point for AI chat applications. Works with: Claude, GPT-4, Gemini. Setup time: under 5 minutes.


What You Get

Full-Stack Features

  • Streaming chat with real-time token display
  • Multi-model switching (Claude, GPT-4, Gemini)
  • Conversation history saved to PostgreSQL
  • User authentication (Auth.js with GitHub/Google)
  • File upload and processing
  • Tool use (web search, code execution)
  • Mobile-responsive UI with dark mode

Tech Stack

Layer Technology
Framework Next.js 14 (App Router)
AI Vercel AI SDK
UI shadcn/ui + Tailwind CSS
Auth Auth.js (NextAuth v5)
Database PostgreSQL (Drizzle ORM)
Hosting Vercel (one-click deploy)

Vercel AI SDK Integration

import { streamText } from "ai";
import { anthropic } from "@ai-sdk/anthropic";

export async function POST(req: Request) {
  const { messages } = await req.json();

  const result = streamText({
    model: anthropic("claude-sonnet-4-20250514"),
    messages,
    tools: {
      getWeather: {
        description: "Get weather for a location",
        parameters: z.object({ city: z.string() }),
        execute: async ({ city }) => getWeather(city),
      },
    },
  });

  return result.toDataStreamResponse();
}

One-Click Deploy

Deploy with Vercel

Customization Points

app/
├── (chat)/           # Chat pages
│   ├── page.tsx      # Main chat interface
│   └── layout.tsx    # Chat layout with sidebar
├── api/chat/         # AI API routes
│   └── route.ts      # Streaming endpoint
├── components/       # UI components
│   ├── chat.tsx      # Chat container
│   ├── message.tsx   # Message bubble
│   └── toolbar.tsx   # Input toolbar
└── lib/
    ├── ai/           # Model configuration
    └── db/           # Database schema

Key Stats

  • 8,000+ GitHub stars
  • Official Vercel reference app
  • Streaming + tool use + file upload
  • Auth + conversation history
  • One-click Vercel deploy

FAQ

Q: What is Next.js AI Chatbot? A: Vercel's official production-ready template for AI chatbots, built with Next.js, AI SDK, shadcn/ui, and PostgreSQL — including streaming, auth, and conversation history.

Q: Is it free? A: Yes, open-source under MIT. Hosting on Vercel free tier works for personal use.

Q: Can I change the AI model? A: Yes, swap anthropic(...) for openai(...) or google(...) — one line change.


🙏

Fuente y agradecimientos

Created by Vercel. Licensed under MIT.

ai-chatbot — ⭐ 8,000+

Thanks to Vercel for the definitive AI chatbot starting point.

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.