Skip to content

smarkm/AILearnTools

Repository files navigation

AILearnTools

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/

Features

  • 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.

Product model

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.

Tech stack

  • Next.js 15, React 19, TypeScript
  • PostgreSQL + Prisma + Auth.js (Google / GitHub OAuth)
  • react-markdown, remark-gfm, rehype-highlight

Quick start (local dev)

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 dev

Open http://localhost:3000

Generate AUTH_SECRET:

make gen-secret

OAuth 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).

Self-host with Docker Compose

Runs Postgres + the Next.js app:

cp .env.example .env
# Set AUTH_SECRET and OAuth credentials in .env

docker compose up --build

App: http://localhost:3000

On 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). Use npm run db:migrate or make db-migrate instead.

Using BYO models

Ollama

  • Base URL: http://localhost:11434 (or your Ollama host)
  • Model: e.g. qwen2.5:7b

OpenAI-compatible

  • 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.

API routes

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

Project layout

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

Environment variables

See .env.example:

  • AUTH_SECRET, AUTH_URL
  • DATABASE_URL
  • AUTH_GOOGLE_ID / AUTH_GOOGLE_SECRET
  • AUTH_GITHUB_ID / AUTH_GITHUB_SECRET

License

MIT

About

Compare the llm capability for your self use

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

 
 
 

Contributors

Languages