AI Engineering

How to Evaluate an LLM Feature Before Launch

How to test a generative AI feature so you know it is ready, and keep it that way.

3 min read

Close-up of a measuring tape
Photo: CHUTTERSNAP on Unsplash

In short

  • LLM evaluation means testing an AI feature against agreed examples and criteria before launch, and after every change.
  • Build a “golden set” of real cases with expected answers, score them automatically where you can, and keep humans in the loop for judgment calls.
  • Test for safety too: prompt injection, data leaks and harmful output.
  • Set launch gates in advance: the scores a feature must reach before real users see it.

LLM evaluation is what turns an impressive demo into a product you can trust. A language model can answer ten demo questions perfectly and fail the eleventh in a way that embarrasses your company. Gartner expected at least 30% of generative AI projects to be abandoned after the proof of concept by the end of 2025, partly because value and quality were unclear (Gartner). Here is how we would evaluate an LLM feature before launch.

1. Define what “good” means

Write down, with the business owner, what a good answer looks like: correct, complete, grounded in your sources, in the right format and tone, and safe. Decide which mistakes are tolerable and which are not. A wrong product recommendation is annoying; a wrong statement about fees or medical dosage is not acceptable.

2. Build a golden set

  • Collect 100 to 300 real questions or inputs from logs, support tickets or users.
  • Include easy cases, hard cases, ambiguous ones and ones the system should refuse.
  • Write the expected answer or the facts the answer must contain.
  • Keep the set versioned, and add every real failure you find after launch.

3. Choose how to score

MethodGood forWatch out for
Exact or rule-based checksFormats, numbers, required fields, extractionToo strict for free text
Reference comparisonAnswers with a known correct contentDifferent wording of a right answer
Model-graded rubricsFaithfulness to sources, tone, completenessMust be checked against human ratings first
Human reviewHigh-risk answers, final sign-offSlow and costly, so sample wisely

For RAG systems, score retrieval and generation separately: did the system find the right documents, and did the answer stick to them? See RAG vs fine-tuning for how the two fit together.

4. Test for safety and abuse

The OWASP Top 10 for LLM applications lists the main risks, with prompt injection at the top (OWASP). Include in your tests:

  • Instructions hidden in documents or user input that try to override your rules.
  • Requests for other users’ data or for system details.
  • Harmful, biased or off-topic requests the feature should refuse.
  • Actions the model may trigger through tools, with permissions checked.

5. Set launch gates

Agree the minimum scores before the first test run, so results are not argued after the fact. For example: at least 95% correct on critical facts, no failures on the safety set, and answers within your latency budget for 95% of requests.

6. Run evaluations on every change

Prompts, retrieval settings, model versions and source documents all change behaviour. Run the golden set automatically in your delivery pipeline, like unit tests, and block releases that fall below the gates.

7. Keep measuring after launch

  • Sample real conversations for human review every week.
  • Track user feedback, escalations to people and “I don’t know” rates.
  • Watch cost and latency per request.
  • Re-run the full evaluation when your provider updates the model.

Users have reason to be sceptical: in Stack Overflow’s 2025 survey, more developers distrusted the accuracy of AI output than trusted it (Stack Overflow). Evaluation is how you earn trust with evidence.

Choosing a model? Use the same golden set to choose a foundation model. For the full path from demo to product, read how to take an AI prototype to production.

From our work

We have taken AI into real products: the software of an autonomous warehouse drone for D-ARIA with more than 99% inventory accuracy (case study), and AI-based person following for a mobile robot with EFS Consulting. If you have an AI prototype, our free AI prototype to production review tells you what to keep, what to fix and what it will take.

Technologies you will meet

AreaTypical tools
Evaluation frameworkspromptfoo, Ragas, DeepEval, OpenAI Evals
TracingLangfuse, OpenTelemetry generative AI conventions, LangSmith
Datasetsversioned test sets in Git, DVC, spreadsheets for expert review
CIGitHub Actions or GitLab CI gates on evaluation scores

For production monitoring, see observability with OpenTelemetry.

Frequently asked questions

What is LLM evaluation?

Testing an AI feature built on a language model against agreed examples and criteria, such as correctness, grounding in sources, format, tone, safety, latency and cost, before launch and after every change.

How many test cases do I need to evaluate an LLM feature?

Start with 100 to 300 real, varied cases, including hard and adversarial ones, and keep adding every real failure you find. Quality and variety matter more than size.

Can I use an LLM to grade another LLM?

Yes, for criteria such as faithfulness or tone, but first check its grades against human ratings on a sample. Keep humans for high-risk answers and final sign-off.

How do I test for prompt injection?

Include inputs and documents that contain hidden instructions to ignore rules, reveal data or call tools, and check that the system refuses. Combine this with strict permissions for any tools the model can use.

Working on something like this?

Tell us where the product is stuck. We answer with a concrete next step.

Send a few lines about the product, the deadline and the team you have today. A senior engineer replies within two working days.