A professional coding assistant powered by Groq, with token-by-token streaming responses, task-mode buttons (Generate / Debug / Review / Refactor / Explain), a Monaco code editor for context, and per-browser conversation history. Built to deploy to Vercel in one click.
- Push this folder to your own GitHub repo
- Click:
β "Import Git Repository"
- In the Environment Variables step, add:
GROQ_API_KEYβ your key from https://console.groq.com/keysGROQ_MODELβllama-3.3-70b-versatile(default)
- Click Deploy. Done.
npm i -g vercel
vercel login
vercel # follow prompts
vercel env add GROQ_API_KEY production
vercel env add GROQ_MODEL production
vercel --prodnpm install
cp .env.example .env.local # paste your Groq API key
npm run dev # http://localhost:3000- Streaming responses β token-by-token output via Server-Sent Events; feels instant on Groq
- Stop button β abort a generation mid-stream; partial answer is preserved
- 5 task modes β Generate, Debug, Review, Refactor, Explain (each tunes the prompt)
- Monaco editor β attach code as context with a real VS-Code-style editor
- Syntax highlighting + copy β every code block in responses
- Per-browser history β sessions stored in
localStorage, sidebar to switch - Server-side API key β Groq key never reaches the browser
| Name | Required | Default | Description |
|---|---|---|---|
GROQ_API_KEY |
β | β | Get from https://console.groq.com/keys |
GROQ_MODEL |
β | llama-3.3-70b-versatile |
Any Groq-hosted model |
web-nextjs/
βββ app/
β βββ api/chat/route.ts # Streaming Groq endpoint (SSE)
β βββ layout.tsx
β βββ page.tsx # UI (sidebar + modes + editor + chat)
β βββ globals.css
βββ components/ # Sidebar, CodeEditor, CodeBlock, Markdown
βββ lib/ # persona.ts, storage.ts
βββ vercel.json # Vercel build config (maxDuration=60s)
βββ .env.example
βββ package.json
Set GROQ_MODEL in Vercel env vars (or .env.local):
| Model | Notes |
|---|---|
llama-3.3-70b-versatile |
Default β best general/coding quality |
llama-3.1-8b-instant |
Fastest |
deepseek-r1-distill-llama-70b |
Reasoning-heavy |
mixtral-8x7b-32768 |
32k context |
Full list: https://console.groq.com/docs/models
/api/chatcallsgroq.chat.completions.create({ stream: true })- Server emits Server-Sent Events:
meta,delta,error,done - Client reads the stream with
ReadableStream.getReader()and renders tokens live with Markdown + syntax highlighting
MIT