The hardest thing about shipping an AI feature isn't building the first version — a good prompt and a capable model get you a demo in an afternoon. The hard part is knowing whether it actually works, and knowing that it still works after you tweak the prompt, swap the model, or the provider silently updates it underneath you. Traditional software is deterministic: given the same input, you assert the same output, and a passing test means the behavior is locked. LLM features are probabilistic — the same input can produce different outputs, 'correct' is often a matter of degree, and a change that helps one case can quietly break ten others. Without evaluation, you're flying blind, and you'll find out about a regression when a customer does. An eval harness is what turns 'it seemed fine when I tried it' into a number you can defend.
Why you can't test AI like normal software
A unit test asserts equality: `expect(f(x)).toBe(y)`. That model breaks the moment the output is a paragraph of natural language where a dozen phrasings are all correct and a subtle one is wrong. You can't assert exact string matches, and eyeballing a few outputs in a playground doesn't scale, isn't repeatable, and quietly tests whatever cases happen to be on your mind that day. Evaluation replaces vibes with a systematic, repeatable measurement of quality — a way to score outputs against a known set of inputs so that 'is this good?' becomes 'this scores 0.84 on our eval set, up from 0.81 last week.' Everything else in this piece is machinery for producing that number honestly.
Start with an eval dataset
The foundation of evaluation is a dataset of representative inputs paired with a notion of what a good output looks like. You do not need thousands to start — 50 to 100 carefully chosen cases beat a giant noisy set. Curate them from real usage where possible: the queries users actually send, the tricky ones, the ones that have failed before, and deliberate edge cases (empty input, adversarial prompts, out-of-scope questions the feature should decline). Every time you find a bug in production, add it to the set as a regression case so it can never silently return. This is your ground truth, and its quality caps the quality of everything you conclude from it — a biased or too-easy dataset produces confident, wrong numbers.
How to score outputs: the three methods
- Code-based checks: for anything with a verifiable property — valid JSON, contains a required field, matches a regex, stays under a length, avoids a banned phrase — a plain assertion is fast, free, and deterministic. Use these wherever the requirement is structural.
- Human review: still the gold standard for nuanced quality (tone, helpfulness, factual correctness), and irreplaceable for calibrating the other methods — but slow and expensive, so you reserve it for periodic deep checks and for grading a sample, not every run.
- LLM-as-judge: use a strong model to grade outputs against a rubric ('Is this answer faithful to the provided context? Score 1-5 with a reason'). It scales like code and captures nuance like a human — but the judge is itself fallible, so you validate that its scores agree with human judgment before you trust it, and you keep its rubric specific.
Offline evals gate releases; online evals catch drift
There are two moments you measure. Offline evaluation runs your eval set against a candidate change before it ships — a new prompt, a new model, a retrieval tweak — and it belongs in CI: wire it so a pull request that drops the score below a threshold fails the build, exactly like a failing test. That single gate is what lets a team iterate on prompts without fear, because a regression is caught by the pipeline, not by a user. Online evaluation measures the live system on real traffic — sampling production outputs, tracking LLM-as-judge scores and user signals (thumbs, corrections, escalations) over time — because the real world always contains inputs your eval set didn't, and model providers can shift behavior under you without warning. Offline gives you confidence to ship; online tells you the truth once you have. Both feed the same loop: production failures become tomorrow's eval cases.
Evals are the difference between a demo and a product
This discipline is what separates teams that ship AI features confidently from teams that are afraid to touch a prompt that's working. It's the same lesson we drew in lessons from shipping AI agents to production: the demo is easy and the reliability is the entire job. Evaluation also underpins every serious version of the choices around it — you can't responsibly compare RAG versus fine-tuning versus agents without an eval set to measure them against, you can't tune for LLM cost control without proving quality held as you moved to a cheaper model, and you can't claim your defenses against prompt injection hold without adversarial cases in the harness. Evals are the measurement layer the rest of your AI stack stands on.
How Infiniti Tech Partners does AI evaluation
We build evaluation harnesses as a first-class part of any AI feature we ship — a curated eval dataset seeded from your real usage, code-based and LLM-as-judge scoring validated against human review, an offline gate wired into CI so regressions fail the build, and online monitoring that catches drift on live traffic. The deliverable is the ability to change a prompt, swap a model, or ship a new AI feature and know, with a number, whether quality went up or down. If you have an AI feature in production and no systematic way to tell whether it still works, that gap is usually the first thing we close.
Frequently asked questions
How do you test an LLM feature?
You build an evaluation harness rather than relying on unit tests, because LLM outputs are probabilistic and 'correct' is often a matter of degree, so exact-match assertions don't work. The core is an eval dataset of 50-100 representative inputs paired with a notion of a good output, scored three ways: code-based checks for structural requirements (valid JSON, required fields), human review for nuanced quality, and LLM-as-judge for grading against a rubric at scale. That turns 'it seemed fine when I tried it' into a repeatable number you can defend.
What is LLM-as-judge evaluation?
LLM-as-judge uses a strong model to grade outputs against a specific rubric — for example, 'Is this answer faithful to the provided context? Score 1-5 with a reason.' It scales like code-based checks but captures nuance like a human reviewer, which makes it the workhorse for evaluating natural-language quality. Because the judge is itself fallible, you validate that its scores agree with human judgment before trusting it, and you keep the rubric specific rather than vague.
What is the difference between offline and online LLM evaluation?
Offline evaluation runs your eval dataset against a candidate change — a new prompt, model, or retrieval tweak — before it ships, and belongs in CI so a pull request that drops the score below a threshold fails the build, just like a failing test. Online evaluation measures the live system on real production traffic, sampling outputs and tracking judge scores and user signals over time, because the real world always contains inputs your eval set didn't and providers can shift model behavior without warning. Offline gives you the confidence to ship; online tells you the truth once you have, and production failures become tomorrow's eval cases.
Related reading
Model Context Protocol: Building Agentic Integrations That Don't Break
What the Model Context Protocol (MCP) is, why it's becoming the USB-C of AI integrations, and how to build and secure MCP servers that connect your agents to real tools and data.
AIThe EU AI Act for US and UK SaaS: A Practical Compliance Guide
What the EU AI Act actually requires of US and UK SaaS companies that ship AI features — the risk tiers, the obligations that apply to most products, and the timeline.
AISecuring LLM Applications: Prompt Injection and the OWASP LLM Top 10
How to secure a production LLM application against prompt injection, data leakage, and the OWASP LLM Top 10 — the threat model, the defenses that work, and the ones that don't.