Lattice
연구를 위한 작업공간
Next.js·TypeScript·Vercel Edge 기반 스트리밍 LLM 채팅 앱, 토큰 단위 스트림·중단 처리·Markdown 렌더링
A streaming LLM chat app built with Next.js, TypeScript and the Vercel Edge runtime. Responses stream token by token with abort handling and Markdown rendering.
생산성TypeScript · JavaScriptGitHub @Yashashviarora가동 상태 재확인 필요운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
아직 감지된 업데이트가 없습니다. GitHub 릴리스가 나오면 여기에 보입니다.
Streaming LLM chat in Next.js 15 + TypeScript — Groq/OpenAI-compatible API, summarise mode, Markdown rendering, Vercel deploy
README 전체를 불러오는 중입니다. 아래는 저장된 발췌입니다.
StreamChat is a minimal chat app that streams answers from an LLM token by token. It is built with the Next.js App Router, TypeScript and Tailwind CSS, talks to any OpenAI-compatible API through the openai SDK, and runs the chat endpoint on the Vercel Edge runtime. Responses can be stopped mid-stream, assistant replies are rendered as Markdown, and the conversation is kept in localStorage so it survives a refresh.
• Next.js App Router
• TypeScript
• Tailwind CSS
• OpenAI-compatible API (Groq by default, via the openai SDK)
• GitHub Actions CI (lint, type-check, build)
• VercelREADME 전문 보기 ↗StreamChat is a minimal chat app that streams answers from an LLM token by token. It is built with the Next.js App Router, TypeScript and Tailwind CSS, talks to any OpenAI-compatible API through the openai SDK, and runs the chat endpoint on the Vercel Edge runtime. Responses can be stopped mid-stream, assistant replies are rendered as Markdown, and the conversation is kept in localStorage so it survives a refresh.
Live: https://streamchat-nextjs.vercel.app
openai SDK)ReadableStream)AbortController)react-markdown)localStorage (survives page refresh)Requires Node.js 20+.
git clone https://github.com/Yashashviarora/streamchat-nextjs.git
cd streamchat-nextjs
npm install
Create .env.local in the project root with the required environment variables:
| Variable | Required | Description |
|---|---|---|
LLM_API_KEY | yes | API key for your LLM provider |
LLM_BASE_URL | yes | Base URL of an OpenAI-compatible API |
LLM_MODEL | yes | Model name to send requests to |
Example (Groq):
LLM_API_KEY=your_key_here
LLM_BASE_URL=https://api.groq.com/openai/v1
LLM_MODEL=openai/gpt-oss-20b
Then start the dev server:
npm run dev
Open http://localhost:3000.
The same checks CI runs on every push:
npm run lint
npx next typegen && npx tsc --noEmit
npm run build
The API route uses the openai SDK, which works with any OpenAI-compatible API. Switch providers by changing env vars only — no code changes:
| Provider | LLM_BASE_URL | LLM_MODEL (example) |
|---|---|---|
| Groq | https://api.groq.com/openai/v1 | openai/gpt-oss-20b |
| OpenAI | https://api.openai.com/v1 | gpt-4o-mini |
Set LLM_API_KEY to the matching provider's key and restart the dev server.
LLM_API_KEY, LLM_BASE_URL, and LLM_MODEL..env.local is never committed; production reads the variables from Vercel's dashboard.