AI Evals: How to Test Your AI Features Like Software
An AI eval suite is a curated set of inputs with known good outputs, run automatically on every prompt change, model update, and deployment. The teams that have one ship AI features with confidence. The teams that do not have one ship by intuition and break customer trust on the third regression. The work to build the suite is smaller than it looks and pays back the same week.
Written by Yashveer Singh, founder of Yashveer Labs.
What you actually need to know
- Without evals, every prompt change is a coin flip. With evals, the team knows whether a change made the product better or worse.
- A starting eval suite of twenty to fifty cases is enough to catch most regressions.
- Exact match works for some tasks. Rubric scoring or LLM judging works for the rest.
- Evals must run on every change. Manual runs do not count.
- In my experience, the work to build a useful eval suite is two weeks of focused effort. Skipping it costs months of customer trust.
| Eval type | Best for | Watch out for |
|---|---|---|
| Exact match | Classification, structured output | Brittle on free form output |
| Regex or string contains | Specific keywords or fields | False positives, missing the substance |
| Rubric scoring (human) | Quality assessment at small scale | Expensive, slow, but most accurate |
| LLM as judge | Summarization, tone, free form output | Needs calibration, can drift |
The core argument
Traditional software has tests because the behavior of a function is supposed to be deterministic. Pass the same input, get the same output. AI features break that assumption. The same input can produce a different output the next time you run it, especially after a prompt change, a model version update, or a temperature adjustment.
The instinct of engineers used to traditional software is to give up on testing because the determinism is gone. The right move is the opposite. The non determinism is exactly why you need a test suite, not why you can skip one. Without one, you have no way to know whether a change improved the product or regressed it.
An eval suite solves this. You curate a list of inputs that represent the cases you care about. You write down what a good answer looks like for each one. You run the AI feature on every input, compare the output, and produce a pass or fail. The suite runs on every change. The team sees the score move. Decisions about prompt changes, model updates, and architecture choices are now data driven instead of vibes driven.
The teams that build this discipline ship AI features that feel solid. The teams that skip it ship features that feel impressive in the demo and break in week three. The difference is whether the team caught the regression before the customer did.
The shape of a real eval harness
Step one. Curate inputs. Pull twenty to fifty real cases from production, customer support tickets, and edge cases you have already lived through. Each case is one row in a CSV or a JSON file. The case includes the input, the expected output, and a tag describing what it tests.
Step two. Write the comparison function. For classification, exact match. For structured output, a JSON schema check. For free form, an LLM as judge that returns a score from one to five with a written rationale. Pick the lightest comparison that works.
Step three. Wire to CI. On every PR that touches AI code, run the harness against the current branch. Compare the score to the main branch score. Block the merge if the score drops by more than a threshold.
Step four. Run nightly against production. Drift happens. The model provider updates their endpoint, a temperature setting changes, a prompt gets edited without a PR. Nightly runs catch silent regressions that bypass the PR check.
Step five. Add new cases as you discover them. Every customer report of a bad output becomes a new eval case. The suite grows. The team gets faster at adding cases, because the harness already exists.
What it actually costs
| Investment | Cost | Outcome |
|---|---|---|
| Skip evals | Zero up front | Two to four regressions in production per quarter, customer trust drift |
| Manual smoke test | Five hours per release | Catches obvious issues, misses subtle ones |
| Lightweight harness, 20 to 50 cases | One to two weeks engineering | Catches most regressions, calibrates prompt work |
| Production grade harness, hundreds of cases, LLM judge | One to three months | Strong confidence, expensive to maintain |
The numbers above come from my own client work and what I hear from teams running AI features at scale. The lightweight harness is the sweet spot for almost every team I encounter. Heavier setups are right only when AI is the core of the product.
Features to demand from the harness
- Determinism in the harness itself. Same input, same comparison, same result. The harness is the floor.
- A score that the team can read at a glance. A number, a delta from last run, a breakdown by tag.
- The ability to inspect failing cases. The output, the expected, the diff.
- Cost tracking. Each run costs money. The harness should report the cost so you know which prompt experiments are economically viable.
- A way to quarantine flaky tests, with a date the quarantine expires.
- A clear path to add a new case. Adding cases must be friction free or it will not happen.
Expert opinion
An eval suite is the AI equivalent of a CI test suite. The first time it catches a regression you would have shipped, you stop questioning whether it was worth the work. The teams that resist building one are usually the teams that have not yet shipped the bug that an eval would have caught. They will.
>
Yashveer Singh, founder of Yashveer Labs
How this plays out in practice
On a client project that integrated an AI summarization feature, the team had been running blind. Prompt changes went live without verification. The product manager would ship a change on Monday and notice the regression on Thursday. We built an eval suite in eleven working days. The first regression it caught was a prompt change that broke summary length on long documents. The team would have noticed eventually. The eval caught it the same hour. Two months later, the suite was catching one regression a week, all of which would have shipped without it.
The opposite story is a team I declined to take work from until they agreed to add evals. They had a customer facing AI feature that hallucinated sales figures on the third call out of ten. Without evals, every fix made the team feel productive but never actually reduced the rate of hallucination. We agreed to start with twenty real cases drawn from customer reports. Two weeks of work, the regression rate dropped from thirty percent to eight percent, and the team had a baseline for the next round of improvements.
For more on the broader AI engineering process, see AI failover and fallback patterns and the AI output validation problem. For prompt management discipline, prompt versioning covers what evals are testing against.
Common mistakes teams make
- Skipping evals because the team thinks AI is too non deterministic to test. The non determinism is the reason to test, not the reason to skip.
- Picking only easy cases. The suite stays green and tells you nothing.
- Running evals manually. If they are not in CI, they will not catch the next regression.
- Treating the LLM judge as ground truth. It needs calibration against human ratings, and it drifts as models update.
- Building a hundred case suite before twenty has been proven valuable. Start small, grow with discoveries.
- Ignoring cost. Each eval run costs API tokens. A suite that costs more than the value it returns will get cut.
Where to start, a 14 day plan
- Day one to day three. Pull twenty real cases. Write down what a good output looks like for each. Put them in a CSV.
- Day four to day seven. Write the harness. Read the CSV, run each case through the AI feature, compare the output, print a score.
- Day eight. Wire to CI. Block PRs that drop the score below the main branch baseline by more than a small threshold.
- Day nine to day ten. Run nightly against production. Watch for drift.
- Day eleven to day fourteen. Add the first batch of new cases from customer reports. Train the team on adding cases.
For deeper reading, AI hallucinations in customer facing products covers the failure modes evals should be looking for, and streaming AI responses to users covers a different but related side of AI engineering discipline.
Frequently asked
Why this is the work I do
The work in this article is not theoretical for me. It is what I shipped last quarter, last month, and this week. Yashveer Singh, founder of Yashveer Labs. I do not write about things I have not done. I do not pretend to expertise I do not have. If the topic here is the topic you are dealing with, I am the person who has dealt with it. Multiple times. Recently.
Posts that line up with this one.
- AI Integration and Vibe Coding Rescue
Streaming AI Responses to Users: An Architecture Primer
Streaming AI responses is a UX decision with real backend consequences. Here is how to implement it without making your product unreliable.
- AI Integration and Vibe Coding Rescue
The Compliance Risk of AI in B2B SaaS
Adding AI features to B2B SaaS creates compliance questions your customers will ask. Here is how to think through the risk before you ship.
- AI Integration and Vibe Coding Rescue
The Cost of Running LLMs in Production: A Realistic Budget
LLM API costs in production look different from development costs. Here is how to build a realistic budget before your AI features go live.
- AI Integration and Vibe Coding Rescue
Human in the Loop Design: The Pattern Behind Trustworthy AI Features
AI features that users trust are rarely fully autonomous. They are designed with human checkpoints at the moments where the cost of an AI error is high. Here is the pattern and how to apply it.