MLOps & Cost Best Practices
Make ML repeatable and keep the bill under control.
1 min read
Make it repeatable (MLOps)
- SageMaker Pipelines: define prepare → train → evaluate → register as a workflow that reruns on new data.
- Model Registry: version models, record metrics, and require approval before production.
- Experiments: track parameters and results so you know which run produced which model.
- Model Monitor: alert when live input data drifts away from the training data.
Control costs
- Delete idle endpoints, and use serverless inference for low-traffic models.
- Managed Spot Training for training jobs, with checkpoints so interrupted jobs resume.
- Shut down idle notebooks with Studio's idle shutdown settings.
- Right-size: start small (
ml.m5.large) and move to GPUs only when the model needs them. - Tag resources by project, and set AWS Budgets alerts.
Security
- Keep training data in encrypted S3 buckets, and run jobs inside a VPC for sensitive data.
- Give each job and endpoint a least-privilege execution role.
Tip
Before training a custom model, check whether a Bedrock foundation model with a good prompt already solves the problem. Often it does, with far less work.
Key takeaways
- Pipelines, Model Registry, and Model Monitor make ML repeatable and safe.
- Delete idle endpoints, use Spot training, and enable notebook idle shutdown.
- Encrypt data, use VPCs for sensitive work, and give jobs least-privilege roles.
Check your understanding
Pick an answer to see the explanation.
1. Which change most directly prevents a surprise SageMaker AI bill after experiments?