Register & govern
Model Registry
Adds versioning, approval and promotion controls around model artifacts.
artifact + serving image/spec + metrics + lineage
versioned model package with approval state
Registry gives me a governed promotion point between experimentation and production deployment.
Mental model
What this means before worrying about syntax.
Register candidate versions, attach metadata and metrics, use approval states and promote the selected model into deployment.
- Registry stores governed candidate versions; it does not train or serve them.
- A model version should point to evidence: artifact, metrics, lineage and approval state.
- Deployment should target an immutable version, not a vague latest model.
candidate artifact -> model package/version -> approval -> deployment
Implementation anatomy
The sequence you would actually build or configure.
- 1
Create logical model/package group.
- 2
Register candidate artifact.
- 3
Attach evaluation metadata.
- 4
Set approval state.
- 5
Promote approved version through deployment workflow.
- 6
Keep rollback target/history.
Concrete example
A real model-development or production flow.
ComplaintClassifier v17: TF-IDF LR, macro F1 .91, PendingManualApproval
v18: transformer, macro F1 .93, higher p95 latency
Review selects v17 because quality gain does not justify latency/cost
Implementation lab
Concrete code, data manipulation and configuration for this lifecycle step.
Register via boto3 when you want the service-level mechanics to be explicit
Using boto3 here is useful learning: the governed version references an inference container + model artifact and starts in an approval state.
import boto3
sm = boto3.client("sagemaker")
resp = sm.create_model_package(
ModelPackageGroupName="ComplaintClassifier",
ModelPackageDescription="TF-IDF logistic regression candidate",
InferenceSpecification={
"Containers": [{
"Image": INFERENCE_IMAGE_URI,
"ModelDataUrl": MODEL_ARTIFACT_S3_URI,
}],
"SupportedContentTypes": ["application/json"],
"SupportedResponseMIMETypes": ["application/json"],
"SupportedRealtimeInferenceInstanceTypes": [
"ml.m5.large", "ml.m5.xlarge"
],
},
ModelApprovalStatus="PendingManualApproval",
)
model_package_arn = resp["ModelPackageArn"]
print(model_package_arn)
Promote a reviewed version
sm.update_model_package(
ModelPackageArn=model_package_arn,
ModelApprovalStatus="Approved",
ApprovalDescription=(
"Passed macro-F1, category recall, latency and "
"auto-route error-rate gates."
),
)
Design decisions that matter
- Who can approve.
- Required evidence.
- Environment promotion model.
- Rollback/version retention.
Common failure modes
- Registry approval does not itself deploy.
- Newer version is not automatically better.
- Missing lineage weakens reproducibility/governance.
Production readiness check
Items to close before treating this step as production-ready.