hub.gazar.dev · cheat sheet← all cheat sheets

Week 5 · Evals & observability

Evals & observability cheat sheet.

You cannot unit-test a probability. Grade the whole path, gate on it, and grow it from prod. Eval types, graders, metrics, the flywheel, and the trace, on one page.

Not vibes Output vs trajectory Three graders Four metrics Offline vs online The flywheel An eval case A trace Dashboards
01

You cannot ship on vibes

Traditional tests assert exact outputs. The model returns a distribution, so "assert equals" is dead. Evals replace it: a graded suite that says whether a change made the system better on average, and where it regressed.

"Looks better in my three tries" is vibes. "Pass rate 84% to 91%, these 4 regressed" is evidence.
02

The answer can be right for the wrong reasons

Grade only the final answer and you miss the agent that got lucky, burned an expensive tool, or looped five extra times. For agents you grade the trajectory.

output

Output eval

Is the final answer correct? Necessary, not sufficient for agents.

tools

Tool-calling eval

Right tools, right args, sane order?

path

Trajectory eval

Was the whole path efficient, safe, and generalizable?

flowchart LR
  G["Task"] --> S1["Step 1
right tool?"] S1 --> S2["Step 2
needed?"] S2 --> S3["Step 3
right args?"] S3 --> A["Answer
correct?"] A --> SC{"Score:
done · efficient · safe"} classDef s fill:#DCEBFE,stroke:#1F2937,color:#0E1726; classDef sc fill:#D6F5E3,stroke:#1F2937,color:#0E1726; class S1,S2,S3 s; class SC sc;
03

Three graders, each with a trap

cheap

Rules / code

Exact match, schema, "did it call tool X?" Reliable. Trap: only works for checkable facts.

scalable

LLM-as-judge

A model scores nuance against a rubric. Trap: biased, needs its own validation against people.

gold

Human

The gold standard for judgment. Trap: slow and costly, so reserve it and sample.

Rules where you can, judge where you must, humans to calibrate the judge. Never trust an LLM judge you have not checked against people.
04

Four dials on every run

Task completion

Did it achieve the goal? The headline number.

Tool-calling accuracy

Right tools, args, order; no needless calls.

Cost & latency

A "correct" run that costs 10x is a regression.

Safety

Did injection tests get through? Did it over-reach?

05

Offline gates releases, online watches prod

pre-ship

Offline golden set

Curated cases with known-good outcomes. Run on every change. Your regression gate.

in-prod

Online sampled traffic

Grade a slice of real production runs continuously. Catches what your golden set never imagined.

You need both: offline says the change is safe to ship, online says the real world agrees.
06

Every failure becomes a permanent test

The loop that separates teams that improve from teams that thrash. A bad trace is not just an incident, it is a new eval case.

flowchart LR
  P["Prod trace fails"] --> C["Capture it"]
  C --> E["Add to eval set"]
  E --> F["Fix + re-run evals"]
  F --> S["Ship, regression locked out"]
  S --> P
  classDef ok fill:#D6F5E3,stroke:#1F2937,color:#0E1726;
  class E,S ok;
    
07

An eval case is just data

{
  "input": "refund for BA-2490, you cancelled it",
  "expect_tool": "lookup_policy",          //trajectory: must check policy
  "expect_contains": "carrier-cancellation",   //output: cites the clause
  "must_not": "state a refund amount not in policy",
  "grader": "rule + llm_judge"
}
08

A trace you can replay

One request is a trace, each step a span. When a user reports nonsense, open their request id and read this. No guessing.

{ "request_id": "req_8f2a", "outcome": "ok",
  "cost_usd": 0.014, "latency_ms": 1830,
  "spans": [
    { "type": "retrieve", "ms": 210, "chunks": 5 },
    { "type": "model", "prompt_ver": "v13", "in": 3120, "out": 240 },
    { "type": "tool", "name": "lookup_policy", "ok": true } ] }
09

Three dashboards, each with an alert line

DashboardWatchAlert when
Costspend per request + per daydrifts past the Week 3 budget
Latencyp50 / p95 / p99 + first tokenthe tail crosses your ceiling
Qualityonline eval pass-rate on sampled trafficpass-rate drops
Guardrails vs evals: a guardrail blocks a bad action now (this request). An eval measures quality across many runs (over time). Guardrails keep today safe, evals make tomorrow better. A dashboard with no alert line is wallpaper.