KatalockAi AcademyBack to KatalockAi
Build track, required for the Phase 11 certificate

Build an LLM evaluation harness and leaderboard

Build an eval harness you can defend: a strict task spec, hand-written metrics, a sandboxed code-exec scorer, calibration, bootstrap confidence intervals and a parallel runner that ranks real and mock models.

about 22 h 6 guided steps Reviewed against a 6-point rubric
Submit your project Get coached by Professor Katalock

Build it step by step

  1. 1Task Spec FormatPhase 19: Capstone projects
  2. 2Classical MetricsPhase 19: Capstone projects
  3. 3Code Exec MetricPhase 19: Capstone projects
  4. 4Perplexity and CalibrationPhase 19: Capstone projects
  5. 5Leaderboard AggregationPhase 19: Capstone projects
  6. 6End-to-End Eval RunnerPhase 19: Capstone projects

What You'll Build

A provider-agnostic evaluation harness. A validated JSONL task spec freezes the contract, a metric layer scores generations with one tokenizer and one dispatcher, a subprocess runner scores generated code safely, a calibration layer reports perplexity, ECE and Brier, and a leaderboard aggregates per-task scores with bootstrap confidence intervals. A parallel runner composes them all behind a small ModelAdapter interface and ranks the lesson's mock adapters next to at least one real model you connect yourself.

Requirements

  1. Task spec. A validator for the fields task_id, category, prompt, targets, metric_name, post_process plus optional few_shot_examples (at most 8) and metadata. Closed vocabularies for category, metric and post-process rule, legal category-metric pairs, unique ids, unknown fields rejected. Write at least 20 tasks of your own covering all five categories, and a tasks_bad.jsonl that trips every rule, with the validator reporting exactly that many errors.
  2. Metrics. One tokenizer (\w+ on lowercased text) shared by every metric; exact match, token F1 (best over targets), accuracy, BLEU-4 with clipped n-gram counts, brevity penalty and add-one smoothing, and ROUGE-L via LCS. One score(metric_name, prediction, targets) dispatcher returning a value in [1]. Pin each metric with reference vectors you worked out by hand.
  3. Code execution. Extract the first fenced block, run it in a fresh Python subprocess with a 3 second default timeout (capped at 30), a 256 KB output cap and an import denylist, and map results to pass, assertion_fail, syntax_error, timeout and error. Score as the fraction of assertions passed. Implement unbiased pass@k, 1 - C(n - c, k) / C(n, k), including the n - c < k edge case.
  4. Calibration. Corpus perplexity from negative log-likelihoods that rejects negative inputs, ECE with a configurable bin count and a populated-bin count, Brier score and reliability-diagram data.
  5. Leaderboard. Refuse scores outside [1]; per-model mean, win-rate, per-category means, bootstrap percentile CI on the mean and on pairwise differences; JSON and a markdown table.
  6. Runner. A ModelAdapter returning text, confidence and optional token NLL; a single-pass loop (render, generate, post-process, score, record); ThreadPoolExecutor parallelism with a sequential mode that gives identical results; a JSON envelope plus the markdown table; exit 0 on a clean run and non-zero on validation or runtime failure.
  7. Real model. Add at least one adapter for a real model: a local model (Ollama, llama.cpp, a small Hugging Face model on CPU) or any OpenAI-compatible endpoint, including the KatalockAi API. Run it with the three mock adapters on your tasks and report where it ranks, with CIs.

Constraints

  • Python standard library plus numpy for the harness; runs on any CPU laptop. The mock-only run must finish in under about 10 seconds.
  • No paid key is required. If you cannot reach any hosted endpoint, a small local model or a tiny model you trained in phase 10 counts as the real adapter; say which you used.
  • The code-exec runner is a subprocess with a denylist, not a real sandbox. Do not feed it code from untrusted sources.

Stretch Goals

  • Add a results cache keyed by (task_id, model_id, model_version) and a cost ledger.
  • Add temperature scaling on a validation slice and show ECE before and after.
  • Add a paired bootstrap that respects task families.

How to Submit

Public repo with evalh/ (spec, metrics, codeexec, calibration, leaderboard, runner, adapters), `tasks/tasks.jsonl`, `tasks/tasksbad.jsonl, main.py, tests/ and results/` (report JSON, leaderboard markdown). Keep API keys in environment variables, never in the repo. The README must give run commands for the mock-only and real-model runs, describe your tasks, explain each metric's tokenizer and smoothing choice, interpret the leaderboard including whether CIs overlap, and say what the calibration numbers say about your real model.

How It's Reviewed

Professor Katalock reads your repository and the evidence you paste, and scores each criterion out of 100. You pass with a weighted total of 70 or more and no criterion below 40. A copied or padded submission is flagged and fails.

CriterionWeightHow it's checked
Runner end to end25Pasted run shows all tasks validated, the three mock adapters and one real adapter scored, the JSON envelope and markdown leaderboard, rule-based above random, parallel and sequential results equal in tests, exit code 0.
Metric correctness20Tests pin EM, F1, BLEU-4, ROUGE-L and accuracy against hand-worked vectors including empty and repeated-phrase cases; one tokenizer is shared; the dispatcher returns values in [0, 1].
Code-exec safety15Tests show each of the five exit codes, the timeout and output cap firing, a denied import, and pass@k matching worked examples including the edge case.
Statistics15Calibration report has ECE, Brier and populated bins; leaderboard shows bootstrap CIs and pairwise differences; perplexity rejects negative NLL.
Code quality10Modules match the layers, the runner imports rather than duplicates logic, no keys in the repo, the spec validator rejects tasks_bad.jsonl with the expected error count.
README and interpretation15README covers run commands, task design, metric choices, leaderboard interpretation with CIs and what calibration shows for the real model.

Submit

Push your work to a public GitHub repository with a README that explains how to run it, then paste the evidence below. Up to 3 reviews a day, free.

  • Full output of the mock-only run and of the run including your real model, with exit codes
  • The leaderboard markdown table with CIs
  • Validator output on tasks_bad.jsonl showing the error count
  • The calibration section of the JSON report for the real model
  • Output of `python -m pytest -q`
  • A short note on one task where metrics disagreed with your own judgement

Reviews are done by AI against the rubric above. They check the evidence in your repository; they are not a substitute for a human code review, and a review can be wrong. If you think it is, improve the README so the evidence is unmistakable and resubmit.