Principle:Tensorflow Serving Version Label Routing
| Knowledge Sources | |
|---|---|
| Domains | Version_Management, Traffic_Routing |
| Last Updated | 2026-02-13 17:00 GMT |
Overview
An abstraction layer that maps human-readable labels (e.g., "stable", "canary") to specific model version numbers, enabling traffic routing without hardcoded version references.
Description
Version labels decouple clients from specific version numbers. Instead of requesting "version 42", a client requests the "stable" label, and the serving infrastructure resolves this to the correct version number. This enables:
- Zero-downtime promotions: Update the "stable" label from version 42 to 43 without client changes
- Canary traffic: Route a subset of clients to the "canary" label while most use "stable"
- Semantic versioning: Labels convey intent ("production", "staging") rather than arbitrary numbers
Labels are atomically updated: the label-to-version mapping is swapped in a single operation, ensuring no requests are lost during transitions.
Usage
Use version labels in multi-version deployment scenarios where you need to route traffic without exposing version numbers to clients. Labels require that the target version is already loaded (unless allow_version_labels_for_unavailable_models is set).
Theoretical Basis
# Abstract label routing (NOT real implementation)
label_map = {"stable": 42, "canary": 43}
def resolve_request(model_name, label=None, version=None):
if label:
version = label_map[label]
return get_servable(model_name, version)