Golden cases, checks and pass rates for LLM features

Public benchmark trackers that score models every day and flag drift have become popular, because many developers feel that models change under their feet. Those trackers are useful for the big picture, but they test generic tasks. What you actually need to know is whether your own feature still works after you tweak a prompt, switch model versions or add a fallback provider.
This guide shows how to build a small regression suite for that purpose. It needs no special framework: a file of test cases, a script that runs them against one or more backends, simple automatic checks and a pass-rate report. You will be able to run it locally, in CI, or on a schedule, using any OpenAI-compatible API including the free endpoint on this site.
Frequently asked questions
What is a regression test for a prompt?
It is a fixed input with a known expectation that you run every time something changes. If the output stops meeting the expectation, you have a regression. For model features, expectations are usually rules or properties rather than exact text.
How does a regression suite differ from a benchmark?
A benchmark compares models on general tasks. A regression suite checks that your specific feature keeps working. It is smaller, tailored to your use and run much more often.
How many test cases do I need?
Start with ten to thirty real examples that cover your main use and known edge cases. A small suite that runs often is more valuable than a large one nobody maintains.
Can I compare outputs as exact strings?
Rarely. Model outputs vary in wording even when correct. Check properties instead: valid JSON, required fields present, correct label, length within limits, key facts mentioned, forbidden content absent.
What is a pass rate and why use it?
It is the fraction of runs that pass a check. Because outputs vary, run each case several times and track the rate. A drop from 95 percent to 70 percent is meaningful even if no single run is decisive.
Should I use a model to grade outputs?
For properties that rules cannot check, such as tone or helpfulness, a model-based grader can help. Treat its scores as noisy, keep grading prompts fixed, and prefer rule-based checks wherever possible.
Which is better for tests: temperature zero or production settings?
Run both if you can. Temperature zero makes regressions easier to spot; production settings tell you what users actually experience. If you must pick one, use your production settings with several runs per case.
Does a free endpoint make sense for testing?
Yes, for developing the suite itself and for checking a fallback route. Daily per-IP limits of 10,000 requests and 10,000,000 tokens are enough for a modest suite run many times a day.
Step by step
- Collect golden cases — Gather ten to thirty real inputs, past failures and edge cases, and write a checkable expectation for each.
- Write property checks — Check structure, required content and length in code instead of comparing exact text.
- Build the runner — Run each case several times against a configurable backend and record pass rates.
- Set a baseline — Run the suite on your current production setup and save the results.
- Automate — Run the suite in CI on prompt or model changes and on a regular schedule, failing below a threshold.
Why your own tests beat public trackers
Public drift trackers answer the question of whether a model seems different this week on their tasks. Your users care whether your summariser still keeps the key numbers, whether your classifier still picks the right category, and whether your extraction still returns valid JSON. Those are narrow, specific behaviours that a general benchmark will not cover.
A regression suite also catches changes you make yourself. Most quality drops in real products come from prompt edits, new context added to requests, or switching to a cheaper model, not from the provider. Tests turn those changes from leaps of faith into measured decisions.
Your prompts, your data
Test with inputs that look like real user traffic, anonymised as needed. Synthetic examples often miss the messy cases that cause trouble.
Changes come from everywhere
Prompt edits, model updates, provider switches and fallback routing can all change behaviour. One suite covers them all.
Collecting golden cases
Golden cases are inputs paired with expectations you are confident about. The best source is your own logs and bug reports: every time a user reports a bad output, turn it into a test case. Add a handful of typical inputs, some edge cases such as empty or very long inputs, and a few adversarial ones such as text that contains instructions.
Write expectations as checkable properties. For a sentiment classifier, the expected label. For an extraction task, the fields that must be present and their values. For a summariser, facts that must appear and a maximum length.
Keep cases in version control
Store test cases as a JSON or YAML file next to your prompts. Reviewing a prompt change and its test results in the same pull request is much easier.
- Typical inputs that represent most traffic.
- Known past failures, each turned into a case.
- Edge cases: empty, very short, very long, unusual languages.
- Inputs containing instructions that should be ignored.
- Cases where the correct answer is to decline or say there is no data.

Writing checks that tolerate variation
The art of LLM testing is choosing checks that are strict about what matters and relaxed about what does not. Parsing JSON and checking required keys is strict and reliable. Checking that a summary contains a specific number is strict about the fact but relaxed about wording. Checking that a reply is under a length limit is a pure property.
Avoid checks that depend on exact phrasing unless the phrasing truly matters, for example a fixed legal disclaimer. Fragile checks create noise, and noisy tests get ignored.
Structural checks
Valid JSON, required fields, correct types and allowed values. These catch the most common breakages and never give false alarms.
Content checks
Required facts present, forbidden phrases absent, correct label or category. Use case-insensitive matching and normalise whitespace.
Length and format checks
Word or character counts measured in code, never by asking the model. The reasons are in why models get counting wrong.
A runner in fifty lines
The script below loads cases from a JSON file, runs each one several times against a backend, applies the checks and prints a pass rate per case and overall. The backend is configured through environment variables, defaulting to the keyless endpoint here, so the same suite can test your primary provider, your fallback, or a new candidate model.
Keep requests within the backend's limits. The free endpoint allows one request per second per IP with bursts of three, so the runner pauses briefly between calls and retries on 429 or 503.
Several runs per case
Three runs is a reasonable minimum. It distinguishes a case that always fails from one that fails occasionally, which need different fixes.
One prompt file
Loading the system prompt from a file means the test always uses exactly what production uses, with no copy-paste drift.
import json, os, time
from openai import OpenAI
client = OpenAI(base_url=os.getenv("LLM_BASE_URL", "https://api.apiclaudekeyfree.com/v1"),
api_key=os.getenv("LLM_API_KEY", "none"))
MODEL = os.getenv("LLM_MODEL", "free-ai")
SYSTEM = open("prompt.txt").read()
def call(text):
for attempt in range(4):
try:
r = client.chat.completions.create(model=MODEL, temperature=0, max_tokens=400,
messages=[{"role": "system", "content": SYSTEM}, {"role": "user", "content": text}])
return r.choices[0].message.content
except Exception:
time.sleep(3 * (attempt + 1))
return ""
def check(out, exp):
try:
data = json.loads(out[out.find("{"): out.rfind("}") + 1])
except ValueError:
return False
if data.get("label") != exp["label"]:
return False
return all(w.lower() in out.lower() for w in exp.get("must_include", []))
cases = json.load(open("cases.json"))
RUNS, total, passed = 3, 0, 0
for c in cases:
ok = 0
for _ in range(RUNS):
ok += check(call(c["input"]), c["expect"])
time.sleep(1.1)
total += RUNS; passed += ok
print(f"{c['id']}: {ok}/{RUNS}")
print(f"overall pass rate {passed / total:.0%}")
Reading results without fooling yourself
Small suites produce noisy numbers. A pass rate that moves from 90 to 87 percent on thirty runs is probably noise. A move from 90 to 60 percent is almost certainly real. Look at which cases changed, not just the overall number, and read a few failing outputs before drawing conclusions.
Keep a history of results. A simple CSV with date, backend, model, prompt version and pass rate lets you see trends and answer questions like whether a model really got worse or you changed something.
When a result surprises you, rerun just the affected cases a few more times before acting. Five extra runs on one case cost very little and often show that an alarming drop was a short unlucky streak rather than a real change in behaviour.
Compare against a baseline
Run the suite on the current production setup before every change. The comparison, not the absolute number, tells you whether the change helped.
Investigate flips
A case that passed every time and now fails every time is the most informative signal. Start there.
Testing fallback and alternative models
If your app fails over to a second provider during outages, that path needs tests too. Run the same suite against the fallback and record its pass rate separately. You may find that some features work acceptably on the fallback and others do not, which tells you which features to keep alive in degraded mode and which to pause.
The same applies when evaluating a cheaper model. A suite gives you a direct, task-specific comparison. Differences in platform settings can also affect results, as explained in why the same model feels different elsewhere, so test through the exact route production will use.
Expect lower scores on smaller models
A mid-sized open model such as free-ai, about 35B parameters, will usually score lower than a top commercial model on hard cases. The question is whether it is good enough for the specific feature.
Track per-feature results
Group cases by feature so you can make per-feature routing decisions instead of an all-or-nothing choice.

Running the suite automatically
The suite earns its keep when it runs without anyone remembering to start it. Run it in CI whenever a prompt file or model configuration changes, and on a schedule, daily or weekly, to catch provider-side changes. Fail the build if the pass rate drops below a threshold, and post a short summary somewhere the team will see it.
Watch the cost. A suite of thirty cases with three runs each is ninety calls per execution, which is trivial on most budgets and well within the free endpoint's daily limits, but scheduled runs across several backends add up over time.
Thresholds, not perfection
Set the failing threshold a little below your current baseline. Demanding a perfect score leads to flaky builds and ignored alerts.
Keeping the suite useful
Suites decay if nobody maintains them. Add a case for every real bug, remove cases that no longer reflect how the product is used, and update expectations when requirements change. Review the suite whenever you add a feature.
This site is not affiliated with Anthropic, and free-ai is not a Claude model. Whichever models you use, the discipline is the same: decide what good looks like, write it down as checks, and measure every change against it.
Every bug becomes a case
The fastest way to grow a valuable suite is to turn each reported failure into a test before fixing it.
Prune stale cases
Cases for removed features or outdated formats create noise. Delete them as part of normal maintenance.

Send a test request to the keyless, OpenAI-compatible endpoint on the home page and see how it fits your project.