Inference contracts, versioning and monitoring
What it is
Deployment freezes a model artifact, tokenizer or preprocessing, runtime dependencies, and input/output schema into one versioned inference contract. A serving system validates requests, bounds size and rate, batches compatible work when useful, applies timeouts, records versions, and supports rollback to a known-good release. Monitoring covers latency, errors, resource use, input drift, output behaviour, safety signals, and delayed quality labels; each measure needs an owner and a response threshold. Offline evaluation, shadow traffic, canary rollout, and rollback are successive ways to limit the blast radius of a bad release.
Why it matters
A model that is accurate offline can fail in production from preprocessing skew, changed inputs, resource exhaustion, or a silent version mismatch. The surrounding system is part of model correctness because it determines the actual tensors the model sees and the conditions under which users receive its result. A reproducible artifact and a monitored feedback loop turn deployment from a one-time upload into an operating discipline.
In the real world: Clear inputs, outputs and versions, so apps that use a model don't break when it changes.
Visual example
Deep learningThe deployed model includes every transformation needed to reproduce its training-time inputs and outputs.
ARTIFACT = {
'model_version': 'ranker-2026.09.4',
'weights': 'ranker-2026.09.4.safetensors',
'tokenizer_hash': 'a1b2c3d4e5f6',
'preprocessing': 'normalise_v3',
'input_schema': {'text': 'str', 'locale': 'str'},
'output_schema': {'score': 'float', 'model_version': 'str'},
'torch_version': '2.5.1',
}
def predict(request):
validate(request, ARTIFACT['input_schema'])
return {'score': float(model(encode(request))), 'model_version': ARTIFACT['model_version']}Saving only weights. Without the exact tokenizer, normalization statistics, label mapping, and model configuration, the same weights may make different—and wrong—predictions in production.