SageMaker SDK v3 Lets Teams Change Model Code Without Rebuilding Container Images
The new workflow treats the container as a reusable runtime and sends local code into it when a job starts. That can shorten script-level iteration, while leaving teams responsible for images, permissions and storage.
Listen to this story
The audio brief
Story brief
3 key pointsAWS’s SageMaker Python SDK v3 changes the deployment workflow by letting teams keep framework libraries, system packages, and CUDA dependencies in an image while iterating on training or inference code from a local directory. The unified ModelTrainer and ModelBuilder interfaces cover training and serving, including managed endpoints and local testing. Teams still need an image, IAM permissions, S3 storage, and...
- 01
SourceCode syncs local modules, configuration, shell scripts, and launch instructions into the selected container at job startup.
- 02
ModelTrainer replaces framework-specific training classes such as SKLearn, PyTorch, and XGBoost in SDK v3.
- 03
ModelBuilder packages inference handlers with model artifacts and supports managed endpoints, local containers, or in-process testing.
SageMaker users can now revise local training or inference code and rerun their workflow without rebuilding the container image. The change comes from the SageMaker Python SDK v3’s SourceCode configuration, which syncs a local directory into a selected container when training or deployment begins.
AWS’s redesign separates application code from the runtime that executes it. Teams still bring an image from Amazon ECR, but it may be a user-built image, an AWS Deep Learning Container or a third-party image. That image can retain the system packages, framework libraries and CUDA dependencies a workload needs.
A source directory becomes part of the job
SourceCode takes a local source directory and either a command for training or an entry script for inference. At launch, SageMaker copies that directory into the container. The directory can include supporting modules, configuration files and shell scripts, allowing those components to change independently of the image.
Training and serving use different launch instructions
ModelTrainer configures and launches a training job using the chosen image and a SourceCode command. ModelBuilder uses the same directory-based pattern for inference, then packages the handler with the model artifact. It can target a managed SageMaker endpoint or run in a local container or the current Python process for testing.
SourceCode(
source_dir="./train/random_forest",
command="python random_forest.py",
)The redesign does not eliminate the surrounding setup
AWS demonstrates the workflow with a scikit-learn Random Forest deployment and a Stable Diffusion 3.5 LoRA fine-tuning job using Hugging Face Accelerate for distributed multi-GPU training. The examples show the same API pattern spanning conventional machine learning and generative-model work.
What teams still need to provide
- SageMaker access, an IAM execution role with SageMaker and S3 permissions, and the SDK v3 installation.
- A training image pushed to Amazon ECR and an S3 bucket for training data and model artifacts.
Sources
- aws.amazon.comBring your own model with Amazon SageMaker AI: Script mode in SDK v3 | Amazon Web Services