Open-source Prompt Lab for side-by-side LLM comparison. Bring your own models (BYO) via Ollama or OpenAI-compatible APIs — no platform-hosted models.
Optional Cloud tier adds synced Tests, Model Sets, and share links on the hosted SaaS. Self-hosting is fully supported. https://ailearntools.freecoop.net/
- Compare up to 6 model panes in one workspace (guest: 4 panes).
- Configure Ollama or OpenAI-compatible endpoints per pane.
- API keys stay in the browser (never uploaded to the server).
- Prompt Principal reference panel (vendor guidance + prompt frameworks).
- Bilingual UI (
中文 / EN) and light/dark theme. - Cloud sync (when signed in): saved Tests, Model Sets, official templates, share links.
| Mode | Models | Cloud sync |
|---|---|---|
| Self-host / guest | BYO only | Local browser storage |
| Cloud Basic (free account) | BYO only | 15 Tests, 3 Model Sets |
| Cloud paid | BYO only | 50 Tests, 10 Model Sets, more shares |
See docs/product-strategy.md for the full strategy.
- Next.js 15, React 19, TypeScript
- PostgreSQL + Prisma + Auth.js (Google / GitHub OAuth)
react-markdown,remark-gfm,rehype-highlight
cp .env.example .env
# Edit .env — set AUTH_SECRET, DATABASE_URL, and at least one OAuth provider
npm install
make db-up # Postgres in Docker
npm run db:migrate # apply Prisma migrations
npm run devGenerate AUTH_SECRET:
make gen-secretOAuth callback URLs (local):
- Google:
http://localhost:3000/api/auth/callback/google - GitHub:
http://localhost:3000/api/auth/callback/github
For OAuth debugging with a public URL, use make dev (starts ngrok + Next.js).
Runs Postgres + the Next.js app:
cp .env.example .env
# Set AUTH_SECRET and OAuth credentials in .env
docker compose up --buildOn first boot, a one-shot migrate service runs prisma migrate deploy (with full Prisma 6 CLI deps), then the app starts.
Note: This project uses Prisma 6. Do not run bare
npx prisma(it may install Prisma 7 and fail). Usenpm run db:migrateormake db-migrateinstead.
- Base URL:
http://localhost:11434(or your Ollama host) - Model: e.g.
qwen2.5:7b
- Base URL: e.g.
https://api.openai.com/v1 - Model: e.g.
gpt-4.1-mini - API key: required (stored locally in the browser)
Works with OpenRouter, Together, local vLLM, etc. — any OpenAI-compatible /chat/completions endpoint.
| Route | Description |
|---|---|
GET /api/health |
Health check |
GET /api/models |
Model metadata (builtin is always empty — BYO only) |
POST /api/prompt-lab/run-one |
Run one configured custom model |
app/ Next.js App Router (pages + API)
components/ Prompt Lab UI, Settings, auth
lib/ Plans, pane config, model templates, content limits
prisma/ Schema and migrations
docs/ Product strategy, membership plan, dev setup
See .env.example:
AUTH_SECRET,AUTH_URLDATABASE_URLAUTH_GOOGLE_ID/AUTH_GOOGLE_SECRETAUTH_GITHUB_ID/AUTH_GITHUB_SECRET