AI model versioning: keep the model you tested
AI model versioning explained: pin the exact model you tested, keep its test with it, and catch provider changes before they reach your users.
Updated
AI model versioning means keeping a named, fixed version of a model so the output you tested is the output your users get. Hosted APIs can swap the model behind a general name, retire a snapshot on a schedule, or release a new version that handles your inputs differently.
Why a tested model can change under you
A general model name points at whatever snapshot the provider currently serves. New snapshots ship, old ones are retired, and the day you ran your test may not match the version your production traffic uses. A retirement comes with a deadline, so a model that passed last quarter can stop answering with little time to react.
Imagine a lease intake tool that pulls the termination date from each document into a calendar. The team tested it when it was built and shipped it. Later the general name moves to a newer snapshot. No line of code changed, but the new version writes some dates in a different format for leases with renewal options, and the calendar fills with reminders on the wrong days. Nobody noticed until a landlord asked why a reminder had arrived on a Sunday. For the retirement side of this, read what happens when your API model is shut off.
Pin the exact version you tested
Point your calls at the dated snapshot identifier the provider publishes, not at a floating alias. Keep the identifier in one config file, next to the test results that used it. Then a version change becomes a release: you run the test on the new version, compare scores, and ship only if the new one wins.
The common failure is a string copied into several places. One service gets the new identifier, another keeps the old one, and the two halves of your product now disagree about which model they are running. Search the repository for every use of the identifier before a switch, and let the config file be the only place it is written. A pinned identifier also makes a code change show exactly which version moved, which turns a vague report that the output got worse into a diff you can review.
Keep the test with the version
A version number means little without the test that scored it. Build the test from your real inputs, score the current model first, and save the test set, the prompt, the scoring code and the results together under one version tag. Split by document, never by chunk, so the same source material never sits in both training and testing. A chunk split lets near-duplicate passages from one document land on both sides and inflates the score.
Our public contract extraction exam uses 510 commercial contracts with 5-fold cross-validation, so every document is scored by a model that never trained on it. Our Accuracy model scored 0.717 against 0.635 for Claude Opus, which had one prompt, no examples and no task training. See the full results for every score, and note that this is a research measure of extraction, not legal advice.
For the lease tool, the test should hold a few hundred real leases from intake, labeled by the people who do the job today. Include the awkward cases on purpose: leases with renewal options, amendments that change a date, and scanned pages with a stamp over the field. A test made only of clean examples will score well and tell you nothing about the version that fails in production.
For a step-by-step method to build a test like this, see how to test an LLM on your own data before you switch.
Record each version, including the ones you rejected
Write one record per version, and keep failed runs too. A failed run explains why the current version is still live. For the lease tool, a record reads like this:
- Identifier: the dated snapshot string, copied from the config file.
- Live since: the date the switch shipped and the date it was retired.
- Test: the set name, its version tag and its size.
- Scores: one line per document type (leases, amendments, scanned pages), not only the average, since an average can hide a regression in one kind of input.
- Settings: the prompt version, the output format and any decoding settings.
- Decision: who approved the switch, the result against the live version, and the step that rolls it back.
Keep the previous version deployable until the new one has run on real traffic long enough for you to trust it. Rollback should be a config change, not a rebuild. Run the rollback once in a test environment, so the first real rollback is not also the first time it runs.
When you own the weights, the version is a file you control. Tag each trained model, and store the training data version, the random seed and the test score beside the weights. Our process requires that a newly trained model beat the current model on the customer’s own test before it is deployed. If it does not, the current version stays in place and the failed run is logged. The own-your-model-weights guide covers why that matters for control.
Common mistakes to avoid
- Testing on the examples used to write the prompt. The prompt was tuned on them, so the score measures memory of the prompt, not the task.
- Deleting failed runs. The rejected candidate is the record of what you already learned.
- Changing the test set to rescue a result. Once the test changes, old and new scores no longer compare, and the record has to say so.
- Trusting a dated identifier to last. It pins your calls, but the provider still sets the retirement date, so watch its deprecation notices.
Start with the names in your code
Versioning starts with knowing which model names your code calls today. The free AI cost audit lists the AI calls in a repository, the models they use, and flags calls to retired models. It reads your code as text on your machine and uploads nothing.
Our team can help set this up for one task. Own Weights maps your AI spend by task from code and invoices, then builds a test from your real data and scores the current model first. Use the Book a free audit button on this page to start.
Questions
How do I stop a hosted AI provider from changing my model?
You cannot stop a provider from releasing new snapshots, but you can stop your traffic from following them. Point calls at a dated identifier and move to a new one only through a release that includes a fresh test run. Watch the provider's deprecation notices so a retirement does not arrive as a surprise.
Should production use a pinned model version or the latest one?
Production work with a fixed output format and a known accuracy bar should use a pinned version. The latest version is fine for experiments, where a change in output costs little. Switch to a newer version only when it scores higher than the pinned one on your own test.
Can I version a model that I host myself?
Yes. Tag each trained model and keep its weights, training data version, random seed and test score together. To roll back, serve the previous tag, which requires no retraining.