# aws/sagemaker-python-sdk architecture

> Architecture diagram of the GitHub repository aws/sagemaker-python-sdk, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aws/sagemaker-python-sdk
- Repository: https://github.com/aws/sagemaker-python-sdk

## Overview

SageMaker Python SDK V3 is a modular client library for creating, running, and operating machine-learning workloads on SageMaker. The principal user journey is to configure and submit training, use the resulting model for deployment, then invoke an inference endpoint. The repository also includes pipeline authoring and execution, Feature Store ingestion, and local execution. The README documents the main training and inference APIs; source excerpts and the index show selected implementation links. Several capability branches are represented from documented scope and the file tree, with unverified links dashed.

Main entry points: [`sagemaker-mlops/src/sagemaker/mlops/local/pipeline.py`](https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-mlops/src/sagemaker/mlops/local/pipeline.py) (Local pipeline runner), [`sagemaker-mlops/src/sagemaker/mlops/workflow/pipeline.py`](https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-mlops/src/sagemaker/mlops/workflow/pipeline.py) (Pipeline API), [`sagemaker-serve/src/sagemaker/serve`](https://github.com/aws/sagemaker-python-sdk/tree/master/sagemaker-serve/src/sagemaker/serve) (ModelBuilder), [`sagemaker-serve/src/sagemaker/serve/model_server`](https://github.com/aws/sagemaker-python-sdk/tree/master/sagemaker-serve/src/sagemaker/serve/model_server) (Inference servers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_train["Model training"]
  node_trainer["ModelTrainer<br/>[model_trainer.py]"]
  node_train_runtime["Training runtime"]
end

subgraph group_serve["Model serving"]
  node_model_builder["ModelBuilder"]
  node_model_server["Inference servers"]
end

subgraph group_workflow["Workflow orchestration"]
  node_pipeline["Pipeline API<br/>[pipeline.py]"]
  node_pipeline_context["Pipeline context"]
  node_pipeline_variables["Pipeline variables"]
  node_remote_variables["Remote variables"]
  node_local_pipeline["Local pipelines"]
  node_pipeline_local["Local pipeline runner<br/>[pipeline.py]"]
end

subgraph group_mlops["MLOps capabilities"]
  node_feature_store["Feature Store"]
  node_ingestion["Pandas ingestion"]
  node_experiments["Experiments"]
  node_registry["Model registry<br/>[model_registry.py]"]
  node_lineage["Lineage tracking"]
end

subgraph group_core["Shared runtime"]
  node_session["Session helpers<br/>[session_helper.py]"]
  node_config["Configuration<br/>[config_schema.py]"]
  node_local_session["Local execution<br/>[local_session.py]"]
  node_common["Common utilities<br/>[common_utils.py]"]
  node_framework_utils["Framework utilities<br/>[fw_utils.py]"]
  node_s3["S3 utilities"]
  node_shapes["API shapes<br/>[shapes.py]"]
  node_telemetry["Telemetry"]
  node_exec_vars["Execution variables"]
  node_parameters["Workflow parameters<br/>[parameters.py]"]
  node_properties["Step properties<br/>[properties.py]"]
  node_pipeline_capture["Pipeline capture"]
end

node_user(("SDK user"))
node_sagemaker{{"SageMaker service"}}
node_endpoint{{"Inference endpoint"}}

node_user -.->|"configures training"| node_trainer
node_trainer -.->|"submits training"| node_train_runtime
node_train_runtime -.->|"creates jobs"| node_sagemaker
node_user -.->|"configures deployment"| node_model_builder
node_model_builder -.->|"selects server"| node_model_server
node_model_builder -.->|"builds endpoint"| node_endpoint
node_user -.->|"invokes model"| node_endpoint
node_pipeline -.->|"captures steps"| node_pipeline_context
node_pipeline_context -->|"uses session"| node_session
node_pipeline_variables -.->|"supports expressions"| node_pipeline_context
node_remote_variables -->|"uses variables"| node_pipeline_variables
node_pipeline -->|"uses storage"| node_s3
node_local_pipeline -->|"executes locally"| node_pipeline_local
node_pipeline_local -->|"uses variables"| node_pipeline_variables
node_pipeline_local -->|"uses parameters"| node_parameters
node_pipeline_local -->|"uses variables"| node_exec_vars
node_pipeline_local -->|"uses properties"| node_properties
node_feature_store -.->|"supports ingestion"| node_ingestion
node_ingestion -->|"uses shapes"| node_shapes
node_ingestion -->|"uses utilities"| node_common
node_experiments -.->|"manages runs"| node_sagemaker
node_registry -.->|"manages models"| node_sagemaker
node_lineage -.->|"tracks artifacts"| node_sagemaker
node_session -.->|"transfers data"| node_s3
node_pipeline_capture -->|"uses shapes"| node_shapes
node_pipeline -->|"reads configuration"| node_config
node_pipeline -->|"uses utilities"| node_common
node_model_server -->|"uses utilities"| node_framework_utils
node_model_server -->|"uses session"| node_session
node_local_session -.->|"emulates service"| node_sagemaker
node_local_session -.->|"uses utilities"| node_common
node_telemetry -.->|"reports usage"| node_sagemaker

click node_trainer "https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-train/src/sagemaker/train/model_trainer.py"
click node_train_runtime "https://github.com/aws/sagemaker-python-sdk/tree/master/sagemaker-core/src/sagemaker/core/training"
click node_model_builder "https://github.com/aws/sagemaker-python-sdk/tree/master/sagemaker-serve/src/sagemaker/serve"
click node_model_server "https://github.com/aws/sagemaker-python-sdk/tree/master/sagemaker-serve/src/sagemaker/serve/model_server"
click node_pipeline "https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-mlops/src/sagemaker/mlops/workflow/pipeline.py"
click node_pipeline_context "https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-core/src/sagemaker/core/workflow/pipeline_context.py"
click node_pipeline_variables "https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-core/src/sagemaker/core/helper/pipeline_variable.py"
click node_remote_variables "https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-core/src/sagemaker/core/remote_function/core/pipeline_variables.py"
click node_local_pipeline "https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-mlops/src/sagemaker/mlops/local/local_pipeline_session.py"
click node_feature_store "https://github.com/aws/sagemaker-python-sdk/tree/master/sagemaker-mlops/src/sagemaker/mlops/feature_store"
click node_ingestion "https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-mlops/src/sagemaker/mlops/feature_store/ingestion_manager_pandas.py"
click node_experiments "https://github.com/aws/sagemaker-python-sdk/tree/master/sagemaker-core/src/sagemaker/core/experiments"
click node_registry "https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-core/src/sagemaker/core/model_registry.py"
click node_lineage "https://github.com/aws/sagemaker-python-sdk/tree/master/sagemaker-core/src/sagemaker/core/lineage"
click node_session "https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-core/src/sagemaker/core/helper/session_helper.py"
click node_config "https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-core/src/sagemaker/core/config/config_schema.py"
click node_local_session "https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-core/src/sagemaker/core/local/local_session.py"
click node_common "https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-core/src/sagemaker/core/common_utils.py"
click node_framework_utils "https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-core/src/sagemaker/core/fw_utils.py"
click node_s3 "https://github.com/aws/sagemaker-python-sdk/tree/master/sagemaker-core/src/sagemaker/core/s3"
click node_shapes "https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-core/src/sagemaker/core/shapes/shapes.py"
click node_telemetry "https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-core/src/sagemaker/core/telemetry/telemetry_logging.py"
click node_exec_vars "https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-core/src/sagemaker/core/workflow/execution_variables.py"
click node_parameters "https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-core/src/sagemaker/core/workflow/parameters.py"
click node_properties "https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-core/src/sagemaker/core/workflow/properties.py"
click node_pipeline_capture "https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-core/src/sagemaker/core/workflow/pipeline_capture.py"
click node_pipeline_local "https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-mlops/src/sagemaker/mlops/local/pipeline.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_trainer,node_train_runtime,node_user toneBlue
class node_model_builder,node_model_server toneAmber
class node_pipeline,node_pipeline_context,node_pipeline_variables,node_remote_variables,node_local_pipeline,node_pipeline_local toneMint
class node_feature_store,node_ingestion,node_experiments,node_registry,node_lineage toneRose
class node_session,node_config,node_local_session,node_common,node_framework_utils,node_s3,node_shapes,node_telemetry,node_exec_vars,node_parameters,node_properties,node_pipeline_capture,node_sagemaker,node_endpoint toneIndigo
```

## Components

### Model training

- [ModelTrainer](https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-train/src/sagemaker/train/model_trainer.py): `sagemaker-train/src/sagemaker/train/model_trainer.py`
- [Training runtime](https://github.com/aws/sagemaker-python-sdk/tree/master/sagemaker-core/src/sagemaker/core/training): `sagemaker-core/src/sagemaker/core/training`

### Model serving

- [ModelBuilder](https://github.com/aws/sagemaker-python-sdk/tree/master/sagemaker-serve/src/sagemaker/serve): `sagemaker-serve/src/sagemaker/serve`
- [Inference servers](https://github.com/aws/sagemaker-python-sdk/tree/master/sagemaker-serve/src/sagemaker/serve/model_server): `sagemaker-serve/src/sagemaker/serve/model_server`

### Workflow orchestration

- [Pipeline API](https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-mlops/src/sagemaker/mlops/workflow/pipeline.py): `sagemaker-mlops/src/sagemaker/mlops/workflow/pipeline.py`
- [Pipeline context](https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-core/src/sagemaker/core/workflow/pipeline_context.py): `sagemaker-core/src/sagemaker/core/workflow/pipeline_context.py`
- [Pipeline variables](https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-core/src/sagemaker/core/helper/pipeline_variable.py): `sagemaker-core/src/sagemaker/core/helper/pipeline_variable.py`
- [Remote variables](https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-core/src/sagemaker/core/remote_function/core/pipeline_variables.py): `sagemaker-core/src/sagemaker/core/remote_function/core/pipeline_variables.py`
- [Local pipelines](https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-mlops/src/sagemaker/mlops/local/local_pipeline_session.py): `sagemaker-mlops/src/sagemaker/mlops/local/local_pipeline_session.py`
- [Local pipeline runner](https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-mlops/src/sagemaker/mlops/local/pipeline.py): `sagemaker-mlops/src/sagemaker/mlops/local/pipeline.py`

### MLOps capabilities

- [Feature Store](https://github.com/aws/sagemaker-python-sdk/tree/master/sagemaker-mlops/src/sagemaker/mlops/feature_store): `sagemaker-mlops/src/sagemaker/mlops/feature_store`
- [Pandas ingestion](https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-mlops/src/sagemaker/mlops/feature_store/ingestion_manager_pandas.py): `sagemaker-mlops/src/sagemaker/mlops/feature_store/ingestion_manager_pandas.py`
- [Experiments](https://github.com/aws/sagemaker-python-sdk/tree/master/sagemaker-core/src/sagemaker/core/experiments): `sagemaker-core/src/sagemaker/core/experiments`
- [Model registry](https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-core/src/sagemaker/core/model_registry.py): `sagemaker-core/src/sagemaker/core/model_registry.py`
- [Lineage tracking](https://github.com/aws/sagemaker-python-sdk/tree/master/sagemaker-core/src/sagemaker/core/lineage): `sagemaker-core/src/sagemaker/core/lineage`

### Shared runtime

- [Session helpers](https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-core/src/sagemaker/core/helper/session_helper.py): `sagemaker-core/src/sagemaker/core/helper/session_helper.py`
- [Configuration](https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-core/src/sagemaker/core/config/config_schema.py): `sagemaker-core/src/sagemaker/core/config/config_schema.py`
- [Local execution](https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-core/src/sagemaker/core/local/local_session.py): `sagemaker-core/src/sagemaker/core/local/local_session.py`
- [Common utilities](https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-core/src/sagemaker/core/common_utils.py): `sagemaker-core/src/sagemaker/core/common_utils.py`
- [Framework utilities](https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-core/src/sagemaker/core/fw_utils.py): `sagemaker-core/src/sagemaker/core/fw_utils.py`
- [S3 utilities](https://github.com/aws/sagemaker-python-sdk/tree/master/sagemaker-core/src/sagemaker/core/s3): `sagemaker-core/src/sagemaker/core/s3`
- [API shapes](https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-core/src/sagemaker/core/shapes/shapes.py): `sagemaker-core/src/sagemaker/core/shapes/shapes.py`
- [Telemetry](https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-core/src/sagemaker/core/telemetry/telemetry_logging.py): `sagemaker-core/src/sagemaker/core/telemetry/telemetry_logging.py`
- [Execution variables](https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-core/src/sagemaker/core/workflow/execution_variables.py): `sagemaker-core/src/sagemaker/core/workflow/execution_variables.py`
- [Workflow parameters](https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-core/src/sagemaker/core/workflow/parameters.py): `sagemaker-core/src/sagemaker/core/workflow/parameters.py`
- [Step properties](https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-core/src/sagemaker/core/workflow/properties.py): `sagemaker-core/src/sagemaker/core/workflow/properties.py`
- [Pipeline capture](https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-core/src/sagemaker/core/workflow/pipeline_capture.py): `sagemaker-core/src/sagemaker/core/workflow/pipeline_capture.py`

### Other components

- **SDK user**
- **SageMaker service**
- **Inference endpoint**

## Connections

- SDK user → ModelTrainer: configures training
- ModelTrainer → Training runtime: submits training
- Training runtime → SageMaker service: creates jobs
- SDK user → ModelBuilder: configures deployment
- ModelBuilder → Inference servers: selects server (evidence: `sagemaker-serve/src/sagemaker/serve/model_server/in_process_model_server/app.py`)
- ModelBuilder → Inference endpoint: builds endpoint
- SDK user → Inference endpoint: invokes model
- Pipeline API → Pipeline context: captures steps
- Pipeline context → Session helpers: uses session (evidence: `sagemaker-core/src/sagemaker/core/workflow/pipeline_context.py`)
- Pipeline variables → Pipeline context: supports expressions
- Remote variables → Pipeline variables: uses variables (evidence: `sagemaker-core/src/sagemaker/core/remote_function/core/pipeline_variables.py`)
- Pipeline API → S3 utilities: uses storage (evidence: `sagemaker-mlops/src/sagemaker/mlops/workflow/pipeline.py`)
- Local pipelines → Local pipeline runner: executes locally (evidence: `sagemaker-mlops/src/sagemaker/mlops/local/local_pipeline_session.py`)
- Local pipeline runner → Pipeline variables: uses variables (evidence: `sagemaker-mlops/src/sagemaker/mlops/local/pipeline.py`)
- Local pipeline runner → Workflow parameters: uses parameters (evidence: `sagemaker-mlops/src/sagemaker/mlops/local/pipeline.py`)
- Local pipeline runner → Execution variables: uses variables (evidence: `sagemaker-mlops/src/sagemaker/mlops/local/pipeline.py`)
- Local pipeline runner → Step properties: uses properties (evidence: `sagemaker-mlops/src/sagemaker/mlops/local/pipeline.py`)
- Feature Store → Pandas ingestion: supports ingestion
- Pandas ingestion → API shapes: uses shapes (evidence: `sagemaker-mlops/src/sagemaker/mlops/feature_store/ingestion_manager_pandas.py`)
- Pandas ingestion → Common utilities: uses utilities (evidence: `sagemaker-mlops/src/sagemaker/mlops/feature_store/ingestion_manager_pandas.py`)
- Experiments → SageMaker service: manages runs
- Model registry → SageMaker service: manages models
- Lineage tracking → SageMaker service: tracks artifacts
- Session helpers → S3 utilities: transfers data
- Pipeline capture → API shapes: uses shapes (evidence: `sagemaker-core/src/sagemaker/core/workflow/pipeline_capture.py`)
- Pipeline API → Configuration: reads configuration (evidence: `sagemaker-mlops/src/sagemaker/mlops/workflow/pipeline.py`)
- Pipeline API → Common utilities: uses utilities (evidence: `sagemaker-mlops/src/sagemaker/mlops/workflow/pipeline.py`)
- Inference servers → Framework utilities: uses utilities (evidence: `sagemaker-serve/src/sagemaker/serve/model_server/tgi/server.py`)
- Inference servers → Session helpers: uses session (evidence: `sagemaker-serve/src/sagemaker/serve/model_server/tgi/server.py`)
- Local execution → SageMaker service: emulates service
- Local execution → Common utilities: uses utilities (evidence: `sagemaker-core/src/sagemaker/core/local/local_session.py`)
- Telemetry → SageMaker service: reports usage
