LLM Engineering

Evaluating LLM features before they reach users

"It looked good when I tried it" isn't a test. How we build small, fast evaluation loops for prompts, models and agents.

Key takeaways

  1. 01Build a golden set of 30–100 realistic inputs, including the awkward ones.
  2. 02Check what code can check; use a calibrated model judge for the rest.
  3. 03Run evals in CI and ship when the numbers improve, not the vibes.
  • #evals
  • #testing
  • #LLM

LLM features fail quietly. A prompt tweak that fixes one case can break five others, and you won't notice until a customer does. The fix is the same as for any software: tests — adapted for probabilistic output.

Start with a golden set

Gather 30–100 realistic inputs, including the awkward ones: typos, mixed languages, missing information, hostile users. For each, write what a good output must contain or must never contain.

Check what can be checked with code

  • Valid JSON that matches the schema.
  • Required fields present; forbidden phrases absent.
  • Correct tool chosen with valid arguments.
  • Latency and token cost within budget.

Use a model as a judge — carefully

For tone, helpfulness or faithfulness to sources, a second model with a clear rubric can grade outputs at scale. Calibrate it against human ratings on a sample first, and keep the rubric specific.

type EvalCase = {
  input: string;
  mustInclude?: string[];
  mustNotInclude?: string[];
  expectedTool?: string;
};

Run it on every change

Wire the evaluation set into CI so every prompt, model or retrieval change produces a score you can compare. Ship when the numbers improve — not when the demo feels better.