Before swapping Claude for an 8B model, measure what breaks
A small eval built from production logs and run on both models shows where the smaller model fails before the client commits to the switch.
In brief
- Start from parity: match temperature, Top P and max tokens to the old model, measure, and only then edit the prompt.
- Take 20-50 cases from real failures, grade them with pass/fail assertions in code, and run each case several times.
- Do not report a single overall number: give the client a table by case group so they can decide what drop is acceptable.
Groq’s migration guide reduces the whole job of moving a prompt from a commercial model such as Claude to an open model to one sentence: start from parity, measure, then make deliberate adjustments. The authors of the RETAIN paper also warn that changing models can drag performance down.
The order sounds obvious, yet it is easy to reverse. When the new model’s output looks odd, the natural reflex is to fix the prompt straight away. A few rounds of that and there is no clean baseline left to compare against.
When a client asks whether the current prompt will work on a smaller open model, the answer has to come from measurement rather than instinct. This guide shows how to build that measurement.
What you will build, and what you need
The end result is a small Python script that runs the same set of cases on two models and prints the pass rate for each case. You need a prompt running in production on Claude, with API access to it, and an 8B open-weight model served through an endpoint (vLLM or a hosted provider both work).
You also need real logs. Hamel Husain treats trace logging as a prerequisite for any kind of eval, whether the grader is a human or a model. Without traces there are no real cases to put in the suite.
The running example is hypothetical: a prompt that classifies support tickets and returns JSON with category and priority. A task like this is simple enough to grade automatically, yet carries enough unwritten conventions to trip up a small model.
Step 1: Freeze the baseline before touching the prompt
You do not need an elaborate eval suite. According to Anthropic Engineering, 20-50 simple tasks drawn from real failures are a good start. Anthropic’s documentation adds two points: the suite should reflect the real distribution of tasks, and edge cases must not be forgotten.
In practice, filter from the logs: mostly ordinary tickets, plus tickets that were once misclassified, bilingual tickets and empty tickets. Each case is one JSONL line:
{"id": "t017", "input": "Card charged twice for the same order", "expected_category": "billing", "tag": "normal"}
{"id": "t031", "input": "", "expected_category": "other", "tag": "edge_empty"}
Check: count the cases by tag. If edge cases make up more than half the suite, the pass rate no longer reflects what real users experience.
Step 2: Grade pass or fail, separately for each criterion
For a migration, assertions written in code are a sensible starting point because they run fast and need no extra judge. In the ticket example, all three checks (valid JSON, valid label, correct label) can be written in code.
import json
ALLOWED = {"billing", "bug", "account", "other"}
def check(output: str, case: dict) -> dict:
try:
data = json.loads(output)
except json.JSONDecodeError:
return {"valid_json": False, "valid_label": False, "correct": False}
label = data.get("category")
return {
"valid_json": True,
"valid_label": label in ALLOWED,
"correct": label == case["expected_category"],
}
Each assertion returns only true or false, never a score from 1 to 5. Husain argues that binary labels are easier to manage than fine-grained scales, and Eugene Yan finds it very hard to calibrate both human graders and LLM judges on a 1-5 scale. A threshold such as “below 4 is a fail” is far harder to explain to a client than “the JSON broke 7 times”.
Splitting the check into three assertions is deliberate. Anthropic’s documentation says most use cases need evaluation against several criteria, and Yan prefers per-dimension metrics because they show exactly which dimension is pulling results down. A model that drops because it breaks JSON, because it invents labels or because it misclassifies has three different faults, each needing its own fix.
If a criterion is hard to express in code, such as the tone of a reply, an LLM can act as judge. Sensible advice here is not to let the 8B model grade its own work. Whatever judge you use, Anthropic Engineering points out that the only way to know whether it works is to read the transcripts and scores across many runs.
Step 3: Run several times, because one run is not enough
At a temperature above 0, the same input can produce different outputs from one call to the next. If each case runs only once, the result may reflect luck more than the model’s real ability.
# call_model is a function you wire to the client you already use (simplified)
def run_suite(model, system_prompt, cases, params, trials=5):
rows = []
for case in cases:
for t in range(trials):
out = call_model(model, system_prompt, case["input"], **params)
rows.append({"id": case["id"], "trial": t, **check(out, case)})
return rows
Run it on Claude first, with exactly the prompt and parameters used in production. That is your baseline. Save the results to a file instead of rerunning them for every comparison.
Step 4: Match parameters first, edit the prompt later
Groq advises matching parameters such as temperature, Top P and max tokens first, and only then concentrating on the prompt. So the first run on the 8B model uses the original prompt and Claude’s params unchanged. The number you get is the raw drop, uncontaminated by any change of yours.
Only then rewrite the prompt. The original might say no more than “classify this ticket”. For a small model, spell out every convention: return only JSON, no explanation, use only the four given labels, assign other to empty tickets. Run again, record the result, and only then try a temperature change as a separate step.
The order matters. Change the prompt and the temperature together and you will not know which one moved the score.
Step 5: Enforce the format instead of pleading
If valid_json still drops after the prompt rewrite, do not add “MANDATORY” to the prompt. The vLLM documentation describes the guided_json parameter for guided decoding: output will follow the JSON schema you supply. Declare category as an enum of the four labels in the schema and both broken JSON and invented labels are blocked at the decoding layer.
From here on, valid_json and valid_label serve mainly to catch regressions. Anthropic Engineering defines a regression eval as a suite that checks whether the system can still do everything it used to, with an expected pass rate close to 100%. The real remaining work lies in correct.
How much drop is acceptable?
Say your suite has 40 cases, run 5 times each, for 200 runs. Claude scores 196/200 on correct, or 98%. After steps 4 and 5 the 8B model scores 172/200, or 86%. The drop is 12 percentage points.
Do not stop at the overall number. Sort cases by the gap: where Claude passes 5/5 and the 8B model passes 2/5 or fewer, an unwritten convention probably remains. A case where the 8B model passes 3/5 is unstable; try lowering the temperature before editing the prompt.
The acceptance threshold is a product decision. Losing 12 points on “other” tickets may be fine, while losing 12 points on “billing” may not. Give the client a table broken down by tag, not a single overall number.
The suite built in step 1 can also be reused with tools. Groq describes llama-prompt-ops as having a regression mode that runs a golden set and reports wins and losses against a baseline. The RETAIN paper proposes an error-discovery module to explain behavioral differences between two models, precisely the kind of question that comes up when reading each failing case.
Common mistakes
The most common mistake is building the eval suite after already editing the prompt for the new model, leaving no clean baseline. The second is running each case once and drawing conclusions from a gap of two or three points.
The third is grading on a 1-5 scale and then arguing over what a 3 means. The last is reporting only the overall number, which hides a drop concentrated in one important group of cases.
Where this skill shows up in practice
At a client company, this work can start with a very short question: “Can we use a small model running in-house?” An FDE who answers with a per-case table, the list of instructions added and the remaining drop gives the client enough data to decide for themselves, without asking them to trust a promise.
When reading job descriptions, look for phrases such as “model evaluation”, “open-weight” and “on-prem deployment”. On a CV, state the before and after numbers, the number of cases, the number of runs and the grading method. A line such as “moved a classification prompt to an 8B model, keeping X% accuracy on Y cases drawn from production logs” says more than a paragraph listing frameworks.
The next time a client asks whether they can switch models, the best answer is to rerun the eval suite and send the results.
Was this article useful?
Thanks for the feedback!
7 sources
- Model Migration Guide: Moving from Closed to Open Models - GroqDocs
- Define success criteria and build evaluations
- Demystifying evals for AI agents · 2026-01-09
- Your AI Product Needs Evals · 2024-03-29
- Product Evals in Three Simple Steps · 2025-11-23
- RETAIN: Interactive Tool for Regression Testing Guided LLM Migration · 2024-09-05
- Structured Outputs