← all posts
migration·Lukas Babaliauskas·Jul 31, 2026·updated Nov 17, 2026·13 min read

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:

ProviderStated notice before retirementA recent example
AnthropicAt least 60 days ↗ for publicly released modelsclaude-sonnet-4-5-20250929: notice September 30, 2026, retires November 30, 2026
OpenAIAt least 6 months ↗ for generally available models, 3 months for specialized variants, as little as 2 weeks for previewsGPT-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 replacementSince 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 classWhat changesWhat catches it
Output quality driftThe answer is still fluent but less correct, less complete, or no longer the shape your code parsesSchema checks, a pairwise judge
Tool-call behavior driftA different tool, a different order, a skipped verification step, subtly different argumentsComparing tool calls and arguments per case
Cost and latency driftThe same answers, slower, or at three times the tokens per turnPer-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.

LensQuestion it answersCostWatch out for
Structural: schema, regex, lengthDoes the output still meet its contract?No API callsChecks shape, not content
Embedding similarityDid the meaning move?One embedding per outputA drift alarm, not a quality score
Pairwise LLM judgeWhich of the two answers is better?One judge call per pairPosition bias
Tool selection and argumentsSame tools, same arguments?No API callsNeeds 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:

SeverityCondition (regressions)
criticalcorrected p below .01 and effect size above 0.8
highsignificant, effect size above 0.5
mediumsignificant, effect size above 0.2
lowsignificant, 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 kindExamplesHow a breach is judged
RateRegression rate, equivalence rate, tool divergence, argument driftAgainst the 95% Wilson interval: fail if the interval confirms the breach, inconclusive if it spans the budget
CountCritical regressionsExact: a breach fails
RatioCost increase, latency increaseMeasured per case, no interval: a breach fails
SeverityA blocking critical or high comparisonFail; 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:

  1. +Record a day of real traffic from your agent, tool calls and results included.
  2. +Turn those recordings into a frozen, de-duplicated suite.
  3. +Dry-run the setup once, to cross-check config, cases and prompts before anything costs money.
  4. +Run it live against both models, paired.
  5. +Read the report — start at the severities, not the averages (an example report).
  6. +Write a policy that encodes the tradeoff you are actually willing to make.
  7. +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/, and evalshift capture sync promotes every capture into .evalshift/suites/<suite>/golden.jsonl — one SuiteExample per conversation turn, grouped by conversation_id and ordered by turn_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, but pip install evalshift brings the SDK with it, so one environment covers both. A production agent that only records captures installs evalshift-sdk alone.
  • +Rehearsal. evalshift validate cross-checks config, suite and prompts without a model call, and run estimates worst-case cost up front and asks for confirmation before spending anything.
  • +Scoring. structural (json_schema, regex, length), semantic (min_similarity defaults to 0.9), llm_judge (pairwise, order randomized), and tool_selection and tool_arguments for agents. Every evaluator takes blocking: bool = true; set it to false to make one advisory. Full reference: /docs/evaluators.
  • +Statistics. The tests, correction and severities in step 4 are what analyze runs. 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_policy block in evalshift.yaml holds the budgets, and the verdict — pass, conditional_pass, fail or inconclusive — is written to migration_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:

bash
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