A frontier lab halves its prices and a message lands in your team channel: should we switch? Someone changes one string in a config file, the evals look fine, and it ships. Three weeks later support tickets are up 14% and nobody can say why, because the change that caused it was a one-line diff nobody flagged as risky.
Model migration is a production infrastructure change wearing the costume of a config edit. This playbook treats it as one. It assumes you have a live workload on a model, a cheaper or better option has appeared, and you want the saving without the outage.
Budget: two to three weeks of calendar time for a meaningful workload, most of it waiting for data rather than working. Rushing it is where the cost goes.
Step 0: Decide whether it is worth doing at all
Before anything else, compute the prize. Not the percentage — the dollars.
Pull 30 days of actual token usage for the workload from your provider dashboard. Multiply input and output tokens by both old and new rates. The gap is your annualised saving.
Now apply the test: if the annualised saving is less than three weeks of loaded engineering cost, do not migrate. A 50% cut on a workload spending $900 a month saves $5,400 a year and will cost you more than that to move safely. Put it on a list, migrate it opportunistically the next time you touch that code path, and move on.
Run this test per workload, not per organisation. Most companies have one or two workloads carrying 80% of token spend and a long tail of endpoints spending pennies. Migrate the head. Ignore the tail until it is free to move.
One exception: migrate a small workload anyway if it is a rehearsal for a large one on the same prompt architecture. Learning the failure modes on a $900 workload before touching a $90,000 one is cheap tuition.
Step 1: Build the eval before you touch the model
This is the step everyone skips and the reason most migrations fail silently. If your only test is “we tried ten prompts and they looked fine,” you do not have a migration plan. You have a coin flip with extra steps.
You need three layers, in this order:
- A golden set (50–200 cases). Real production inputs, sampled across the actual distribution — not the ten examples you remember. Include the weird ones: empty fields, wrong language, adversarial phrasing, the customer who pastes an entire PDF into a name field.
- A regression set (20–50 cases). Every bug you have ever fixed in this prompt. Each one is a case where the model did something wrong, you patched it, and the patch may have depended on the old model’s specific behaviour.
- A cost-and-latency harness. Tokens in, tokens out, p50 and p95 latency, per case. Cheaper per token is not cheaper per task if the new model is more verbose — and it frequently is.
Scoring matters more than case count. For structured outputs, assert on the schema and the values — exact match, field-by-field. For free text, use a rubric with a model-as-judge, but calibrate the judge against 20 human-labelled examples first and record its agreement rate. A judge you have not calibrated is a random number generator with good manners.
Sampling script sketch: pull 30 days of production requests, stratify by request type and input length, sample proportionally, then hand-label outcomes for the subset where you have ground truth (a user correction, a support ticket, a downstream conversion). Store it as versioned JSONL in the repo, not in a notebook on someone’s laptop.
Step 2: Run the baseline against the model you already have
Run the full eval against your current model first. This is not a formality.
Two things happen here, both valuable. You discover your current accuracy is lower than you assumed — almost always true, and worth knowing regardless. And you establish the number the new model has to beat, rather than the number you wish it had to beat.
Record the baseline with a commit hash, a date, and the exact model version string. Provider model aliases like latest silently move underneath you; pin versions in evals even if you use aliases in production.
Step 3: Run the candidate cold — no prompt changes
Swap only the model. Change nothing else. Resist every instinct to fix the prompt at the same time.
You are measuring one variable. If you tune the prompt and change the model together and the result improves, you have learned nothing about either, and you cannot roll back one without the other.
Expect one of four outcomes:
- Better and cheaper. Rare, delightful. Go to step 5.
- Equal and cheaper. The common case for a within-family upgrade. Go to step 5.
- Slightly worse and much cheaper. Go to step 4 — this is what prompt work is for.
- Much worse. Stop. Record why, with examples. This is a real finding, not a failure.
Step 4: Adapt the prompt, with a budget
Prompts are fitted to models. A prompt refined over eighteen months against one model has absorbed that model’s specific quirks — the phrasing that stopped it rambling, the example that fixed the date format, the all-caps instruction that stopped it apologising.
Give yourself a fixed budget: three iterations, one day. Beyond that, the honest conclusion is that the cheaper model is not suited to this task.
The three highest-yield adjustments, in order:
- Re-fit the output contract. Newer models usually need fewer format instructions and respond better to explicit schemas than to prose descriptions. Delete the defensive scaffolding first — it is often what is hurting you.
- Re-select the few-shot examples. Examples tuned to fix an old model’s failure can actively teach a new model a worse behaviour. Try zero-shot as a control; it sometimes wins outright.
- Move constraints from the prompt into code. Anything you can validate deterministically — enum membership, date ranges, required fields — belongs in a validator with a single retry, not in an instruction you hope the model follows.
After each iteration, re-run the full eval including the regression set. Fixing one case while breaking three older ones is the classic prompt-tuning trap, and only the regression set catches it.
Step 5: Shadow the traffic
Evals tell you about the distribution you thought to sample. Shadow traffic tells you about the distribution you actually have.
Run both models on live requests in parallel for three to seven days. Serve the old model’s output to users. Log both. Compare offline.
Watch four things:
- Disagreement rate. What fraction of live requests produce materially different outputs? Sample 50 disagreements and read them. This is where you find the failure modes your eval set missed — and it is the single highest-value hour in the whole process.
- Tail latency. p95 and p99, not the average. Cheaper models are sometimes slower under load because everyone else migrated to them this week too.
- Actual token ratio. Output length drift is the most common reason a “50% cheaper” model delivers 20% savings.
- Error and refusal rates. Different safety training means different refusal boundaries. A model that refuses 0.3% of your legitimate requests is a support problem you will not see in an eval set.
Step 6: Ramp with a gate at every step
Never flip 100%. Ramp 5% → 25% → 50% → 100%, holding at least 24 hours at each stage — 48 if your workload has a weekly cycle.
Define the rollback trigger before you start, in writing, with numbers. For example: roll back automatically if validation-failure rate rises above 1.5x baseline, if p95 latency exceeds the current SLA, or if the human-review override rate rises by more than 20% relative.
Keep the old model reachable by config for 30 days after full ramp. The cost of leaving a fallback path in place is approximately zero. The cost of not having one, at 2am on a Saturday, is not.
Step 7: Close the loop
Two weeks after full ramp, write down four things: realised cost delta versus projected, realised quality delta versus eval prediction, any incidents, and — most importantly — which eval cases predicted real problems and which did not.
That last item is how the eval suite improves. Add every production surprise to the golden set. The second migration should take half as long as the first, and the fifth should take a day.
Failure modes, ranked by how often they bite
- Migrating without a baseline. You cannot detect a regression against a number you never measured. Most common failure by a wide margin.
- Changing model and prompt together. Guarantees you cannot attribute the result or roll back cleanly.
- Evaluating on curated examples. Your best ten test cases are not your traffic. They are your traffic on a good day.
- Ignoring output-length drift. The cost model assumed a token ratio. Verify it on real traffic.
- Forgetting downstream consumers. Another team parses your output with a regex written against the old model’s phrasing. Find those consumers before the ramp, not during.
- Silent alias drift. You pinned nothing, the provider moved
latest, and your “stable” baseline was never stable. - Migrating the tail. Weeks of work to save hundreds of dollars, while the workload spending real money stays untouched.
The one-page version
- Compute the annualised saving. Under three weeks of engineering cost? Do not migrate.
- Build golden set, regression set, cost harness. Version them in the repo.
- Baseline the current model. Pin the version string.
- Run the candidate cold. One variable.
- Three prompt iterations maximum, then decide.
- Shadow live traffic 3–7 days. Read 50 disagreements by hand.
- Ramp 5/25/50/100 with written rollback triggers.
- Keep the fallback path for 30 days.
- Write the retro. Feed the surprises back into the golden set.
Prices are falling roughly every quarter now. The teams that win are not the ones that switch fastest — they are the ones that built the harness once and can now switch in a day, repeatedly, without anyone noticing.
