akanjilal.dev
Back to reference architectures
Reference architectureAmazon SageMakerca-central-1 and ca-west-1

Model lifecycle and governance on SageMaker

A model in production is more than a file. It makes decisions that affect people, and its behavior drifts as the world it was trained on changes. This reference architecture treats the whole lifecycle, from training through approval to monitoring, as one governed pipeline on Amazon SageMaker, with a central registry as the single source of truth, documentation attached to every version, bias and explainability assessed before anything advances, approval as a hard gate, and drift watched continuously, all spread across two regions and separated across accounts so that the people who build models cannot deploy them without review.

In a regulated setting, accuracy is rarely the main question. What matters is whether you can show how the model was built, what it was tested for, who approved it and on what evidence, what it is allowed to be used for, and how you would know if it started to behave differently. A pipeline that produces a good model but cannot answer those questions has not finished the job. This design makes the answers a by-product of how the work is done, rather than something assembled after the fact for an audit.

Requirements

The requirements the platform has to satisfy, the quality attributes it is judged on, the constraints it must respect, and the assumptions it rests on.

Functional requirements

NumberRequirement
1Build and train models through a repeatable pipeline rather than by hand.
2Evaluate every candidate for accuracy, for bias, and for explainability before it can advance.
3Register every model as a versioned package with its documentation attached.
4Require a named reviewer to approve a version before it can be deployed.
5Deploy only approved versions, and record which version is in production.
6Monitor every deployed model for drift and alert on deviation.
7Keep one central and auditable record of every model and its approvals.

Quality attributes

NumberAttributeIntent
1AuditabilityReconstruct the full history of a model, who approved it and on what evidence, retained for at least one year.
2Separation of dutiesThe people who build models cannot deploy them to production unreviewed.
3ReproducibilityRebuild a model and its evaluation from source.
4ResponsibilityBias and explainability are assessed and recorded for every model.
5ReliabilityServe inference across two regions and tolerate a regional failure.
6OperabilityDetect drift and act on it before it harms outcomes.

Constraints and assumptions

NumberConstraint
1Data and models remain within Canada and the two approved regions.
2The platform sits inside the landing zone and uses its accounts, keys, and logging.
3A model must carry a documented intended use and a risk rating before production.
4Managed SageMaker services are preferred over self managed training and serving.
NumberAssumption
1Training data is governed and access controlled within the landing zone.
2Reviewers and approvers are defined roles with the authority to sign off.
3Models are served as endpoints rather than embedded inside applications.

Architecture decisions and rationale

The decisions that shaped the platform, each with the alternative that was set aside and the cost that was accepted.

1. The model as a governed artifact in a registry rather than a file

Decision. Treat every model as a versioned package in the SageMaker Model Registry, which is the single source of truth for what exists and what is approved.

Alternatives. Storing model files in object storage and tracking their status in a spreadsheet or a wiki.

Rationale. A registry gives every model a version, an approval status, attached documentation, and a lineage, which is what makes governance possible at all. This serves functional requirements 3 and 7 and the auditability attribute.

Consequences. Teams must register models rather than copy files, which is the intended discipline.

2. Three accounts for build, governance, and production rather than one

Decision. Separate the development account where models are built, the governance account that holds the registry and the evidence, and the production account that serves them.

Alternatives. Doing all of it in one account with permissions to separate the activities.

Rationale. An account boundary is the strongest separation of duties available, so a data scientist building a model has no path to deploy it to production, and the central record of approvals lives in an account that neither the builders nor the operators can quietly change. This serves the separation of duties attribute and functional requirement 5.

Consequences. Models, cards, and evidence are shared across accounts through Resource Access Manager, which is a small amount of additional setup.

3. Approval as a hard gate rather than a guideline

Decision. Make the deployment pipeline refuse to deploy any version whose approval status is not approved.

Alternatives. Asking teams to follow an approval process by convention.

Rationale. A gate enforced by the pipeline cannot be skipped under deadline pressure, where a convention always can. This serves functional requirement 4.

Consequences. An unapproved model cannot reach production even in an emergency, which is the intended behavior.

4. Model Cards attached to the version rather than separate documentation

Decision. Capture the intended use, the risk rating, the training details, and the evaluation results in a SageMaker Model Card linked to the exact model version.

Alternatives. Maintaining documentation in a separate system that can fall out of step with the model.

Rationale. Documentation attached to the version cannot drift away from the thing it describes, and it travels with the model through approval and deployment. This serves constraint 3 and the auditability attribute.

Consequences. A version is not complete until its card is filled in, which is enforced as part of registration.

5. Bias and explainability in the pipeline rather than as an afterthought

Decision. Run SageMaker Clarify as a step in the pipeline, so that every candidate is assessed for bias and for feature attribution before it can be registered as a passing version.

Alternatives. Assessing fairness only when someone asks, usually after deployment.

Rationale. Responsibility checks that run automatically on every model are consistent and create evidence, where manual checks are infrequent and create gaps. This serves the responsibility attribute and functional requirement 2.

Consequences. The pipeline takes longer because it always evaluates, which is accepted for the evidence it produces.

6. Continuous drift monitoring rather than periodic review

Decision. Run SageMaker Model Monitor on every endpoint, watching data quality, model quality, bias drift, and feature attribution drift, with alerts on deviation.

Alternatives. Reviewing model performance on a schedule by hand.

Rationale. A model degrades continuously as the world changes, so the monitoring has to be continuous to catch it before it harms outcomes. This serves functional requirement 6 and the operability attribute.

Consequences. Monitoring jobs and a baseline must be maintained for each model, which the Model Dashboard tracks and flags when missing.

7. The same approved model in two regions rather than one

Decision. Replicate the approved model package and its evidence to the second region and serve from a warm standby endpoint there.

Alternatives. Serving from a single region.

Rationale. A failover must not change which version is in production or weaken the audit trail, so the same approved package and the same evidence exist in both regions. This serves the reliability attribute.

Consequences. A standby endpoint carries a running cost, kept low by scaling it up only on failover.

The lifecycle as a pipeline

The work moves in one direction through a pipeline, and two of its steps are gates rather than tasks. A model is built and trained, evaluated for accuracy and fairness, registered as a version with its card, approved by a named reviewer, deployed only if approved, and then monitored. Registration and approval are the gates. A version that has not been approved cannot be deployed, and the documentation that justifies the approval is attached to that exact version for the life of the model.

A six step model pipeline from build and train through evaluate, register, approve, deploy, and monitor
The lifecycle. Registration and approval are gates, so evidence and sign off are produced as part of the work rather than reconstructed later.

The registry entry carries the approval status and points at the evidence, so that the gate is a simple and unambiguous check. A representative entry shows a version waiting for approval, with its intended use and risk rating recorded and its bias and explainability reports stored in the governance account.

{
  "ModelPackageGroupName": "payments-risk-scorer",
  "ModelPackageVersion": 7,
  "ModelApprovalStatus": "PendingManualApproval",
  "CustomerMetadataProperties": {
    "intended-use": "Score the risk of a single transaction in real time",
    "risk-rating":  "High",
    "owner":        "fraud-platform"
  },
  "ModelMetrics": {
    "ModelQuality":   { "areaUnderCurve": 0.94 },
    "Bias":           { "reportPath": "s3://lz-ml-governance-evidence/clarify/v7/bias.json" },
    "Explainability": { "reportPath": "s3://lz-ml-governance-evidence/clarify/v7/shap.json" }
  }
}

Separation across accounts

The lifecycle is spread across three accounts so that no single team holds the whole chain. Models are built in the development account, the registry and the model cards and the evidence live in the governance account, which is the source of truth, and only approved versions are deployed into the production account. The registry and the cards are shared from the governance account using Resource Access Manager, so the governance account can see and audit everything while remaining the only place where approval status is set.

Three accounts, development, governance, and production, with the registry and cards in the governance account as the source of truth
Separation of duties by account. The governance account is the single source of truth for what is approved, and it is the only place where approval happens.

Serving in two regions

The approved model serves from both regions. The model artifact and the governance evidence are replicated to the second region, an endpoint runs warm there, and Amazon Route 53 directs inference to the healthy region. Model Monitor runs in each region against the same baseline, so a failover changes neither the version in production nor the strength of the monitoring.

The approved model served from ca-central-1 and ca-west-1 with replicated artifacts, monitoring in each region, and Route 53 routing
The same approved model in two regions, with the same evidence and the same monitoring, so a regional failure does not weaken governance.

The result is a platform where the model that serves a real decision is always a known, approved, documented, and monitored version, in either region, and where the evidence for all of that is a by product of how the work is done rather than a burden added at the end.

References

  1. Amazon Web Services, machine learning governance with Amazon SageMaker.https://aws.amazon.com/sagemaker/ai/ml-governance/
  2. Amazon Web Services, SageMaker Model Registry.https://docs.aws.amazon.com/sagemaker/latest/dg/model-registry.html
  3. Amazon Web Services, SageMaker Model Cards.https://docs.aws.amazon.com/sagemaker/latest/dg/model-cards.html
  4. Amazon Web Services, SageMaker Clarify for fairness and explainability.https://docs.aws.amazon.com/sagemaker/latest/dg/clarify-fairness-and-explainability.html
  5. Amazon Web Services, SageMaker Model Monitor.https://docs.aws.amazon.com/sagemaker/latest/dg/model-monitor.html
  6. Amazon Web Services, SageMaker Pipelines.https://docs.aws.amazon.com/sagemaker/latest/dg/pipelines.html
  7. Amazon Web Services, cross account sharing of SageMaker Model Cards.https://aws.amazon.com/about-aws/whats-new/2023/08/amazon-sagemaker-model-cards-cross-account-sharing-model-cards/