Book a free call

How to evaluate an LLM application before launch

A practical method for testing quality, safety and cost of an LLM app, with the test set, graders and release gates we use on client projects.

Hertiv engineering teamReviewed by a senior engineer
3 min read
How to evaluate an LLM application before launch
On this page

Short answer

Build a fixed test set from real user questions, decide what a good answer looks like for each, and grade every new version against it before release. Combine automatic checks, a model-based grader for judgement calls, and human review of a sample. Ship only when quality, safety and cost all meet the targets you agreed in advance.

Why demos are not evidence

An LLM app that answers ten hand-picked questions well can still fail one request in five in production. Models are sensitive to wording, and small prompt or model changes can fix one case and break three others.

The only reliable defence is a repeatable test you run on every change, the same way you run unit tests on code.

Step 1: build the test set

  • Collect 100–300 real questions from support logs, sales calls or pilot users. Invented questions are too easy.
  • Cover the common cases, the awkward ones, and the ones the app should refuse.
  • For each, write the expected answer or the facts a good answer must contain.
  • Tag each case by type so you can see where quality drops.

Step 2: choose graders

GraderWhat it checksNotes
Exact and rule checksFormat, required fields, banned phrases, valid JSONCheap, fast, no judgement
Reference matchDoes the answer contain the required facts?Good for factual Q&A
Model-based graderIs the answer correct, complete and on-policy?Handles nuance; must be checked against people
Human reviewSample of answers scored by domain expertsSlowest, most trusted

Use rule checks wherever you can, a model grader for the rest, and humans to calibrate the model grader. If the model grader and your experts disagree often, fix the grading rubric before trusting any scores.

Step 3: measure more than accuracy

  • Groundedness: for RAG apps, is every claim supported by the retrieved sources?
  • Safety: does it refuse what it should, and resist prompt injection in documents and user input?
  • Tool use: for agents, did it call the right tools with the right arguments, and stop when it should?
  • Latency and cost: time to first token, total time, and cost per request at expected volume.

Step 4: set release gates

Agree targets with the business owner before testing, not after. A typical gate looks like this:

MeasureExample target
Correct on core casesAt least 90%
Correct refusalsAt least 95%
Unsupported claims (RAG)Under 2%
Cost per requestWithin budget at expected volume
No regressionsNo case that passed before now fails, unless accepted

Your numbers will differ by use case. What matters is that they are written down and checked automatically.

Step 5: keep evaluating after launch

Log inputs and outputs (with privacy controls), sample them weekly for human review, and watch for drift when users start asking new kinds of questions. Re-run the full test set before changing the model, the prompt, the retrieval settings or any tool.

We set this up as part of AI governance and every generative AI build.

Key takeaways

  • Test on real questions, not demo questions.
  • Calibrate model graders against human experts.
  • Agree release gates before you test, and re-test on every change.

Frequently asked questions

How big should the test set be?

Start with 100–300 cases. Grow it with every production failure.

Can an LLM grade another LLM?

Yes, for many judgement calls, as long as you check its scores against human reviewers regularly.

How long does evaluation setup take?

A first test set, graders and a release report usually take one to two weeks.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: AI and agent systems in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Need an evaluation set-up for your LLM app?

A senior engineer replies within one business day. Or see our AI Governance service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to [email protected].

Prefer email? Write to [email protected]
Estimate costBook a call