TLDRocket
Sign in

Bring your own model with Amazon SageMaker AI: Script mode in SDK v3

Amazon Web Services Bobby Lindsey

AWS SageMaker AI’s SDK v3 lets you bring your own model without rebuilding Docker images. It swaps framework-specific pieces for one path across training and deploy.

Based on reporting by Amazon Web Services, Bobby Lindsey — read the original for the full story.

Summary, retelling and take written by AI under human oversight; images are AI-generated illustrations. How we work · Report an error

AWS has rewritten how its SageMaker Python SDK handles custom models. The new v3 release moves away from the old framework-specific pattern and folds a lot of the ceremony into two main classes: ModelTrainer for training and ModelBuilder for deployment. The big idea is simple. Keep your code in a local directory, keep your container image separate, and let SageMaker sync the source at runtime.

That was the point of the 2021 script mode post, but v3 pushes it further. Instead of SKLearn, PyTorch, XGBoost, and friends each having their own estimator class, there’s now one training interface. The same goes for deployment: ModelBuilder replaces the old Model/Predictor split, and prediction is handled through invoke(). The SDK’s SourceCode object carries the local source_dir plus either a command for training or an entry_script for inference.

AWS shows the pattern with two end-to-end examples. One trains a scikit-learn Random Forest on the diabetes dataset and serves it with DJL Serving at a real-time endpoint. The other fine-tunes Stable Diffusion 3.5 with LoRA using Hugging Face Accelerate for multi-GPU distributed training. Both use the same workflow: point to an image in Amazon ECR, sync the code at launch, and let the container stay focused on runtime rather than baked-in application logic.

That separation is the real story here. The training container in the scikit-learn example is deliberately minimal: a Python 3.13-slim base, a few system packages, requirements installed, and no model code inside it. Change the script, rerun, and don’t rebuild the image. AWS also calls out warm pools through keep_alive_period_in_seconds, so iterative reruns can start faster, and optional MLflow logging if you want experiment tracking.

For deployment, ModelBuilder packages the inference handler with the model artifact and hands it off to the chosen server. In the example, that server is DJL Serving, and the inference code follows its handle(inputs) pattern. AWS also shows a model-loading flow that happens once at cold start, then reuses the loaded model across requests. That’s the right call, because nobody needs a model reloaded on every request unless they enjoy latency for its own sake.

My take — AI-written commentary, not fact-checked reporting

This is the sort of boring infrastructure cleanup that actually matters. One API for training and deployment is less sexy than a new model, but it’s the kind of simplification that saves real teams from living in Dockerfile purgatory. AWS is betting that fewer special cases will beat framework vanity every time, and it probably will.

Read more about this at: Amazon Web Services

Related stories

The daily briefing

Every AI story that matters, in your inbox by 8am.

TLDRocket reads all relevant sources, removes duplicate coverage, and summarises the day in two minutes. Follow companies and topics for alerts, or get the briefing in Slack. Free, no spam, unsubscribe anytime.