AI Evals — Portfolio Projects
Build these to show employers you can measure an AI system's quality, not just build one — this is a genuinely rare, high-value skill that most "I built a chatbot" portfolios are missing entirely.
Project 1: Golden Set + Regression Gate for a RAG Bot
Level: Beginner | Time: 2 days
Take any existing (or simple, newly built) RAG question-answering system and build a proper golden-set eval around it, wired to fail a build on regression.
python
import json
def build_golden_set(qa_pairs: list[dict]) -> list[dict]:
"""qa_pairs = [{"question": "...", "expected_answer": "...", "category": "..."}]"""
return [{"id": f"case-{i}", **pair} for i, pair in enumerate(qa_pairs)]
def score_against_golden_set(golden_set: list[dict], rag_fn, similarity_fn, threshold: float = 0.8) -> dict:
results = []
for case in golden_set:
answer = rag_fn(case["question"])
score = similarity_fn(answer, case["expected_answer"])
results.append({"id": case["id"], "category": case["category"], "passed": score >= threshold})
by_category = {}
for r in results:
by_category.setdefault(r["category"], []).append(r["passed"])
return {
"overall_pass_rate": sum(r["passed"] for r in results) / len(results),
"by_category": {cat: sum(v) / len(v) for cat, v in by_category.items()},
}
Steps
1.Write 25-30 real question/expected-answer pairs covering at least 3 categories, including deliberately hard ones.
2.Implement scoring with semantic similarity (or exact match for closed-form answers).
3.Run the golden set, save the results as a versioned baseline file.
4.Change one thing (chunk size, prompt wording, k) and re-run — confirm the category breakdown catches a change a single aggregate number would have hidden.
5.Wire the scorer into a CI step that fails the build if the pass rate drops below the baseline.
Acceptance Checks
•[ ] The golden set has at least 25 cases across 3+ categories, with a documented source (real usage or deliberately constructed hard cases).
•[ ] Results are broken down by category, not just reported as one aggregate number.
•[ ] A deliberately introduced regression (e.g., a worse chunk size) is caught by the category breakdown.
•[ ] The eval runs as a script that exits non-zero on regression, demonstrated working in a CI config (even a minimal one).
Project 2: LLM-as-Judge With Human Calibration
Level: Intermediate | Time: 3 days
Build an LLM-as-judge scorer for an open-ended task (summarization, support-ticket triage, anything without one correct string), and measure how well it actually agrees with human judgment before trusting it.
Steps
1.Pick a task with genuinely open-ended output and write a specific, criteria-based rubric (not "rate 1-5").
2.Implement the judge as a separate model call scoring against that rubric.
3.Hand-label 30-50 outputs yourself (or with a second person) using the same rubric.
4.Compute judge-vs-human agreement rate; if it's low, revise the rubric and re-measure.
5.Test for position bias specifically: run the same comparison with response order swapped and check whether the judge's preference flips.
Acceptance Checks
•[ ] The rubric lists specific, checkable criteria — not a single vague quality rating.
•[ ] Judge-vs-human agreement is measured on a real held-out sample and reported as a number, not asserted.
•[ ] A position-bias test is run (order swapped) and the result is reported, whatever it shows.
•[ ] If initial agreement is low, at least one documented rubric revision is shown to improve it.
Project 3: Red-Team Eval Suite for a Support Agent
Level: Advanced | Time: 3 days
Build a small, versioned red-team test set against an LLM-powered agent (a support bot, a tool-using agent) and measure how often it holds up against adversarial prompts.
python
def run_red_team_suite(agent_fn, attack_prompts: list[dict], refusal_judge_fn) -> dict:
"""attack_prompts = [{"prompt": "...", "category": "injection|jailbreak|data_exfil"}]"""
results = []
for attack in attack_prompts:
response = agent_fn(attack["prompt"])
held = refusal_judge_fn(response, attack["category"])
results.append({"category": attack["category"], "held": held})
by_category = {}
for r in results:
by_category.setdefault(r["category"], []).append(r["held"])
return {cat: sum(v) / len(v) for cat, v in by_category.items()}
Steps
1.Write 15-20 adversarial prompts across at least 3 categories (prompt injection via fetched content, direct jailbreak attempts, attempts to extract system-prompt/secrets).
2.Define what "held up" means per category (refused, redirected, didn't leak) and implement a checker for it.
3.Run the suite against the target agent and report a per-category pass rate.
4.Pick one failure and fix it (a stronger system prompt, an output filter, a tool restriction) — re-run to confirm the fix actually closes that specific gap.
5.Version the attack-prompt set so new attacks can be added later without losing the ability to compare against this run.
Acceptance Checks
•[ ] At least 15 adversarial prompts across 3+ distinct attack categories.
•[ ] Results are reported per category, not as one blended "safety score."
•[ ] At least one real failure is found, fixed, and shown closed by re-running the suite.
•[ ] The attack set is stored as a versioned file, not just run once and discarded.
Portfolio Checklist
•[ ] At least 2 of the 3 projects completed with real, documented results (not synthetic/toy data)
•[ ] Every project's README states what was measured, how, and what the numbers actually showed
•[ ] At least one project shows a before/after comparison from a real change
•[ ] Code is runnable by someone else without guessing at missing pieces