skillfed

sagemaker-training

Open source library for creating containers to run on Amazon SageMaker.

sagemaker-training v5.1.1 319.3K downloads/30d#7,646 on PyPI530
Permissive license Apache License 2.0 AGING released

What it is and what it does

SageMaker Training Toolkit is a library that bridges custom training code and Amazon SageMaker's containerized training infrastructure. It runs inside a Docker image and handles the plumbing between SageMaker's training job orchestration and your training script—reading hyperparameters, environment variables, input channels, and model output paths from SageMaker's standard locations, then executing your entry point with the correct arguments and environment.

You write a training script (Python or shell), package it in a Dockerfile with this library, and push the image to ECR or run it locally. When SageMaker launches a training job with that image, the toolkit automatically exposes training data paths, hyperparameters, and system info as environment variables and command-line arguments, then runs your script. It's designed for teams building custom training containers that need to integrate with SageMaker's managed training service rather than using pre-built framework images.

Use it for:

  • Build a custom training container for a proprietary ML framework or training pipeline not covered by SageMaker's pre-built images.
  • Pass hyperparameters and input data channels from SageMaker training jobs into your training script without manual environment parsing.
  • Create a Docker image that reads training data from S3 via SageMaker channels and writes trained models to the correct output directory.
  • Execute shell or Python entry points with automatic argument and environment variable injection from SageMaker's hyperparameters.json and inputdataconfig.json.
  • Run training jobs locally using Docker before deploying to SageMaker's managed infrastructure.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Integrates training scripts into Docker containers for use with Amazon SageMaker, handling environment setup, hyperparameter passing, and entry point execution within containerized training jobs.

Yes, if you are building custom training containers for SageMaker. The package is stable (Production/Stable classifier, 530 GitHub stars, no known vulnerabilities) and solves a real integration problem—it eliminates boilerplate for reading SageMaker's training configuration. High install friction (source distribution only) and aging maintenance (326 days since release) are acceptable trade-offs given the narrow, specialized use case. Not worth installing if you use SageMaker's pre-built framework images or train outside SageMaker.

Install

sagemaker-training on PyPI

pip

pip install sagemaker-training

uv

uv add sagemaker-training

poetry

poetry add sagemaker-training

Installing sagemaker-training

Before you install

High install friction due to source distribution only. Package is aging (326 days since release) but maintained; last commit 2026-01-16. No runtime dependencies, but requires Docker and SageMaker integration context to be useful.

License in practice

Licensed under Apache License 2.0 (permissive). Safe for commercial and open-source use with standard attribution requirements.

Quickstart

# In Dockerfile:
RUN pip install sagemaker-training
COPY train.py /opt/ml/code/train.py
ENV SAGEMAKER_PROGRAM train.py

# In training script:
from sagemaker_training import environment, entry_point
env = environment.Environment()
args = env.to_cmd_args()
entry_point.run(uri=env.module_dir, user_entry_point=env.user_entry_point, args=args, env_vars=env.to_env_vars())

Requires Docker and SageMaker infrastructure; training script must be located at /opt/ml/code; intended for use within SageMaker training jobs, not standalone Python environments.

Verify before relying

  • Whether the package works with Python versions beyond 3.8, 3.9, 3.10 (classifiers list these but requires_python is unspecified)
  • Current state of example notebooks and documentation links referenced in the description

Package facts

License Apache License 2.0 (permissive)
Python support not specified
Install friction high — source build required
Runtime dependencies none
Maintenance aging — 326 days since the last release
Last repo commit
First released
Downloads 319,256/month — #7,646 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: sagemaker_training-5.1.1.tar.gz

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseNatural Language :: EnglishProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

sagemaker docker training containerml model training in dockersagemaker training toolkitcontainerized machine learning trainingaws sagemaker custom containersdocker entry point for ml trainingsagemaker hyperparameter passing
sagemaker-integrationdocker-trainingaws-ml

More Artificial Intelligence packages

litellm

LiteLLM provides a unified Python interface to…

permissive · top 100 on PyPI

huggingface-hub

Client library and CLI tool for downloading,…

permissive · top 100 on PyPI

langchain

LangChain provides a framework for building…

permissive · top 1,000 on PyPI

hf-xet

hf-xet provides chunk-based deduplication and…

permissive · top 1,000 on PyPI

tokenizers

Tokenizers converts raw text into token…

permissive · top 1,000 on PyPI

transformers

Transformers provides a unified framework for…

permissive · top 1,000 on PyPI

sagemaker-containers

Provides tools to build Docker containers…

permissive · top 15,000 on PyPI

sagemaker-experiments

Tracks machine learning experiments, trials,…

permissive · top 15,000 on PyPI

sagemaker-inference

Provides a model serving stack for deploying…

permissive · top 15,000 on PyPI

sagemaker-train

Trains and deploys machine learning models on…

unclear · top 5,000 on PyPI

smdebug-rulesconfig

Provides preconfigured rule definitions and…

permissive · top 5,000 on PyPI

sagemaker

SageMaker Python SDK is a library for training…

permissive · top 5,000 on PyPI

sagemaker-data-insights

Computes ML-relevant statistical summaries of…

unclear · top 15,000 on PyPI

sagemaker-serve

Provides model serving and deployment…

permissive · top 5,000 on PyPI

sagemaker-core

sagemaker-core provides an object-oriented…

permissive · top 5,000 on PyPI

model-hosting-container-standards

Provides standardized FastAPI-based handlers…

permissive · top 5,000 on PyPI