How to test an LLM model migration before you ship it
A repeatable method for proving a model swap is safe: freeze a golden suite, run both models paired, and read the diff before your users do.
To test an LLM model migration, record real cases from production, freeze them, and run both the model you use today and the candidate over exactly those cases. Score every pair with more than one evaluator, test the per-case differences for significance instead of comparing averages, and let thresholds you wrote down beforehand decide pass or fail. Do it before the provider's retirement date forces the switch, not after.
Swapping the model behind a production feature is a code change, except nothing checks it. The provider ships a newer version, you edit one string in a config file, and CI stays green because CI never had an opinion about model output. Whatever broke shows up later as support tickets, by which point the deploy that caused it is twenty deploys back.
The usual substitute for evidence is the playground: paste in twenty prompts, read the answers,
decide it looks fine. That fails for a structural reason, not a diligence one. The prompts you can
think of are the prompts you already handle well — the eleven-turn conversation where the model
drops a constraint set in turn three, the refund request where the new model calls issue_refund
before lookup_order, the input in a language your template never anticipated.
You cannot type those from memory. You have to have recorded them.
A disclosure: I build EvalShift, a tool for testing model changes on agents. It has a short section at the end. Everything before it works without it.
When do you have to test a model migration?
Before every swap you choose, and well before the retirement date of the model you run now, because the provider sets that calendar. Notice periods differ by provider and by kind of model:
| Provider | Stated notice before retirement | A recent example |
|---|---|---|
| Anthropic | At least 60 days ↗ for publicly released models | claude-sonnet-4-5-20250929: notice September 30, 2026, retires November 30, 2026 |
| OpenAI | At least 6 months ↗ for generally available models, 3 months for specialized variants, as little as 2 weeks for previews | GPT-4o and GPT-4.1 snapshots: notice October 14, 2026, shutdown January 14, 2027 |
| Google (Gemini API) | Posted in the changelog ↗; some retired names are routed to a replacement | Since October 8, 2026, requests to gemini-3.5-flash are routed to gemini-3.6-flash |
The Gemini row is the quiet one. A routed name keeps answering, from a different model, and nothing in your code fails. The full calendar is in the deprecation schedule post.
A name you did not pin can move too. Chen, Zaharia and Zou measured GPT-4 ↗ identifying prime numbers with 84% accuracy in March 2023 and 51% in June 2023, on the same questions. The model name never changed.
What does a "safe" model migration mean?
Safe means you can state what changed, in which direction, on which cases, and with what confidence. It does not mean "the new model is better." State it precisely enough that a colleague who disagrees has to argue with a number instead of your intuition.
That splits into three failure classes, independent enough that each needs its own instrumentation:
| Failure class | What changes | What catches it |
|---|---|---|
| Output quality drift | The answer is still fluent but less correct, less complete, or no longer the shape your code parses | Schema checks, a pairwise judge |
| Tool-call behavior drift | A different tool, a different order, a skipped verification step, subtly different arguments | Comparing tool calls and arguments per case |
| Cost and latency drift | The same answers, slower, or at three times the tokens per turn | Per-case token and latency ratios |
A migration can pass one class and fail another. A cheaper model that answers just as well but issues one extra tool call per turn is not a cost reduction, and reading outputs will never tell you that. The output text can look identical while the trace underneath has changed.
Price lists do not settle the cost question either. Anthropic prices
Claude Opus 5.5 ↗ at $4
and $20 per million input and output tokens, below Claude Opus 5's $5 and $25. The same page says
the default effort dropped from high to medium, and that at a given effort the model tends to
think more per turn. What a conversation costs after that swap is a measurement on your traffic.
Tool behavior can break outright, too. On Opus 5.5, tool_choice set to any or to a named tool
returns a 400 error, so an agent that forced a tool call stops working at the first request. That
one is loud. The failures this method is for are the ones that still return 200.
Step 1 — freeze a golden suite
Fix the set of cases before you touch models, and build it from recorded production traffic. If you are still editing cases while you compare, you are comparing two moving things, and the diff between them tells you nothing about either.
Real traffic beats invented prompts, for the same reason the playground fails. Record each agent run in full — model calls, tool calls, tool results — and keep every conversation turn as its own case, grouped by conversation and ordered by turn. The case that broke in turn seven stays a case about turn seven.
Drop duplicates before you count anything. Twenty recordings of the same "where is my order" turn make a comparison look twenty times more certain than it is. Miller's Adding Error Bars to Evals ↗ makes the general version of this point: treat related questions as independent and you understate the error, and on his worked example clustered standard errors came out over 3X larger than naive ones.
Step 2 — run both models over the same cases
Run every case through the current model and the candidate with identical inputs and identical context, then compare per case. Pairing is what makes the arithmetic honest. You subtract per example, so the fact that some cases are inherently harder than others cancels instead of swamping the signal.
The gain is not small. In Miller's paper, two models whose per-question scores have a correlation of 0.5 give an estimate whose variance drops by a third when you analyze paired differences instead of two separate averages. Two models answering the same cases tend to find the same cases hard, so the paired design is close to free precision.
Run more than once where you can, because one run of an agent is one sample. On τ-bench ↗, gpt-4o succeeded on fewer than 50% of tasks, and its pass^8 in the retail domain — succeeding on all eight tries of the same task — was under 25%. A difference between two models has to be bigger than that run-to-run spread before it means anything.
You can no longer remove much of that spread by setting temperature to 0. On the Claude API,
temperature, top_p and top_k were
removed in API version 2026-10-21 ↗
and return a 400 error, and earlier versions reject non-default values on Claude 4.7 and later. On
those models, sampling noise is part of what you measure: buy it down with more cases or repeats.
Rehearse for free first. Check that the config, cases and prompt templates line up — every template variable covered, every case against every prompt — without a single model call, and estimate the worst-case cost before spending anything.
Step 3 — score with more than one lens
No single scorer catches all three failure classes, so combine cheap deterministic checks with a judge and with tool-call comparisons. Evaluators cost little next to the model calls. For the deterministic half written as code, with the six failures it caught on a Sonnet 5 to Sonnet 5.5 upgrade, see how to catch LLM regressions before a model upgrade ships.
| Lens | Question it answers | Cost | Watch out for |
|---|---|---|---|
| Structural: schema, regex, length | Does the output still meet its contract? | No API calls | Checks shape, not content |
| Embedding similarity | Did the meaning move? | One embedding per output | A drift alarm, not a quality score |
| Pairwise LLM judge | Which of the two answers is better? | One judge call per pair | Position bias |
| Tool selection and arguments | Same tools, same arguments? | No API calls | Needs recorded or expected calls |
Structural checks are deterministic, which makes them the cheapest possible alarm. If your output has any contract, encode it here: a schema that stops validating needs no judgment call.
Embedding similarity pins the current model's output at 1.0 and scores the candidate's as cosine similarity against it, with a floor such as 0.9. That answers "did the meaning move," not "is it better" — useful as a drift alarm, misleading as a quality score.
A pairwise judge sees both outputs and picks one; a win scores (0, 1) and a tie (.5, .5). Strong judges are usable: Zheng et al. ↗ found GPT-4 matched human preferences with over 80% agreement, the same level humans reach with each other. The same paper found GPT-4 gave the same verdict on only 65.0% of pairs when the two answers swapped places, and favored the first answer in 30.0%.
So randomize the order, every time. Wang et al. ↗ showed how far order alone goes: with ChatGPT as the judge, Vicuna-13B beat ChatGPT on 66 of 80 queries just by changing which answer came first. Without randomization, a judge's taste for whichever answer it read first becomes your migration verdict.
Tool-call checks cover agents. Compare which tools each side called against the tools the case expects, then compare arguments field by field, with a strategy per field: a numeric field within a tolerance, an account id exactly.
Mark any scorer you do not trust yet as advisory. Its results show up in the report but never gate the decision — the right home for a judge criterion you have not yet learned to trust.
Step 4 — read the statistics, not the average
Test the per-case differences, correct for the number of comparisons, and grade by effect size. A two-point average drop across twelve cases is noise, and the statistics exist so nobody has to defend that position in a meeting.
Compute deltas pairwise and group them per prompt, evaluator and slice. Then refuse questions the data cannot support: with fewer than 5 paired observations, skip the comparison as insufficient, and between 5 and 20, test it but flag it as uncertain.
Choose the test rather than assume it. Shapiro-Wilk at α=0.05 on the deltas picks a paired t-test when they look normal and a Wilcoxon signed-rank test when they do not. Every testable comparison in the run then goes through a Benjamini-Hochberg FDR correction at α=0.05, because a suite with forty comparisons will hand you two "significant" findings by luck alone if nobody corrects for it.
Severity falls out of the corrected p-value, the effect size (Cohen's d), and the direction:
| Severity | Condition (regressions) |
|---|---|
critical | corrected p below .01 and effect size above 0.8 |
high | significant, effect size above 0.5 |
medium | significant, effect size above 0.2 |
low | significant, small effect |
Step 5 — decide with a written policy, not a meeting
Write the thresholds down before you see results, and let them turn the analysis into one of four verdicts: pass, conditional pass, fail, or inconclusive. Only blocking evaluators gate it; advisory results are summarized separately and never flip the verdict.
| Budget kind | Examples | How a breach is judged |
|---|---|---|
| Rate | Regression rate, equivalence rate, tool divergence, argument drift | Against the 95% Wilson interval: fail if the interval confirms the breach, inconclusive if it spans the budget |
| Count | Critical regressions | Exact: a breach fails |
| Ratio | Cost increase, latency increase | Measured per case, no interval: a breach fails |
| Severity | A blocking critical or high comparison | Fail; lower severities give a conditional pass |
The interesting verdict is inconclusive. One regression in ten pairs is a 10% rate, but its 95% Wilson interval runs from about 2% to 40%, so it can neither confirm nor rule out a 5% budget. Calling that "your suite is too small to tell" beats a failure you would have overridden anyway.
A fail means a conclusive budget failure or a blocking critical or high comparison. A conditional pass means lower-severity blocking regressions, or an overall pass downgraded because a single slice blew its own budget.
The policy does not retire human review; it points it at the failing cases and the slice that moved. What a paired run adds over hand review covers that split.
What this looks like in one afternoon
The first run is an afternoon's work, and every later one is a pull request check:
- +Record a day of real traffic from your agent, tool calls and results included.
- +Turn those recordings into a frozen, de-duplicated suite.
- +Dry-run the setup once, to cross-check config, cases and prompts before anything costs money.
- +Run it live against both models, paired.
- +Read the report — start at the severities, not the averages (an example report).
- +Write a policy that encodes the tradeoff you are actually willing to make.
- +Wire the same run into CI so the next model bump is a pull request check instead of an afternoon.
Steps one through six are a one-time cost. The seventh is what keeps them from recurring every quarter, and the quarters are not yours to pick: providers retire snapshots on their own calendar.
Fine-tunes have it worst, because a fine-tune is retired along with its base model. Ravoid's breakdown of fine-tuning deprecation ↗ prices that forced rebuild and ends up where this post starts: the eval suite outlives the weights.
Doing this with EvalShift
Disclosure again: I'm the founder. EvalShift runs this method end to end on agents.
- +Recording. The capture SDK records agent runs in process to
.evalshift/captures/, andevalshift capture syncpromotes every capture into.evalshift/suites/<suite>/golden.jsonl— oneSuiteExampleper conversation turn, grouped byconversation_idand ordered byturn_index. Content-duplicate captures are skipped by default. More in /docs/golden-suite and /docs/captures. - +Install. The CLI (
evalshift) and the capture SDK (evalshift-sdk) are separate PyPI packages, butpip install evalshiftbrings the SDK with it, so one environment covers both. A production agent that only records captures installsevalshift-sdkalone. - +Rehearsal.
evalshift validatecross-checks config, suite and prompts without a model call, andrunestimates worst-case cost up front and asks for confirmation before spending anything. - +Scoring.
structural(json_schema,regex,length),semantic(min_similaritydefaults to0.9),llm_judge(pairwise, order randomized), andtool_selectionandtool_argumentsfor agents. Every evaluator takesblocking: bool = true; set it tofalseto make one advisory. Full reference: /docs/evaluators. - +Statistics. The tests, correction and severities in step 4 are what
analyzeruns. EvalShift sends temperature 0, and when a model rejects it, it resends without it and flags the run as non-deterministic in the report. The method is written up in /docs/methodology. - +Decision. A
migration_policyblock inevalshift.yamlholds the budgets, and the verdict —pass,conditional_pass,failorinconclusive— is written tomigration_decision.json. See /docs/migration-policy for the config and /docs/verdicts for how each verdict is computed.
One command chains the pipeline — doctor → run → evaluate → analyze → report:
evalshift compare --from claude-sonnet-4-5-20250929 --to claude-sonnet-5-5 \ --suite-name checkout-agent
--from and --to override defaults.source_model and defaults.target_model from your config,
so the file records the migration you are planning while the flags let you audition candidates
without editing it. Add --policy-gate to exit non-zero on fail or conditional_pass.
FAQ
How do you test an LLM model migration? Record real cases from production and freeze them as a suite. Run the current model and the candidate over the same cases with identical inputs, score each pair with several evaluators, test the per-case differences for significance, and decide with thresholds you wrote down before seeing the results.
How much notice do providers give before retiring a model? Anthropic gives at least 60 days for publicly released models. OpenAI gives at least 6 months for generally available models, 3 months for specialized variants, and as little as 2 weeks for preview models. Google posts deprecations in the Gemini API changelog and routes some retired names to a replacement model.
Why compare models paired per case instead of comparing averages? Pairing subtracts the difficulty of each case, so it cancels instead of hiding the difference you care about. When two models' scores are correlated, paired differences have a much smaller variance than two separate averages, which means a smaller suite can detect the same change.
Can an LLM judge decide whether the new model is better? It can help, if you control its biases. Strong judges agree with human preferences over 80% of the time, but they also favor answers by position, so randomize which answer comes first and keep a judge advisory until you have checked it against your own labels.
What does an inconclusive migration result mean? It means the suite was too small to decide. The observed rate breached a budget, but the confidence interval around it still includes values inside the budget, so collect more cases before calling it a failure.
Keep reading
- +Running LLM regression tests in CI — the paired run as a pull request check.
- +When to trust an LLM judge — what pairwise judging is good at, and where it quietly misleads you.
- +Getting started — install,
evalshift init, and a first capture-first run.
