Evalscore
Code-based checks
Deterministic assertions: valid JSON, right tool, cited IDs exist, required facts present.
What it is and why it exists
Anything checkable with code should be: schema validity, exact match on extracted fields, regex for required elements, citation IDs that exist in the context, tool selected and arguments, length limits, forbidden content. Cheap, fast, reproducible — run them first, judges second.
Quick prototype
assert 'refund' in answer.
In production, at scale
A library of assertions per task type, run on every eval item and on sampled production traffic, with clear failure messages.
Vendors and tools
| promptfoo assertions | Contains, regex, JSON schema, latency, cost |
|---|---|
| DeepEval / pytest | Assertions in tests |
How it fails
- Brittle string matches that fail on harmless rephrasing
What the interviewer asks next
What can’t a code check evaluate?
Open-ended quality — whether an explanation is correct, helpful or faithful. That needs a reference-based comparison, a calibrated judge or a human.