Lightweight AI chat powered by Google Gemini, resumable streaming, and secure authentication.
Features · Model Providers · Deploy · Run Locally
- Next.js 16 App Router with shared layouts and SWR-powered history.
- Vercel AI SDK +
resumable-streamfor smooth, reconnectable responses. - Google Gemini tools: search, URL context, and code execution.
- Inline regenerate/edit, citations, reasoning trace, and copy actions.
- Attachment uploads via Vercel Blob (images & PDFs up to 5 MB).
- Better Auth with Google OAuth and Redis-backed session caching.
- User customization (name, traits, preferences) and visual settings.
- Chat history export/backup with full message data.
- Gemini 2.5 Pro, Flash, and Flash Lite configured in
src/ai/config.ts. - Reasoning output (
thinking) and tool calls ship enabled by default. - Swap IDs or extend the list to adopt future Gemini releases.
- Provision PostgreSQL, Redis, and Vercel Blob storage.
- Create Google OAuth credentials and allow your production callback URL.
- Copy
.env.exampleto.envand set all required values. - Deploy with Vercel or your preferred Next.js host.
pnpm install
cp .env.example .envRequired environment variables:
| Variable | Description |
|---|---|
DATABASE_URL |
PostgreSQL connection string for Drizzle ORM. |
BETTER_AUTH_SECRET |
Secret for signing sessions (generate with openssl rand -base64 32). |
BETTER_AUTH_URL |
Base URL for auth callbacks (e.g., http://localhost:3000). |
GOOGLE_CLIENT_ID |
Google OAuth client ID. |
GOOGLE_CLIENT_SECRET |
Google OAuth client secret. |
GOOGLE_GENERATIVE_AI_API_KEY |
API key for Gemini models. |
CHAT_REDIS_URL |
Redis connection for sessions and stream state. |
BLOB_READ_WRITE_TOKEN |
Vercel Blob token for file uploads. |
pnpm db:generate # optional, sync SQL
pnpm db:migrate # apply migrations
pnpm devVisit http://localhost:3000, sign in with Google, and start chatting.
Useful scripts: pnpm build, pnpm start, pnpm lint, pnpm db:studio.