A simple chat playground that keeps messages in memory and responds via a demo API endpoint. Swap the API route with your LLM provider to go live.
cd chat-bot
npm install
npm run dev
# visit http://localhost:3000- UI:
src/app/page.tsx - Styles:
src/app/globals.css - API stub:
src/app/api/chat/route.ts(replace with your model call)
- Create
.env.localand setOPENAI_API_KEY=your-real-key. - Start the app with
npm run dev(the API route now calls OpenAI). - Optional: change the model in
src/app/api/chat/route.ts(default isgpt-4o-mini). - For streaming, return a
ReadableStreamand update the UI to read it.
This project is ready for Vercel:
npm run lint # optional, before deployingPush to GitHub and import into Vercel, or run vercel if you have the CLI installed.