A CodeSignal learning project that teaches how to evaluate LLM prompts — not only how to write them.
Learners run the same prompt template against an input across multiple independent LLM calls, then score outputs against an optional expected answer using simple metrics.
- Done — Prompt template + input + 1–5 independent runs → collect outputs
- Done — Optional expected answer + metrics + mean/min/max
- Done — Prompt A vs Prompt B under shared conditions (winner by mean)
- Done — Evaluation across multiple test cases (overall + per-case scores)
- Next — Charts / distributions, or model/provider comparison
git clone --recurse-submodules <this-repo-url>
cd learn_cosmo-prompteval
npm install
cp .env.example .env
cp session.config.example.json session.config.jsonFill in .env with the API key (and optional *_BASE_URL) for the provider you want. Choose the model in session.config.json as provider/model-id:
anthropic/claude-sonnet-4-6— needsANTHROPIC_API_KEY, optionalANTHROPIC_BASE_URLopenai/gpt-5.6-luna— needsOPENAI_API_KEY, optionalOPENAI_BASE_URLgoogle/gemini-3.6-flash— needsGOOGLE_API_KEY, optionalGOOGLE_BASE_URL(gemini/…also routes to Gemini)~deepseek/deepseek-v4-flash-latest— needsDEEPSEEK_API_KEYandDEEPSEEK_BASE_URL(deepseek/…anddeepseek-ai/…also route here; uses the OpenAI SDK). If both DeepSeek vars are unset, it reusesOPENAI_API_KEY/OPENAI_BASE_URL(production proxy hack).
session.config.json is separate from .env. It is local (not checked in) and holds session defaults, not secrets:
model(optional) —provider/model-id(defaultanthropic/claude-sonnet-4-6); must be listed inallowedModelsallowedModels(optional) — picker list ofprovider/model-idrefs (defaults to Anthropic, OpenAI, Gemini, and DeepSeek examples above)allowUserModelSelection(optional) — whentrue, show a model picker and let the saved eval session overridemodelwith an entry fromallowedModels(defaultfalse)defaults(optional) —minRuns,maxRuns,minCases,maxCases(each 1–5)initialSession(optional) —promptA,promptB, andcases(input/expectedAnswer)
Without session.config.json, prompts and cases start empty and the UI uses the built-in 1–5 limits. Copy session.config.example.json to prefill the capital-city demo.
Work-in-progress (prompts, cases, settings, and the last results) is stored in eval-session.json. That file is local and not checked in. A saved session wins over initialSession on reload.
npm run devnpm test- Node.js + Express
@anthropic-ai/sdk(Claude Messages API),openai(Chat Completions, including DeepSeek), or@google/genai(Gemini)- CodeSignal Bespoke Design System (git submodule)
- Vanilla JS + esbuild