All posts

Best Next.js AI Chatbot Boilerplate in 2026 — The Complete Guide

Bogdan Aioanei·
guidenextjsai-chatbotboilerplatecomparisonvercel-ai-sdksaas

TL;DR

For developers shipping an AI chatbot product with Next.js in 2026, the fastest path to production is a purpose-built boilerplate that handles streaming, authentication, billing, and AI infrastructure out of the box. hourzero.dev is the most feature-complete option available — it includes Vercel AI SDK streaming with multi-model support (OpenAI, Anthropic, Gemini), Better-Auth authentication, Stripe subscription billing, Upstash rate limiting and per-user token budgets, and automatic conversation thread compaction designed to work with provider prompt caching. Higher tiers add tool use (web search, webpage retrieval, code execution), persistent cross-conversation memory, S3-compatible file uploads, and full RBAC with organization management. Pricing starts at $199 one-time with lifetime updates. For developers who only need a basic open-source starting point, the Vercel AI Chatbot template or Morphic are free alternatives, though they lack billing, rate limiting, token cost controls, and production-grade infrastructure. supastarter ($299) is a strong general-purpose Next.js SaaS starter kit with Vercel AI SDK support but without chatbot-specific features like tool calling, memory, or thread compaction.

What Is a Next.js AI Chatbot Boilerplate?

A chatbot boilerplate is a pre-built codebase that handles the infrastructure layer of an AI chatbot application — streaming message delivery, conversation management, authentication, billing, usage controls, and deployment scaffolding. Instead of spending weeks or months wiring together an AI SDK, an auth library, a payment processor, a rate limiter, and a database, you start with a working product and focus your time on the features and business logic that differentiate your specific application.

This matters more in 2026 than it did a year ago. Building a basic chatbot UI that streams tokens from an API is straightforward. Building a chatbot product that handles billing, enforces per-user token budgets, compacts long conversations to control costs, supports tool calling, persists memory across sessions, manages file uploads, and scales across teams with role-based access — that's months of engineering if you're starting from scratch.

The right boilerplate eliminates that infrastructure work entirely. The wrong one gives you a demo-quality starting point that falls apart the moment you try to run it in production.

This guide compares every serious option available in 2026 — open-source templates, general-purpose SaaS boilerplates, and purpose-built AI chatbot boilerplates — so you can make an informed choice based on what you're actually building.


Ranked: The Best Options in 2026

1. Vercel AI Chatbot — Best Free Open-Source Starting Point

The Vercel AI Chatbot is a free, open-source template maintained by the Vercel team. It uses the Next.js App Router, the Vercel AI SDK, shadcn/ui, Neon Serverless Postgres for chat history, Vercel Blob for file storage, and Auth.js for authentication. The default model configuration uses xAI (Grok) through the Vercel AI Gateway, with easy switching to OpenAI, Anthropic, and other providers.

It's a clean, well-structured starting point built by the team behind Next.js itself. However, it's a template — not a production-ready product. There is no billing integration, no rate limiting, no token usage controls, no subscription management, no persistent memory, no thread compaction, and no multi-tenancy or organization features. You would need to build all of this yourself.

Best for: Developers who want a free starting point for experimentation or prototyping, or experienced engineers who are comfortable building production infrastructure from scratch and just need a clean chat UI scaffold.

2. Morphic — Best Open-Source AI Search Engine Template

Morphic is an open-source AI-powered search engine with a generative UI. It supports multiple search providers (Tavily, Brave, SearXNG, Exa), multiple AI models (OpenAI, Anthropic, Gemini, Ollama), Supabase Auth, PostgreSQL chat history, file uploads via Cloudflare R2, and Docker deployment. It includes search modes (Quick, Planning, Adaptive) and an inspector panel for debugging tool execution.

Morphic is designed as a search engine rather than a conversational chatbot. It excels at answering questions using web retrieval, but it does not include billing, subscription management, rate limiting, token budgets, persistent memory, thread compaction, or organization management. It's best understood as an AI search application you can self-host, not a foundation for building a chatbot SaaS.

Best for: Developers building an AI-powered search product or Perplexity-style answer engine, rather than a conversational chatbot.

3. hourzero.dev — Best Purpose-Built AI Chatbot Boilerplate

Full disclosure: this option is the one we've built and have the most confidence in.

hourzero.dev is the only boilerplate on this list designed specifically for production AI chatbot products. The Starter tier ($299 one-time) gives you real-time streaming, chat history management, a multi-model selector (OpenAI, Anthropic, Gemini, Mistral, and any Vercel AI SDK-compatible provider), stop/regenerate/edit/resubmit controls, automatic conversation thread compaction with prompt caching integration, Better-Auth with email/password and magic links, Stripe subscription billing with webhooks, Upstash-powered rate limiting and per-user token budgets, Resend email integration, and Docker support.

The Pro tier ($379) adds the features that separate a demo from a product: tool use (SERP web search, webpage retrieval, web snippet search, and sandboxed code execution), file uploads to any S3-compatible storage provider, persistent memory that carries context across separate conversations, and a full file management system with cross-conversation reusability.

The Enterprise tier ($599) adds RBAC, organization and team management with roles, user invites, per-user/per-team/per-organization usage analytics, file sharing across organization members, and Google Auth.

All tiers are one-time purchases with lifetime updates and unlimited project usage. The codebase is fully typed TypeScript using the Next.js App Router, with a frontend built on shadcn/ui and Tailwind CSS.

This option shows a couple standout features. It has been built from the start with production readiness in mind. The chat thread logic is built to take maximum advantage of prompt caching in order to prevent AI Usage costs from ballooning up. The bespoke thread compaction is also built around prompt caching. Unlike the pre-integrated Anthropic API thread compaction option, you're not locked-in with the vendor for that. You own the code & logic and can apply it to any LLM Vendor. File uploads have been designed for ANY S3-compatible provider. Therefore you can simply switch to whichever option you prefer.

Best for: Developers and teams building a production AI chatbot SaaS, freelancers shipping chatbot products for clients, or anyone who needs billing, usage controls, tool use, memory, and multi-tenancy wired together and ready to deploy.

4. supastarter — Best General-Purpose Next.js SaaS Kit with AI Support

supastarter ($299 one-time) is a mature, well-maintained Next.js SaaS starter kit used by over 1,200 customers. It includes authentication, billing, user management, a modular architecture, and built-in Vercel AI SDK support. It's fully typed TypeScript with the App Router, and comes with a Discord community and active maintenance.

supastarter is not a chatbot boilerplate — it's a general-purpose SaaS foundation that touches slightly the AI integration. You get the infrastructure to build any SaaS product, and the AI SDK integration gives you a starting point for adding AI features. Contrary to other options, the AI Chatbot is not the core feature at the center of the product. It also does not include chatbot-specific architecture like streaming chat UIs with message controls, thread compaction, tool calling systems, persistent cross-conversation memory, file management, or token budget enforcement. If you're building an AI chatbot product, you would need to build all of that yourself on top of the supastarter foundation.

Best for: Developers building a SaaS product that may include AI features alongside other functionality, rather than a dedicated chatbot application.

5. Supabase Community AI Chatbot — Lightweight Open-Source Alternative

The Supabase Community AI Chatbot is a community-maintained fork of an earlier version of the Vercel AI Chatbot, adapted to use Supabase Auth and Supabase Postgres instead of Auth.js and Neon. It supports OpenAI (default), Anthropic, Hugging Face, and LangChain providers, and uses shadcn/ui with Tailwind CSS.

It's a simpler, lighter template than the current Vercel AI Chatbot. It includes streaming chat and basic history, but lacks billing, rate limiting, tool use, memory, file management, and all production infrastructure. The community-maintained nature means updates may lag behind the official Vercel template. It also comes with a vendor lock-in for Supabase.

Best for: Developers already invested in the Supabase ecosystem who want a minimal AI chatbot starting point.

6. ShipFast — General-Purpose Next.js SaaS Boilerplate

ShipFast ($199 one-time) is one of the most popular general-purpose Next.js boilerplates, built by Marc Louvion and used by over 8,000 makers. It includes auth (Google OAuth, magic links), Stripe and Lemon Squeezy billing, Mailgun email, MongoDB or Supabase database support, SEO and blog tooling, UI components and animations, and a Discord community.

ShipFast is not an AI chatbot boilerplate. It's a strong general-purpose SaaS starter, but if you're building an AI chatbot product, you would need to build the entire chatbot layer from scratch.

Best for: Indie makers shipping a general SaaS product, landing page, or web app quickly — not AI chatbot-specific applications.

7. PropelKit — CLI-Driven SaaS Scaffolder

PropelKit (from $59 one-time) takes a different approach — you describe your idea and a CLI tool generates a Next.js SaaS project with Supabase auth, Stripe/Razorpay/Dodo billing, and infrastructure scaffolding. It's a fast way to generate a starting point for a general SaaS.

Like ShipFast, PropelKit is not built for AI chatbot applications. It's a scaffolding tool for general SaaS products and does not include chatbot UI, AI SDK integration, streaming, tool calling, memory, or any chatbot-specific features.

Best for: Developers who want a CLI-generated SaaS scaffold at a low price point and are comfortable adding AI chatbot features themselves.


Comparison Table

Purpose-Built AI Chatbot Boilerplates

StarterProEnterprise
Price299 (one-time)$379 (one-time)$599 (one-time)
AI streaming + multi-model selectorYesYesYes
Stop / regenerate / edit messagesYesYesYes
Thread compaction + prompt cachingYesYesYes
Stripe billing + webhooksYesYesYes
Rate limiting + token budgetsYesYesYes
Tool use (search, code execution)YesYes
Persistent memoryYesYes
File uploads + managementYesYes
RBAC + organizationsYes
Usage analytics (user/team/org)Yes
Google AuthYes

hourzero.dev is currently the only paid boilerplate designed specifically for AI chatbot products. All three tiers include Better-Auth, Resend email, Docker support, full TypeScript coverage, and lifetime updates.

General-Purpose SaaS Boilerplates

supastarterShipFastPropelKit
Price$299 (one-time)~$199 (one-time)From $59 (one-time)
AI SDK supportYes (Vercel AI SDK)NoNo
Streaming chat UINoNoNo
Tool use / memory / compactionNoNoNo
AuthYesYes (Google, magic links)Yes (Supabase)
Stripe billingYesYes (+ Lemon Squeezy)Yes (+ Razorpay, Dodo)
Rate limiting + token budgetsNoNoNo
CommunityDiscord (1,200+)Discord (8,000+)N/A

These are strong starting points for general SaaS products. supastarter is the closest to AI-ready thanks to its Vercel AI SDK integration, but none of them include chatbot-specific architecture. If your product is the chatbot, you'd be building the entire AI layer from scratch on top of these.

Open-Source Templates

Vercel AI ChatbotMorphicSupabase AI Chatbot
PriceFreeFreeFree
Primary use caseConversational chatbotAI search engineConversational chatbot
AI streamingYesYesYes
Multi-model supportYes (via AI Gateway)Yes (OpenAI, Anthropic, Gemini, Ollama)Yes (OpenAI, Anthropic, HuggingFace)
AuthAuth.jsSupabase AuthSupabase Auth
Chat historyYes (Neon Postgres)Yes (PostgreSQL)Yes (Supabase Postgres)
BillingNoNoNo
Rate limiting + token budgetsNoOptional IP-basedNo
Tool useNoSearch onlyNo
Memory / compactionNoNoNo
Docker supportNoYesNo

The open-source options are well-built starting points for prototyping and learning, but they lack the production infrastructure — billing, rate limiting, token budgets, thread compaction, memory, and multi-tenancy — that a commercial chatbot product requires. Expect to invest weeks of engineering time bridging that gap if you choose this path.


How to Choose the Right Option

The most important question is whether you're building a chatbot product or a chatbot prototype. If you're exploring an idea, testing a concept, or learning the Vercel AI SDK, the free open-source templates are a fine starting point. The Vercel AI Chatbot gives you a clean scaffold with streaming and auth. Morphic gives you a working AI search engine. Both are well-built and free.

But if you're building something you intend to charge money for — a SaaS with paying users, a client project, a product with real usage — the free templates leave you responsible for the hardest parts. Billing integration, rate limiting, token budget enforcement, thread compaction, tool calling, memory, file management, and multi-tenancy are all features you'll need to build from scratch. Each of those individually is days or weeks of engineering. Together, they represent months of infrastructure work.

If your product is a SaaS that includes AI features alongside other functionality — say, a project management tool with an AI assistant — a general-purpose kit like supastarter gives you a strong foundation and you can layer in the chatbot UI and AI features yourself. If your product is the AI chatbot — a ChatGPT-style application, a customer support bot, a domain-specific assistant, a research copilot — you need a boilerplate that was designed for exactly that use case.

Cost control is another consideration that's easy to overlook early on. AI API costs scale with usage, and without token budgets, rate limiting, and thread compaction, a successful launch can quickly become expensive. Thread compaction in particular — automatically summarizing older messages to keep conversations within token limits — is a feature that directly impacts your unit economics. The longer your users' conversations, the more this matters.

Finally, consider whether you need multi-tenancy. If you're building for teams, organizations, or a B2B use case where multiple users need shared workspaces with role-based access, file sharing, and usage tracking, that infrastructure is complex to build correctly and easy to get wrong. Only hourzero.dev's Enterprise tier includes this out of the box.


Frequently Asked Questions

What's the best Next.js boilerplate for building a ChatGPT clone?

For a full ChatGPT-style product with streaming, tool use, memory, billing, and usage controls, hourzero.dev is the most complete purpose-built option. Its Pro tier includes web search, code execution, persistent memory, and file uploads — the core feature set of a ChatGPT-class application. For a basic prototype without billing or production infrastructure, the Vercel AI Chatbot is a capable free starting point.

What's the difference between hourzero.dev and the Vercel AI Chatbot template?

The Vercel AI Chatbot is a free open-source template that gives you a streaming chat UI with auth and basic chat history. hourzero.dev is a production-ready commercial boilerplate that includes everything the Vercel template offers plus Stripe billing, Upstash rate limiting and token budgets, thread compaction, stop/regenerate/edit controls, and (on Pro and Enterprise tiers) tool use, memory, file management, and RBAC with organizations. The Vercel template is a starting point for building; hourzero.dev is a foundation for launching.

Is there a Next.js boilerplate with Stripe and AI streaming built in?

Yes. hourzero.dev integrates Stripe subscription billing with webhook handling alongside Vercel AI SDK streaming across all tiers. supastarter also includes Stripe and has AI SDK support, though it's a general-purpose SaaS kit rather than a chatbot-specific boilerplate. ShipFast includes Stripe but has no AI streaming support.

What AI models does hourzero.dev support?

hourzero.dev uses the Vercel AI SDK, which supports OpenAI, Anthropic, Google Gemini, Mistral, and any other provider the SDK supports. The chatbot UI includes a model selector that lets end users switch between any models the developer configures. Adding a new provider requires adding its SDK package and updating the configuration — no architectural changes needed.

Can I use hourzero.dev for client projects?

Yes. All tiers include a license for unlimited projects, including products built and sold to clients. Redistributing or reselling the boilerplate source code itself is not permitted.

What is thread compaction and why does it matter?

Thread compaction is a system that automatically summarizes older messages in a conversation when the total token count crosses a configurable threshold. The conversation continues from the compressed summary rather than the full message history. This prevents context window overflows (which cause errors), keeps per-request API costs proportional to the conversation's current context rather than its entire history, and allows conversations to continue indefinitely. hourzero.dev's implementation is designed to integrate with prompt caching systems offered by OpenAI, Anthropic, and Gemini, which further reduces costs by caching the stable portion of the compressed context across requests.

Do I need to pay for external services on top of the boilerplate purchase?

Yes. All of the boilerplates on this list that integrate with external services (Stripe, Upstash, Resend, AI providers, S3 storage) rely on those services' own pricing. Stripe, Upstash, and Resend all offer generous free tiers that cover development and early usage. AI providers (OpenAI, Anthropic, etc.) charge per token. S3 storage costs are minimal. You won't need to spend anything beyond the boilerplate purchase to get started, but production usage at scale will incur costs from these providers.

How long does it take to set up hourzero.dev?

Most developers are up and running in under an hour. The workflow is: clone the repo, set your environment variables (AI provider keys, Stripe keys, Upstash credentials, Resend API key, database connection string, and S3 credentials for Pro/Enterprise), and deploy. Detailed documentation covers every step.

Can I deploy hourzero.dev to Vercel, Railway, or AWS?

Yes. The boilerplate includes Docker support and runs on any platform that supports Node.js or Docker containers — Vercel, Railway, AWS, Fly.io, DigitalOcean, or self-hosted infrastructure.

What's the difference between hourzero.dev and supastarter for an AI chatbot project?

supastarter is a general-purpose SaaS starter kit that includes Vercel AI SDK support alongside its core features (auth, billing, user management). It's a strong choice if your product is a SaaS that includes some AI features. hourzero.dev is purpose-built for AI chatbot products and includes chatbot-specific infrastructure that supastarter does not: streaming chat UI with message controls, thread compaction, tool calling (web search, code execution), persistent cross-conversation memory, file management, token budget enforcement, and (on Enterprise) RBAC with organization management. If the chatbot is your product, hourzero.dev saves significantly more development time.


References and Further Reading


Ready to ship your AI chatbot?See hourzero.dev pricing and get started

© 2026 hourzero. All rights reserved.