Pin the model version per batch
A deploy in the middle of a batch raises a quieter problem.
A deploy rolls the workers halfway through an eval batch. Without pinning, what does the eval measure?
| A deploy rolls the workers halfway through an eval | |
|---|---|
| without pinning | about half the requests run on build v1, and the rest on v2 |
| pinned at submit | batch b1 runs on v1 only, and v1's replicas stay up until every batch pinned to it has ended |
Picture a deploy rolling workers to a new model build while a 100,000-request eval is half done. Half its answers come from each model, and the comparison the customer is running is quietly worthless.
Pin the version per batch. At submit, resolve the model name to an exact snapshot and serving configuration. Store it on the batch, and route its requests only to replicas serving that version.
Anthropic's public model IDs work this way: the model behind an ID stays the same for as long as that ID exists. Its batch docs pin the API version too: results use the API version of the request that created the batch.
Deploys then become a capacity question. A new version gets new replicas. The old ones stay up until every batch pinned to them has ended, up to 24 hours plus in-flight work.
Count the serving configuration as part of the version, along with the weights, because sampling code, compilers and routing rules change outputs too. The production incident lesson, on three overlapping bugs, is a real example.
In the editor, replicas maps each replica to the model version it serves, and each batch carries its pinned version and whether it ended. Write route(batch, replicas): the replicas serving the batch's version. Then write can_retire(version, batches): true once every batch pinned to that version has ended.
- 1
Write
route(batch, replicas): the replicas serving the batch's pinned version. - 2
Write
can_retire(version, batches): true once every batch pinned to that version has ended.
Run your code to check it. Output shows here.