Chapter 19 · Systems Under Test Evals Track Eval Harness

One judge, 29 metrics, three production-shaped apps under test.

Where Chapter 18 scores single prompts, Chapter 19 grades live systems: the ShopSphere chatbot (React + FastAPI + Groq), a fully-exposed RAG pipeline, and BrowserBash, a black-box vendor bot you only reach over HTTP. One switchable LLM-as-judge drives both a pytest CI suite and an interactive dashboard.

01 What students build

Three subsystems that build on each other. A: ShopSphere, a real customer-support chatbot to point the judge at. B: RAG Explorer, a pipeline that exposes every stage (ingest, chunk, embed, store, retrieve, answer) so retrieval itself can be graded. C: the DeepEval framework, a single metric registry of 29 metric × target rows that drives pytest runs and a live dashboard on :8203, scoring relevancy, faithfulness, grounding, hallucination, bias, toxicity, correctness and PII leakage.

Switchable Judge

One env var, JUDGE_PROVIDER=openai | groq | ollama. The same CompatibleJudge works for all three because each exposes an OpenAI-compatible endpoint.

29-Row Metric Registry

registry.py is the single source of truth: 10 chatbot, 11 RAG, 7 BrowserBash and 1 synthetic row, each with metric, target, threshold and scoring direction.

Black-Box Target

BrowserBash on aleeup.com replies in plain text, takes a visitorId, and hides its model. Grading a vendor bot you don't control is the realistic production case.

02 Architecture

registry.py29 metric rows
──▶
pytest suitedeepeval test run
──▶
CompatibleJudgeopenai · groq · ollama
──▶
Targets:8201 · :8202 · live
──▶
Verdictsscore · pass/fail · reason
──▶
Dashboardlocalhost:8203
chatbot :8201 · rag explorer :8202 · browserbash live on aleeup.com · judge kept separate from every app under test

03 Live demo (simulated with sample data)

This is a UI walkthrough with pre-baked sample data so you can feel the dashboard without booting three services. In the course you run the real thing: FastAPI apps on :8201 and :8202, the judge harness on :8203, and deepeval pinned to 3.9.9.

deepeval-dashboard · localhost:8203 demo · sample data

04 Inputs & outputs

What goes in

  • Golden datasets per target (question, expected answer, context)
  • registry.py rows: metric, target, threshold, scoring direction
  • JUDGE_PROVIDER env var to pick the judge LLM
  • Live HTTP replies from :8201, :8202 and the black-box bot

What comes out

  • Score + pass/fail + judge reasoning for every metric row
  • pytest / deepeval test run results, filterable by marker
  • Dashboard run history with editable goldens
  • Optional push to Confident AI for team-visible reports

05 How it's built

Stand up ShopSphere: React UI on :5173 for humans, FastAPI POST /chat on :8201 for the judge (mock mode without a Groq key).
Stand up RAG Explorer on :8202, exposing retrieved chunks and ranked hits so contextual metrics have evidence to grade.
Define all 29 metric × target rows in dashboard/registry.py: 10 chatbot, 11 RAG, 7 BrowserBash, 1 synthetic.
Build CompatibleJudge: one class serving openai, groq and ollama judges via OpenAI-compatible endpoints, with instructor for structured output.
Wire two surfaces off the same registry: a pytest CI suite with markers, and the interactive :8203 dashboard with live verdicts and goldens editing.
Point the harness at the black-box BrowserBash bot: plain-text replies, visitorId sessions, unknown model, exactly like grading a vendor in production.

06 Tech stack

DeepEval 3.9.9pytest markersFastAPIGroq llama-3.3-70bOllama nomic-embed-textChromaDBinstructorReact + ViteConfident AI (optional)