Think Build Implement Repeat
London, UK +44 7367 067226
WhatsApp FOLLOW f in X
  1. Home
  2. Blog
  3. Knowing Whether a Change Made Things Better
Python & Django

Knowing Whether a Change Made Things Better

How to build an evaluation harness for AI features in Python: a fixed set of real cases with agreed answers, run automatically on every prompt or model change.

Updated 2 min readBy SpiderHunts Technologies

Free estimateNo obligation

Get a free estimate

Tell us what you need. A senior engineer reads every enquiry.

Takes under a minute. We never share your details.

  • Free consultation
  • No commitment
  • NDA on request

Prefer to talk? Book a free 30-minute call →

Quick answer — TL;DR

A fixed set of real cases with agreed correct answers, run automatically on every change. Without it, every prompt adjustment is a guess and every improvement is an assertion.

You cannot improve what you cannot measure

Prompt engineering without an evaluation set is adjusting text and forming impressions. It feels productive and it produces regressions nobody notices.

The single most valuable artefact in an AI project is a hundred real cases with agreed correct answers. Everything else follows from having it.

Building the set

  1. Take real cases from your actual data or support log
  2. Have someone who knows write the correct answer for each
  3. Include cases where refusal is correct — questions with no good answer
  4. Include ambiguous cases where asking back is correct
  5. Hold back a portion you never tune against

How to score

TaskScoring
ClassificationExact match against the label
ExtractionField by field, exact or normalised
AnsweringModel-assisted grading, with human-checked samples
Refusal casesDid it decline when it should?
RetrievalWas the right passage in the top results?

Extraction and classification score cleanly. Free-text answers need model-assisted grading with periodic human verification of the grader itself.

Run it automatically

  • On every prompt change
  • On every model change
  • On a schedule, to catch provider-side changes
  • With the score recorded over time, so trends are visible
  • Blocking a deployment if it drops beyond normal variation

Refresh it

A set built in January describes January. Add new real cases monthly, especially failures, and retire cases that no longer represent your work.

Without refreshing, you eventually optimise for a test set that no longer resembles reality, which is worse than having none.

FAQ

Frequently asked questions

The questions readers ask us after this guide.

Still have a question?

Ask us directly — a senior engineer will get back to you.

Ask about your project

How many cases do we need?

A hundred is a workable minimum; two to three hundred gives more stable scores. Representative matters more than large.

Who writes the correct answers?

Someone in the business who knows. This is the part that cannot be outsourced.

Can a model grade itself?

Model-assisted grading works for scale, checked against human-verified samples. Purely self-graded evaluation tells you very little.

How long does building one take?

Two to four days with a domain expert. It is the highest-value time in the whole project.

Keep reading

More on Python & Django

Python & Django

An API Other Systems Can Depend On

Designing a Python API service others can depend on: validation at the boundary, consistent errors and status codes, early versioning and documentation.

Python & Django

Moving and Transforming Data Reliably

Building data pipelines in Python that cope with malformed input: restartable stages, quarantining failures, reconciling counts and alerting on absence.

Start here

Adjusting prompts and hoping?

An evaluation set turns that into a measurement. We can build one around a system we did not write.

  1. You tell us what you needTwo minutes on the form, or a message on WhatsApp.
  2. A senior engineer reviews itAnd comes back with questions, a realistic range and an honest view on fit.
  3. Free 30-minute scoping callWe talk through scope, options and a realistic estimate — with no obligation.
Free estimateNo obligation

Talk to someone who builds this

Send a short brief and we will come back with an honest view and a realistic range.

Takes under a minute. We never share your details.

  • Free consultation
  • No commitment
  • NDA on request

Prefer to talk? Book a free 30-minute call →