Model deployment and monitoring
Choose an inference mode
Deploying means packaging a tested model and its preprocessing with a serving contract. SageMaker AI real-time inference supports interactive request/response; provisioned capacity can cost money even without requests. On-demand serverless inference fits irregular traffic that tolerates startup latency and its feature restrictions. Asynchronous inference queues requests and is suited to longer processing or larger payloads. Batch Transform processes stored input without keeping a serving endpoint running. Verify supported instance types, payload limits, features and regions before selecting a mode.
A serving contract and safe rollout
For the parcel model, accept a numeric nonnegative distance in kilometers and return a binary late flag plus model version. Reject malformed input; keep training and inference feature transformations identical. Track p95 latency, invocation errors, queue age and throughput. Start with a small canary and an explicit rollback plan; SageMaker AI deployment guardrails support eligible real-time and asynchronous endpoints, not every configuration. Configure CloudWatch alarms before relying on automatic rollback. A healthy endpoint is not proof of accurate predictions.
Data drift versus quality drift
Data drift is a change in input distribution, such as longer delivery routes. Model quality drift means predictions become less useful against actual outcomes; labels may arrive days later. Track missing values, input statistics, error metrics and subgroup performance with time windows and sample counts. An input shift is a reason to investigate, not automatic evidence that retraining helps. AWS documentation now states SageMaker Model Monitor is closed to new customers; existing customers may continue. For new designs, review AWS open-source monitoring solutions, scheduled processing or pipelines, CloudWatch and BI dashboards. Verify feature availability before implementing capture.
Practice a release decision
A new model has better aggregate recall but doubles p95 latency above the agreed 200 ms limit. Keep the old version and investigate before increasing traffic. Compare a nightly forecast file (batch) with an interactive shipping screen (real-time or compatible serverless). For drift practice, compare baseline distances [10, 20, 30] to current [30, 40, 50]; the mean rises by 20 km, but no quality metric is known until labels arrive. Use only synthetic or minimized approved data in logs and captures.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Model deployment and monitoring — knowledge check
Reason about ML evaluation, inference and controlled release.
Which mode suits nightly predictions from a stored file?
Which mode suits sporadic requests that tolerate cold starts, subject to feature limits?
What does a shift in input distance distribution establish?
What is required for configured deployment auto-rollback?
What should a new customer do for model monitoring?