amazon-sagemaker-examples
llms.txt11k starsChanged 3 months agoApache-2.0View on GitHub
Example notebooks for building, training, and deploying models with the Amazon SageMaker Python SDK v3. This repository targets v3 only; pip install sagemaker installs v3. SDK v3 is modular (sagemaker-core, sagemaker-train, sagemaker-serve, sagemaker-mlops) and is not backward compatible with v2. v2 examples are archived, not maintained. This file follows the llms.txt convention (https://llmstxt.org): a curated index plus explicit instructions so AI coding agents generate correct, current (v3) code. - SDK-first: for any SageMaker task (train, deploy, process, pipelines), use the…
- Installs packages
Trending
Quiet this year.about the whole repository
Who's talking about aws/amazon-sagemaker-examples
- plotly/jupyter-dash“AWS SageMaker”GitHub · Oct 6, 2020 · 7 reactions
- aws/sagemaker-python-sdk“ModelTrainer Local Mode PermissionError: [Errno 13] Permission denied: 'sm_drivers'”GitHub · Feb 27, 2025 · 3 reactions
- hashicorp/terraform-provider-aws“F/Add model_package_name for aws_sagemaker_model”GitHub · Jun 4, 2023 · 3 reactions
- aws/sagemaker-python-sdk“Error when running hyperparameter tuning job locally”GitHub · Oct 19, 2020 · 2 reactions
- philschmid/easyllm“Streaming support in Sagemaker?”GitHub · Aug 17, 2023 · 1 reactions
The biggest 5 of 22 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 22
Talked about on GitHub (22 times).
On GitHub · 22
- Oct 6, 2020AWS SageMaker — plotly/jupyter-dash7 reactions · 15 comments
- Feb 27, 2025ModelTrainer Local Mode PermissionError: [Errno 13] Permission denied: 'sm_drivers' — aws/sagemaker-python-sdk3 reactions · 1 comment
- Jun 4, 2023F/Add model_package_name for aws_sagemaker_model — hashicorp/terraform-provider-aws3 reactions · 5 comments
- Oct 19, 2020Error when running hyperparameter tuning job locally — aws/sagemaker-python-sdk2 reactions · 5 comments
- Aug 17, 2023Streaming support in Sagemaker? — philschmid/easyllm1 reaction · 1 comment
17 more on GitHub
- Jun 22, 2021Custom `model_fn` function not found when extending the PyTorch inference container — aws/sagemaker-inference-toolkit1 reaction
- Oct 6, 2020Model and output files do not get saved to S3 when training own model — aws/sagemaker-training-toolkit1 reaction · 5 comments
- Jan 31, 2025SageMaker Unified Studio: default_bucket returning incorrect bucket and default_bucket_prefix returning None from sagemaker_core python SDK — aws/sagemaker-core0 reactions · 1 comment
- Dec 4, 2024Server reruns same task multiple times — aws/sagemaker-huggingface-inference-toolkit0 reactions
- Oct 11, 2023Structure for custom entrypoint inference script and its overridden methods for DJLModel — aws/sagemaker-python-sdk0 reactions · 1 comment
- Aug 23, 2023Update README.md — awslabs/sagemaker-debugger0 reactions
- Jul 19, 2023error in code — johnny-chivers/sagemakerCode0 reactions
- Mar 2, 2023Domain Specific: Feature Sets — SuperCowPowers/workbench0 reactions
- Feb 8, 2023[bug] tensorflow inference container, python service is not enabled even though insert environment variable SAGEMAKER — aws/deep-learning-containers0 reactions · 2 comments
- Dec 7, 2022【时间序列】时间序列预测算法总结 - 知乎 — liuwa666/webclipper0 reactions
- Dec 7, 2022【时间序列】时间序列预测算法总结 - 知乎 — liuwa666/webclipper0 reactions
- Oct 28, 2022Training metrics not being recorded in Sagemaker Experiments — aws/sagemaker-experiments0 reactions
- May 11, 2022Batch Inference does not work when using the default handler — aws/sagemaker-pytorch-inference-toolkit0 reactions
- Feb 17, 2022[bug] Docker File not building in scikit_bring_your_own example — aws/deep-learning-containers0 reactions · 2 comments
- Sep 15, 2021Impossible to deploy on sagemaker, a random forest model with a custom container — aws-samples/amazon-sagemaker-custom-container0 reactions
- Oct 25, 2020Python随身听-2020-10-25技术精选 — pythonradio/pythonradio.github.io0 reactions
- Oct 16, 2020Python随身听-2020-10-16技术精选 — pythonradio/pythonradio.github.io0 reactions
In this repositoryOne other file it gives its agents.
- AGENTS.mdAGENTS.md
The file
We split this llms.txt into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 22
Default to SageMaker Python SDK v3.
- Distinctive: line 33
After generating SageMaker code, validate it contains none of the v2 patterns above.
- Very specific: line 35
No hardcoded account IDs, role ARNs, regions, or bucket names.
≈ “Common” is an estimate: at least 1 in 5 of the 1,484 llms.txt files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
# Amazon SageMaker Examples
> Example notebooks for building, training, and deploying models with the Amazon SageMaker
> Python SDK **v3**. This repository targets **v3 only**; `pip install sagemaker` installs v3.
> SDK v3 is modular (`sagemaker-core`, `sagemaker-train`, `sagemaker-serve`, `sagemaker-mlops`)
> and is not backward compatible with v2. v2 examples are archived, not maintained.
This file follows the llms.txt convention (https://llmstxt.org): a curated index plus explicit
instructions so AI coding agents generate correct, current (v3) code.
## Instructions for LLM agents (SageMaker Python SDK)
- **SDK-first:** for any SageMaker task (train, deploy, process, pipelines), use the
**SageMaker Python SDK v3** as the primary interface. Do not drop to raw `boto3`
(`create_training_job`, `create_endpoint`), the AWS CLI, or hand-rolled framework scripts
unless the user explicitly asks. Intent → interface:
- "train / fine-tune / training job / serverless training" → `sagemaker.train.ModelTrainer` (`.train(...)`)
- "deploy / host / real-time or serverless or async endpoint" → `sagemaker.serve.ModelBuilder` (`.deploy(...)`)
- "process data / feature engineering / preprocess" → `sagemaker.core.resources.ProcessingJob`
- "pipeline / orchestrate / MLOps" → `sagemaker.mlops.pipeline.Pipeline`, `sagemaker.mlops.steps`
- "container image URI" → `sagemaker.core.image_uris.retrieve(...)`
- Default to SageMaker Python SDK **v3**.
- **Never** emit these v2 patterns unless the user explicitly asks for "v2":
- `from sagemaker.estimator import Estimator` → use `from sagemaker.train import ModelTrainer`
- framework estimator classes (`from sagemaker.pytorch import PyTorch`, TensorFlow, SKLearn,
XGBoost, HuggingFace) → `ModelTrainer` + `from sagemaker.core import image_uris` (`image_uris.retrieve(...)`)
- `estimator.fit(...)` → `model_trainer.train(...)`
- `from sagemaker.model import Model` / `model.deploy(...)` → `from sagemaker.serve import ModelBuilder`; `ModelBuilder(...).deploy(...)`
- `from sagemaker.predictor import Predictor` / `predictor.predict(...)` → `Predictor` replaced by `Endpoint` (sagemaker-core); use the predictor returned by `ModelBuilder.deploy(...)`
- `from sagemaker.processing import Processor/ScriptProcessor/SKLearnProcessor` → `sagemaker.core.resources.ProcessingJob`
- `from sagemaker.workflow...` → `from sagemaker.mlops...`
- Removed in v3 (no replacement): MXNet, Chainer, RLEstimator, Training Compiler.
- After generating SageMaker code, validate it contains none of the v2 patterns above. If unsure
of a mapping, consult the migration guide below or call the migration MCP tool.
- No hardcoded account IDs, role ARNs, regions, or bucket names. Use `get_execution_role()` and
`Session().default_bucket()`.
## Migration
- [V2 → V3 migration guide](https://github.com/aws/sagemaker-python-sdk/blob/master/migration.md): authoritative mappings and before/after examples
- [SageMaker Python SDK (source)](https://github.com/aws/sagemaker-python-sdk)
- [SageMaker Python SDK docs](https://sagemaker.readthedocs.io/)
## Core v3 interfaces
- Training: `sagemaker.train.ModelTrainer` (+ `train.configs`: `Compute`, `SourceCode`, `InputData`)
- Inference: `sagemaker.serve.ModelBuilder` (+ `serve.configs.InferenceSpec`), then `ModelBuilder.deploy(...)`
- Processing: `sagemaker.core.resources.ProcessingJob`
- MLOps / Pipelines: `sagemaker.mlops.pipeline.Pipeline`, `sagemaker.mlops.steps`
- Images: `sagemaker.core.image_uris.retrieve(...)`
## Example categories
The repository is organized by ML capability, in lifecycle order.
- `training/`: training with `ModelTrainer` — script and framework training, distributed training, managed spot with checkpointing, heterogeneous clusters, bring-your-own-container, AWS Batch training queues, `@remote`
- `model_customization/`: fine-tuning foundation models — SFT, DPO, RLVR, RLAIF, MTRL, CPT, recipe overrides, data mixing, JumpStart fine-tuning with a private model hub, distributed fine-tuning
- `evaluation/`: the `*Evaluator` surface — benchmark evaluation, custom scorers, LLM-as-a-judge, Inspect AI
- `inference/`: deployment with `ModelBuilder` and sagemaker-core — real-time/serverless/async endpoints, in-process and local-container modes, inference pipelines, multi-model and multi-container endpoints, A/B testing, shadow variants, deployment guardrails, autoscaling with inference components, `optimize()`, batch transform, Bedrock deployment, Marketplace model packages, Augmented AI
- `mlops/`: Pipelines with Model Registry, lineage tracking, experiment tracking, Feature Store, processing jobs, EMR Serverless steps, Clarify, MLflow
Browse them at https://github.com/aws/amazon-sagemaker-examples/tree/default
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

