A ChatGPT-style web app with multi-model support. Pick any model when starting a chat, or run one prompt against multiple models and compare outputs side by side.
- Next.js 16 (App Router)
- Vercel AI SDK (
ai,@ai-sdk/react) with direct providers: OpenAI, Anthropic, Google (Gemini) - Drizzle + Postgres for chat and compare persistence
- Install dependencies:
pnpm install - Copy
.env.exampleto.env.localand set:OPENAI_API_KEYANTHROPIC_API_KEYGOOGLE_GENERATIVE_AI_API_KEYDATABASE_URL(Postgres connection string)
- Push schema:
pnpm db:push(or run migrations) - Run dev:
pnpm dev
- Single-model chat: New chat → choose provider/model → conversation with persistence.
- Compare mode: One prompt → 2–4 models → parallel streamed outputs in columns.
- Persistent compare branches: Each model column is a branch; you can “Continue this branch” with a follow-up prompt.
- Promote: Turn a compare response into a new chat (Start chat from this).
- Project:
molten-super-chat(linked viarailway linkin this directory). - Service:
web. SetDATABASE_URLand the three AI API keys as service variables (or use Railway Postgres and${{Postgres.DATABASE_URL}}). - Deploy on push: The
webservice is configured to build fromhttps://github.com/switch-dimension/molten-super-chaton themainbranch. Ensure your Railway workspace is connected to GitHub (dashboard → project/workspace settings) so pushes tomaintrigger automatic deploys. - Domain: Generate or view the default
*.railway.appdomain in the service’s Networking settings. Custom domain:railway domain <your-domain.com> --service web. - Migrations: Before or after first deploy, run schema against the deployment DB:
DATABASE_URL='<url>' pnpm db:push(or your migrate command). Use the sameDATABASE_URLas configured on Railway.
pnpm dev– development serverpnpm build/pnpm start– productionpnpm db:generate– generate Drizzle migrationspnpm db:push– push schema to DB (no migrations)pnpm db:migrate– run migrations