Forward compatibility means allowing new code or clients to work with an older API version without changes. In ML systems, it also depends on versioning the model and its surrounding pipeline. section 13.1
Treat compatibility as a system-design responsibility:
- Expose parameters that affect prediction when callers need control; hidden time or seed values make outputs difficult to reproduce. section 13.1
- Version models and provide a way to request a specific version during initialization. section 13.1
- Treat changes to models, data input/output, preprocessing, postprocessing, or dependencies as possible compatibility breaks, and reflect them in versioning. section 13.1
Listing 13.3 Adding a model version to the API
class Model:
def __init__(self, version):
self.version = version
self.model = load_model(version)
def predict(self, features, time=None, seed=42):
if time is None:
time = datetime.now()
return self.model.predict(features, time, seed)
Shows how a prediction API selects a model by version while retaining controllable prediction parameters. section 13.1




