Amazon SageMaker Service

2026/07/27 - Amazon SageMaker Service - 9 updated api methods

Changes  This release adds LoRA adapters, training plans, and new instance types to SageMaker inference optimization. CreateAIRecommendationJob accepts optional AdapterSource and CreateOptimizationJob accepts optional TrainingPlanArns and the ml.g7e and ml.p6-b200 families.

CreateAIRecommendationJob (updated) Link ¶
Changes (request)
{'AdapterSource': {'ModelPackageArns': [{'AdapterId': 'string',
                                         'ModelPackageArn': 'string'}],
                   'S3Uris': [{'AdapterId': 'string', 'S3Uri': 'string'}]}}

Creates a recommendation job that generates intelligent optimization recommendations for generative AI inference deployments. The job analyzes your model, workload configuration, and performance targets to recommend optimal instance types, model optimization techniques (such as quantization and speculative decoding), and deployment configurations.

See also: AWS API Documentation

Request Syntax

client.create_ai_recommendation_job(
    AIRecommendationJobName='string',
    ModelSource={
        'S3': {
            'S3Uri': 'string'
        }
    },
    OutputConfig={
        'S3OutputLocation': 'string',
        'ModelPackageGroupIdentifier': 'string',
        'MlflowConfig': {
            'MlflowResourceArn': 'string',
            'MlflowExperimentName': 'string',
            'MlflowRunName': 'string'
        }
    },
    AIWorkloadConfigIdentifier='string',
    PerformanceTarget={
        'Constraints': [
            {
                'Metric': 'ttft-ms'|'throughput'|'cost'
            },
        ]
    },
    RoleArn='string',
    InferenceSpecification={
        'Framework': 'LMI'|'VLLM'
    },
    OptimizeModel=True|False,
    ComputeSpec={
        'InstanceTypes': [
            'ml.g5.xlarge'|'ml.g5.2xlarge'|'ml.g5.4xlarge'|'ml.g5.8xlarge'|'ml.g5.12xlarge'|'ml.g5.16xlarge'|'ml.g5.24xlarge'|'ml.g5.48xlarge'|'ml.g6.xlarge'|'ml.g6.2xlarge'|'ml.g6.4xlarge'|'ml.g6.8xlarge'|'ml.g6.12xlarge'|'ml.g6.16xlarge'|'ml.g6.24xlarge'|'ml.g6.48xlarge'|'ml.g6e.xlarge'|'ml.g6e.2xlarge'|'ml.g6e.4xlarge'|'ml.g6e.8xlarge'|'ml.g6e.12xlarge'|'ml.g6e.16xlarge'|'ml.g6e.24xlarge'|'ml.g6e.48xlarge'|'ml.g7e.2xlarge'|'ml.g7e.4xlarge'|'ml.g7e.8xlarge'|'ml.g7e.12xlarge'|'ml.g7e.24xlarge'|'ml.g7e.48xlarge'|'ml.p3.2xlarge'|'ml.p3.8xlarge'|'ml.p3.16xlarge'|'ml.p4d.24xlarge'|'ml.p4de.24xlarge'|'ml.p5.4xlarge'|'ml.p5.48xlarge'|'ml.p5e.48xlarge'|'ml.p5en.48xlarge'|'ml.p6-b200.48xlarge',
        ],
        'CapacityReservationConfig': {
            'CapacityReservationPreference': 'capacity-reservations-only',
            'MlReservationArns': [
                'string',
            ]
        }
    },
    AdapterSource={
        'ModelPackageArns': [
            {
                'AdapterId': 'string',
                'ModelPackageArn': 'string'
            },
        ],
        'S3Uris': [
            {
                'AdapterId': 'string',
                'S3Uri': 'string'
            },
        ]
    },
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type AIRecommendationJobName:

string

param AIRecommendationJobName:

[REQUIRED]

The name of the AI recommendation job. The name must be unique within your Amazon Web Services account in the current Amazon Web Services Region.

type ModelSource:

dict

param ModelSource:

[REQUIRED]

The source of the model to optimize. Specify the Amazon S3 location of the model artifacts.

  • S3 (dict) --

    The Amazon S3 location of the model artifacts.

    • S3Uri (string) --

      The Amazon S3 URI of the model artifacts.

type OutputConfig:

dict

param OutputConfig:

[REQUIRED]

The output configuration for the recommendation job, including the Amazon S3 location for results and an optional model package group where the optimized model is registered.

  • S3OutputLocation (string) --

    The Amazon S3 URI where recommendation results are stored.

  • ModelPackageGroupIdentifier (string) --

    The name or Amazon Resource Name (ARN) of the model package group where the optimized model is registered as a new model package version.

  • MlflowConfig (dict) --

    The MLflow tracking configuration for the job. If you don't specify this parameter, MLflow tracking is disabled.

    • MlflowResourceArn (string) -- [REQUIRED]

      The Amazon Resource Name (ARN) of the SageMaker managed MLflow resource.

    • MlflowExperimentName (string) --

      The MLflow experiment name used for tracking.

    • MlflowRunName (string) --

      The MLflow run name used for tracking.

type AIWorkloadConfigIdentifier:

string

param AIWorkloadConfigIdentifier:

[REQUIRED]

The name or Amazon Resource Name (ARN) of the AI workload configuration to use for this recommendation job.

type PerformanceTarget:

dict

param PerformanceTarget:

[REQUIRED]

The performance targets for the recommendation job. Specify constraints on metrics such as time to first token ( ttft-ms), throughput, or cost.

  • Constraints (list) -- [REQUIRED]

    An array of performance constraints that define the optimization objectives.

    • (dict) --

      A performance constraint for an AI recommendation job.

      • Metric (string) -- [REQUIRED]

        The performance metric. Valid values are ttft-ms (time to first token in milliseconds), throughput, and cost.

type RoleArn:

string

param RoleArn:

[REQUIRED]

The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker AI to perform tasks on your behalf.

type InferenceSpecification:

dict

param InferenceSpecification:

The inference framework configuration. Specify the framework (such as LMI or vLLM) for the recommendation job.

  • Framework (string) --

    The inference framework. Valid values are LMI and VLLM.

type OptimizeModel:

boolean

param OptimizeModel:

Whether to allow model optimization techniques such as quantization, speculative decoding, and kernel tuning. The default is true.

type ComputeSpec:

dict

param ComputeSpec:

The compute resource specification for the recommendation job. You can specify up to 3 instance types to consider, and optionally provide capacity reservation configuration.

  • InstanceTypes (list) --

    The list of instance types to consider for recommendations. You can specify up to 3 instance types.

    • (string) --

  • CapacityReservationConfig (dict) --

    The capacity reservation configuration.

    • CapacityReservationPreference (string) --

      The capacity reservation preference. The only valid value is capacity-reservations-only.

    • MlReservationArns (list) --

      The list of ML reservation ARNs to use.

      • (string) --

type AdapterSource:

dict

param AdapterSource:

The LoRA adapter source for the recommendation job. Specify either a list of model package ARNs or Amazon S3 URIs for your LoRA adapters. When this parameter is absent, the recommendation job runs without LoRA adapter support.

  • ModelPackageArns (list) --

    A list of LoRA adapters identified by their model package ARNs. Use this when your adapters were produced by a SageMaker AI fine-tuning workflow that registers model packages.

    • (dict) --

      A LoRA adapter entry identified by a model package ARN.

      • AdapterId (string) -- [REQUIRED]

        A unique identifier for the adapter. This ID is used as the inference component name when the adapter is deployed. The ID must start and end with an alphanumeric character, can contain hyphens between alphanumeric characters, and can be up to 63 characters long.

      • ModelPackageArn (string) -- [REQUIRED]

        The Amazon Resource Name (ARN) of the model package that contains the LoRA adapter artifacts.

  • S3Uris (list) --

    A list of LoRA adapters identified by their Amazon S3 URIs. Use this when your adapters are stored as raw artifacts in Amazon S3.

    • (dict) --

      A LoRA adapter entry identified by an Amazon S3 URI.

      • AdapterId (string) -- [REQUIRED]

        A unique identifier for the adapter. This ID is used as the inference component name when the adapter is deployed. The ID must start and end with an alphanumeric character, can contain hyphens between alphanumeric characters, and can be up to 63 characters long.

      • S3Uri (string) -- [REQUIRED]

        The Amazon S3 URI of the directory that contains the LoRA adapter artifacts in PEFT format.

type Tags:

list

param Tags:

The metadata that you apply to Amazon Web Services resources to help you categorize and organize them.

  • (dict) --

    A tag object that consists of a key and an optional value, used to manage metadata for SageMaker Amazon Web Services resources.

    You can add tags to notebook instances, training jobs, hyperparameter tuning jobs, batch transform jobs, models, labeling jobs, work teams, endpoint configurations, and endpoints. For more information on adding tags to SageMaker resources, see AddTags.

    For more information on adding metadata to your Amazon Web Services resources with tagging, see Tagging Amazon Web Services resources. For advice on best practices for managing Amazon Web Services resources with tagging, see Tagging Best Practices: Implement an Effective Amazon Web Services Resource Tagging Strategy.

    • Key (string) -- [REQUIRED]

      The tag key. Tag keys must be unique per resource.

    • Value (string) -- [REQUIRED]

      The tag value.

rtype:

dict

returns:

Response Syntax

{
    'AIRecommendationJobArn': 'string'
}

Response Structure

  • (dict) --

    • AIRecommendationJobArn (string) --

      The Amazon Resource Name (ARN) of the created recommendation job.

CreateNotebookInstance (updated) Link ¶
Changes (request)
{'InstanceType': {'ml.g7e.12xlarge',
                  'ml.g7e.24xlarge',
                  'ml.g7e.2xlarge',
                  'ml.g7e.48xlarge',
                  'ml.g7e.4xlarge',
                  'ml.g7e.8xlarge'}}

Creates an SageMaker AI notebook instance. A notebook instance is a machine learning (ML) compute instance running on a Jupyter notebook.

In a CreateNotebookInstance request, specify the type of ML compute instance that you want to run. SageMaker AI launches the instance, installs common libraries that you can use to explore datasets for model training, and attaches an ML storage volume to the notebook instance.

SageMaker AI also provides a set of example notebooks. Each notebook demonstrates how to use SageMaker AI with a specific algorithm or with a machine learning framework.

After receiving the request, SageMaker AI does the following:

  • Creates a network interface in the SageMaker AI VPC.

  • (Option) If you specified SubnetId, SageMaker AI creates a network interface in your own VPC, which is inferred from the subnet ID that you provide in the input. When creating this network interface, SageMaker AI attaches the security group that you specified in the request to the network interface that it creates in your VPC.

  • Launches an EC2 instance of the type specified in the request in the SageMaker AI VPC. If you specified SubnetId of your VPC, SageMaker AI specifies both network interfaces when launching this instance. This enables inbound traffic from your own VPC to the notebook instance, assuming that the security groups allow it.

After creating the notebook instance, SageMaker AI returns its Amazon Resource Name (ARN). You can't change the name of a notebook instance after you create it.

After SageMaker AI creates the notebook instance, you can connect to the Jupyter server and work in Jupyter notebooks. For example, you can write code to explore a dataset that you can use for model training, train a model, host models by creating SageMaker AI endpoints, and validate hosted models.

For more information, see How It Works.

See also: AWS API Documentation

Request Syntax

client.create_notebook_instance(
    NotebookInstanceName='string',
    InstanceType='ml.t2.medium'|'ml.t2.large'|'ml.t2.xlarge'|'ml.t2.2xlarge'|'ml.t3.medium'|'ml.t3.large'|'ml.t3.xlarge'|'ml.t3.2xlarge'|'ml.m4.xlarge'|'ml.m4.2xlarge'|'ml.m4.4xlarge'|'ml.m4.10xlarge'|'ml.m4.16xlarge'|'ml.m5.xlarge'|'ml.m5.2xlarge'|'ml.m5.4xlarge'|'ml.m5.12xlarge'|'ml.m5.24xlarge'|'ml.m5d.large'|'ml.m5d.xlarge'|'ml.m5d.2xlarge'|'ml.m5d.4xlarge'|'ml.m5d.8xlarge'|'ml.m5d.12xlarge'|'ml.m5d.16xlarge'|'ml.m5d.24xlarge'|'ml.c4.xlarge'|'ml.c4.2xlarge'|'ml.c4.4xlarge'|'ml.c4.8xlarge'|'ml.c5.xlarge'|'ml.c5.2xlarge'|'ml.c5.4xlarge'|'ml.c5.9xlarge'|'ml.c5.18xlarge'|'ml.c5d.xlarge'|'ml.c5d.2xlarge'|'ml.c5d.4xlarge'|'ml.c5d.9xlarge'|'ml.c5d.18xlarge'|'ml.p2.xlarge'|'ml.p2.8xlarge'|'ml.p2.16xlarge'|'ml.p3.2xlarge'|'ml.p3.8xlarge'|'ml.p3.16xlarge'|'ml.p3dn.24xlarge'|'ml.g4dn.xlarge'|'ml.g4dn.2xlarge'|'ml.g4dn.4xlarge'|'ml.g4dn.8xlarge'|'ml.g4dn.12xlarge'|'ml.g4dn.16xlarge'|'ml.r5.large'|'ml.r5.xlarge'|'ml.r5.2xlarge'|'ml.r5.4xlarge'|'ml.r5.8xlarge'|'ml.r5.12xlarge'|'ml.r5.16xlarge'|'ml.r5.24xlarge'|'ml.g5.xlarge'|'ml.g5.2xlarge'|'ml.g5.4xlarge'|'ml.g5.8xlarge'|'ml.g5.16xlarge'|'ml.g5.12xlarge'|'ml.g5.24xlarge'|'ml.g5.48xlarge'|'ml.inf1.xlarge'|'ml.inf1.2xlarge'|'ml.inf1.6xlarge'|'ml.inf1.24xlarge'|'ml.trn1.2xlarge'|'ml.trn1.32xlarge'|'ml.trn1n.32xlarge'|'ml.inf2.xlarge'|'ml.inf2.8xlarge'|'ml.inf2.24xlarge'|'ml.inf2.48xlarge'|'ml.p4d.24xlarge'|'ml.p4de.24xlarge'|'ml.p5.48xlarge'|'ml.p6-b200.48xlarge'|'ml.m6i.large'|'ml.m6i.xlarge'|'ml.m6i.2xlarge'|'ml.m6i.4xlarge'|'ml.m6i.8xlarge'|'ml.m6i.12xlarge'|'ml.m6i.16xlarge'|'ml.m6i.24xlarge'|'ml.m6i.32xlarge'|'ml.m7i.large'|'ml.m7i.xlarge'|'ml.m7i.2xlarge'|'ml.m7i.4xlarge'|'ml.m7i.8xlarge'|'ml.m7i.12xlarge'|'ml.m7i.16xlarge'|'ml.m7i.24xlarge'|'ml.m7i.48xlarge'|'ml.c6i.large'|'ml.c6i.xlarge'|'ml.c6i.2xlarge'|'ml.c6i.4xlarge'|'ml.c6i.8xlarge'|'ml.c6i.12xlarge'|'ml.c6i.16xlarge'|'ml.c6i.24xlarge'|'ml.c6i.32xlarge'|'ml.c7i.large'|'ml.c7i.xlarge'|'ml.c7i.2xlarge'|'ml.c7i.4xlarge'|'ml.c7i.8xlarge'|'ml.c7i.12xlarge'|'ml.c7i.16xlarge'|'ml.c7i.24xlarge'|'ml.c7i.48xlarge'|'ml.r6i.large'|'ml.r6i.xlarge'|'ml.r6i.2xlarge'|'ml.r6i.4xlarge'|'ml.r6i.8xlarge'|'ml.r6i.12xlarge'|'ml.r6i.16xlarge'|'ml.r6i.24xlarge'|'ml.r6i.32xlarge'|'ml.r7i.large'|'ml.r7i.xlarge'|'ml.r7i.2xlarge'|'ml.r7i.4xlarge'|'ml.r7i.8xlarge'|'ml.r7i.12xlarge'|'ml.r7i.16xlarge'|'ml.r7i.24xlarge'|'ml.r7i.48xlarge'|'ml.m6id.large'|'ml.m6id.xlarge'|'ml.m6id.2xlarge'|'ml.m6id.4xlarge'|'ml.m6id.8xlarge'|'ml.m6id.12xlarge'|'ml.m6id.16xlarge'|'ml.m6id.24xlarge'|'ml.m6id.32xlarge'|'ml.c6id.large'|'ml.c6id.xlarge'|'ml.c6id.2xlarge'|'ml.c6id.4xlarge'|'ml.c6id.8xlarge'|'ml.c6id.12xlarge'|'ml.c6id.16xlarge'|'ml.c6id.24xlarge'|'ml.c6id.32xlarge'|'ml.r6id.large'|'ml.r6id.xlarge'|'ml.r6id.2xlarge'|'ml.r6id.4xlarge'|'ml.r6id.8xlarge'|'ml.r6id.12xlarge'|'ml.r6id.16xlarge'|'ml.r6id.24xlarge'|'ml.r6id.32xlarge'|'ml.g6.xlarge'|'ml.g6.2xlarge'|'ml.g6.4xlarge'|'ml.g6.8xlarge'|'ml.g6.12xlarge'|'ml.g6.16xlarge'|'ml.g6.24xlarge'|'ml.g6.48xlarge'|'ml.g7e.2xlarge'|'ml.g7e.4xlarge'|'ml.g7e.8xlarge'|'ml.g7e.12xlarge'|'ml.g7e.24xlarge'|'ml.g7e.48xlarge'|'ml.p5.4xlarge'|'ml.p5en.48xlarge'|'ml.g6e.xlarge'|'ml.g6e.2xlarge'|'ml.g6e.4xlarge'|'ml.g6e.8xlarge'|'ml.g6e.12xlarge'|'ml.g6e.16xlarge'|'ml.g6e.24xlarge'|'ml.g6e.48xlarge',
    SubnetId='string',
    SecurityGroupIds=[
        'string',
    ],
    IpAddressType='ipv4'|'dualstack',
    RoleArn='string',
    KmsKeyId='string',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    LifecycleConfigName='string',
    DirectInternetAccess='Enabled'|'Disabled',
    VolumeSizeInGB=123,
    AcceleratorTypes=[
        'ml.eia1.medium'|'ml.eia1.large'|'ml.eia1.xlarge'|'ml.eia2.medium'|'ml.eia2.large'|'ml.eia2.xlarge',
    ],
    DefaultCodeRepository='string',
    AdditionalCodeRepositories=[
        'string',
    ],
    RootAccess='Enabled'|'Disabled',
    PlatformIdentifier='string',
    InstanceMetadataServiceConfiguration={
        'MinimumInstanceMetadataServiceVersion': 'string'
    }
)
type NotebookInstanceName:

string

param NotebookInstanceName:

[REQUIRED]

The name of the new notebook instance.

type InstanceType:

string

param InstanceType:

[REQUIRED]

The type of ML compute instance to launch for the notebook instance.

type SubnetId:

string

param SubnetId:

The ID of the subnet in a VPC to which you would like to have a connectivity from your ML compute instance.

type SecurityGroupIds:

list

param SecurityGroupIds:

The VPC security group IDs, in the form sg-xxxxxxxx. The security groups must be for the same VPC as specified in the subnet.

  • (string) --

type IpAddressType:

string

param IpAddressType:

The IP address type for the notebook instance. Specify ipv4 for IPv4-only connectivity or dualstack for both IPv4 and IPv6 connectivity. When you specify dualstack, the subnet must support IPv6 CIDR blocks. If not specified, defaults to ipv4.

type RoleArn:

string

param RoleArn:

[REQUIRED]

When you send any requests to Amazon Web Services resources from the notebook instance, SageMaker AI assumes this role to perform tasks on your behalf. You must grant this role necessary permissions so SageMaker AI can perform these tasks. The policy must allow the SageMaker AI service principal (sagemaker.amazonaws.com) permissions to assume this role. For more information, see SageMaker AI Roles.

type KmsKeyId:

string

param KmsKeyId:

The Amazon Resource Name (ARN) of a Amazon Web Services Key Management Service key that SageMaker AI uses to encrypt data on the storage volume attached to your notebook instance. The KMS key you provide must be enabled. For information, see Enabling and Disabling Keys in the Amazon Web Services Key Management Service Developer Guide.

type Tags:

list

param Tags:

An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services Resources.

  • (dict) --

    A tag object that consists of a key and an optional value, used to manage metadata for SageMaker Amazon Web Services resources.

    You can add tags to notebook instances, training jobs, hyperparameter tuning jobs, batch transform jobs, models, labeling jobs, work teams, endpoint configurations, and endpoints. For more information on adding tags to SageMaker resources, see AddTags.

    For more information on adding metadata to your Amazon Web Services resources with tagging, see Tagging Amazon Web Services resources. For advice on best practices for managing Amazon Web Services resources with tagging, see Tagging Best Practices: Implement an Effective Amazon Web Services Resource Tagging Strategy.

    • Key (string) -- [REQUIRED]

      The tag key. Tag keys must be unique per resource.

    • Value (string) -- [REQUIRED]

      The tag value.

type LifecycleConfigName:

string

param LifecycleConfigName:

The name of a lifecycle configuration to associate with the notebook instance. For information about lifestyle configurations, see Step 2.1: (Optional) Customize a Notebook Instance.

type DirectInternetAccess:

string

param DirectInternetAccess:

Sets whether SageMaker AI provides internet access to the notebook instance. If you set this to Disabled this notebook instance is able to access resources only in your VPC, and is not be able to connect to SageMaker AI training and endpoint services unless you configure a NAT Gateway in your VPC.

For more information, see Notebook Instances Are Internet-Enabled by Default. You can set the value of this parameter to Disabled only if you set a value for the SubnetId parameter.

type VolumeSizeInGB:

integer

param VolumeSizeInGB:

The size, in GB, of the ML storage volume to attach to the notebook instance. The default value is 5 GB.

type AcceleratorTypes:

list

param AcceleratorTypes:

This parameter is no longer supported. Elastic Inference (EI) is no longer available.

This parameter was used to specify a list of EI instance types to associate with this notebook instance.

  • (string) --

type DefaultCodeRepository:

string

param DefaultCodeRepository:

A Git repository to associate with the notebook instance as its default code repository. This can be either the name of a Git repository stored as a resource in your account, or the URL of a Git repository in Amazon Web Services CodeCommit or in any other Git repository. When you open a notebook instance, it opens in the directory that contains this repository. For more information, see Associating Git Repositories with SageMaker AI Notebook Instances.

type AdditionalCodeRepositories:

list

param AdditionalCodeRepositories:

An array of up to three Git repositories to associate with the notebook instance. These can be either the names of Git repositories stored as resources in your account, or the URL of Git repositories in Amazon Web Services CodeCommit or in any other Git repository. These repositories are cloned at the same level as the default repository of your notebook instance. For more information, see Associating Git Repositories with SageMaker AI Notebook Instances.

  • (string) --

type RootAccess:

string

param RootAccess:

Whether root access is enabled or disabled for users of the notebook instance. The default value is Enabled.

type PlatformIdentifier:

string

param PlatformIdentifier:

The platform identifier of the notebook instance runtime environment. The default value is notebook-al2023-v1.

type InstanceMetadataServiceConfiguration:

dict

param InstanceMetadataServiceConfiguration:

Information on the IMDS configuration of the notebook instance

  • MinimumInstanceMetadataServiceVersion (string) -- [REQUIRED]

    Indicates the minimum IMDS version that the notebook instance supports. When passed as part of CreateNotebookInstance, if no value is selected, then it defaults to IMDSv1. This means that both IMDSv1 and IMDSv2 are supported. If passed as part of UpdateNotebookInstance, there is no default.

rtype:

dict

returns:

Response Syntax

{
    'NotebookInstanceArn': 'string'
}

Response Structure

  • (dict) --

    • NotebookInstanceArn (string) --

      The Amazon Resource Name (ARN) of the notebook instance.

CreateOptimizationJob (updated) Link ¶
Changes (request)
{'DeploymentInstanceType': {'ml.g7e.12xlarge',
                            'ml.g7e.24xlarge',
                            'ml.g7e.2xlarge',
                            'ml.g7e.48xlarge',
                            'ml.g7e.4xlarge',
                            'ml.g7e.8xlarge',
                            'ml.p6-b200.48xlarge'},
 'TrainingPlanArns': ['string']}

Creates a job that optimizes a model for inference performance. To create the job, you provide the location of a source model, and you provide the settings for the optimization techniques that you want the job to apply. When the job completes successfully, SageMaker uploads the new optimized model to the output destination that you specify.

For more information about how to use this action, and about the supported optimization techniques, see Optimize model inference with Amazon SageMaker.

See also: AWS API Documentation

Request Syntax

client.create_optimization_job(
    OptimizationJobName='string',
    RoleArn='string',
    ModelSource={
        'S3': {
            'S3Uri': 'string',
            'ModelAccessConfig': {
                'AcceptEula': True|False
            }
        },
        'SageMakerModel': {
            'ModelName': 'string'
        }
    },
    DeploymentInstanceType='ml.p4d.24xlarge'|'ml.p4de.24xlarge'|'ml.p5.48xlarge'|'ml.p5e.48xlarge'|'ml.p5en.48xlarge'|'ml.g4dn.xlarge'|'ml.g4dn.2xlarge'|'ml.g4dn.4xlarge'|'ml.g4dn.8xlarge'|'ml.g4dn.12xlarge'|'ml.g4dn.16xlarge'|'ml.g5.xlarge'|'ml.g5.2xlarge'|'ml.g5.4xlarge'|'ml.g5.8xlarge'|'ml.g5.12xlarge'|'ml.g5.16xlarge'|'ml.g5.24xlarge'|'ml.g5.48xlarge'|'ml.g6.xlarge'|'ml.g6.2xlarge'|'ml.g6.4xlarge'|'ml.g6.8xlarge'|'ml.g6.12xlarge'|'ml.g6.16xlarge'|'ml.g6.24xlarge'|'ml.g6.48xlarge'|'ml.g6e.xlarge'|'ml.g6e.2xlarge'|'ml.g6e.4xlarge'|'ml.g6e.8xlarge'|'ml.g6e.12xlarge'|'ml.g6e.16xlarge'|'ml.g6e.24xlarge'|'ml.g6e.48xlarge'|'ml.inf2.xlarge'|'ml.inf2.8xlarge'|'ml.inf2.24xlarge'|'ml.inf2.48xlarge'|'ml.trn1.2xlarge'|'ml.trn1.32xlarge'|'ml.trn1n.32xlarge'|'ml.p6-b200.48xlarge'|'ml.g7e.2xlarge'|'ml.g7e.4xlarge'|'ml.g7e.8xlarge'|'ml.g7e.12xlarge'|'ml.g7e.24xlarge'|'ml.g7e.48xlarge',
    MaxInstanceCount=123,
    OptimizationEnvironment={
        'string': 'string'
    },
    OptimizationConfigs=[
        {
            'ModelQuantizationConfig': {
                'Image': 'string',
                'OverrideEnvironment': {
                    'string': 'string'
                }
            },
            'ModelCompilationConfig': {
                'Image': 'string',
                'OverrideEnvironment': {
                    'string': 'string'
                }
            },
            'ModelShardingConfig': {
                'Image': 'string',
                'OverrideEnvironment': {
                    'string': 'string'
                }
            },
            'ModelSpeculativeDecodingConfig': {
                'Technique': 'EAGLE',
                'TrainingDataSource': {
                    'S3Uri': 'string',
                    'S3DataType': 'S3Prefix'|'ManifestFile'
                }
            }
        },
    ],
    OutputConfig={
        'KmsKeyId': 'string',
        'S3OutputLocation': 'string',
        'SageMakerModel': {
            'ModelName': 'string'
        }
    },
    StoppingCondition={
        'MaxRuntimeInSeconds': 123,
        'MaxWaitTimeInSeconds': 123,
        'MaxPendingTimeInSeconds': 123
    },
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    VpcConfig={
        'SecurityGroupIds': [
            'string',
        ],
        'Subnets': [
            'string',
        ]
    },
    TrainingPlanArns=[
        'string',
    ]
)
type OptimizationJobName:

string

param OptimizationJobName:

[REQUIRED]

A custom name for the new optimization job.

type RoleArn:

string

param RoleArn:

[REQUIRED]

The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker AI to perform tasks on your behalf.

During model optimization, Amazon SageMaker AI needs your permission to:

  • Read input data from an S3 bucket

  • Write model artifacts to an S3 bucket

  • Write logs to Amazon CloudWatch Logs

  • Publish metrics to Amazon CloudWatch

You grant permissions for all of these tasks to an IAM role. To pass this role to Amazon SageMaker AI, the caller of this API must have the iam:PassRole permission. For more information, see Amazon SageMaker AI Roles.

type ModelSource:

dict

param ModelSource:

[REQUIRED]

The location of the source model to optimize with an optimization job.

  • S3 (dict) --

    The Amazon S3 location of a source model to optimize with an optimization job.

    • S3Uri (string) --

      An Amazon S3 URI that locates a source model to optimize with an optimization job.

    • ModelAccessConfig (dict) --

      The access configuration settings for the source ML model for an optimization job, where you can accept the model end-user license agreement (EULA).

      • AcceptEula (boolean) -- [REQUIRED]

        Specifies agreement to the model end-user license agreement (EULA). The AcceptEula value must be explicitly defined as True in order to accept the EULA that this model requires. You are responsible for reviewing and complying with any applicable license terms and making sure they are acceptable for your use case before downloading or using a model.

  • SageMakerModel (dict) --

    The name of an existing SageMaker model to optimize with an optimization job.

    • ModelName (string) --

      The name of a SageMaker model.

type DeploymentInstanceType:

string

param DeploymentInstanceType:

[REQUIRED]

The type of instance that hosts the optimized model that you create with the optimization job.

type MaxInstanceCount:

integer

param MaxInstanceCount:

The maximum number of instances to use for the optimization job.

type OptimizationEnvironment:

dict

param OptimizationEnvironment:

The environment variables to set in the model container.

  • (string) --

    • (string) --

type OptimizationConfigs:

list

param OptimizationConfigs:

[REQUIRED]

Settings for each of the optimization techniques that the job applies.

  • (dict) --

    Settings for an optimization technique that you apply with a model optimization job.

    • ModelQuantizationConfig (dict) --

      Settings for the model quantization technique that's applied by a model optimization job.

      • Image (string) --

        The URI of an LMI DLC in Amazon ECR. SageMaker uses this image to run the optimization.

      • OverrideEnvironment (dict) --

        Environment variables that override the default ones in the model container.

        • (string) --

          • (string) --

    • ModelCompilationConfig (dict) --

      Settings for the model compilation technique that's applied by a model optimization job.

      • Image (string) --

        The URI of an LMI DLC in Amazon ECR. SageMaker uses this image to run the optimization.

      • OverrideEnvironment (dict) --

        Environment variables that override the default ones in the model container.

        • (string) --

          • (string) --

    • ModelShardingConfig (dict) --

      Settings for the model sharding technique that's applied by a model optimization job.

      • Image (string) --

        The URI of an LMI DLC in Amazon ECR. SageMaker uses this image to run the optimization.

      • OverrideEnvironment (dict) --

        Environment variables that override the default ones in the model container.

        • (string) --

          • (string) --

    • ModelSpeculativeDecodingConfig (dict) --

      Settings for the model speculative decoding technique that's applied by a model optimization job.

      • Technique (string) -- [REQUIRED]

        The speculative decoding technique to apply during model optimization.

      • TrainingDataSource (dict) --

        The location of the training data to use for speculative decoding. The data must be formatted as ShareGPT, OpenAI Completions or OpenAI Chat Completions. The input can also be unencrypted captured data from a SageMaker endpoint as long as the endpoint uses one of the above formats.

        • S3Uri (string) -- [REQUIRED]

          The Amazon S3 URI that points to the training data for speculative decoding.

        • S3DataType (string) -- [REQUIRED]

          The type of data stored in the Amazon S3 location. Valid values are S3Prefix or ManifestFile.

type OutputConfig:

dict

param OutputConfig:

[REQUIRED]

Details for where to store the optimized model that you create with the optimization job.

  • KmsKeyId (string) --

    The Amazon Resource Name (ARN) of a key in Amazon Web Services KMS. SageMaker uses they key to encrypt the artifacts of the optimized model when SageMaker uploads the model to Amazon S3.

  • S3OutputLocation (string) -- [REQUIRED]

    The Amazon S3 URI for where to store the optimized model that you create with an optimization job.

  • SageMakerModel (dict) --

    The name of a SageMaker model to use as the output destination for an optimization job.

    • ModelName (string) --

      The name of a SageMaker model.

type StoppingCondition:

dict

param StoppingCondition:

[REQUIRED]

Specifies a limit to how long a job can run. When the job reaches the time limit, SageMaker ends the job. Use this API to cap costs.

To stop a training job, SageMaker sends the algorithm the SIGTERM signal, which delays job termination for 120 seconds. Algorithms can use this 120-second window to save the model artifacts, so the results of training are not lost.

The training algorithms provided by SageMaker automatically save the intermediate results of a model training job when possible. This attempt to save artifacts is only a best effort case as model might not be in a state from which it can be saved. For example, if training has just started, the model might not be ready to save. When saved, this intermediate data is a valid model artifact. You can use it to create a model with CreateModel.

  • MaxRuntimeInSeconds (integer) --

    The maximum length of time, in seconds, that a training or compilation job can run before it is stopped.

    For compilation jobs, if the job does not complete during this time, a TimeOut error is generated. We recommend starting with 900 seconds and increasing as necessary based on your model.

    For all other jobs, if the job does not complete during this time, SageMaker ends the job. When RetryStrategy is specified in the job request, MaxRuntimeInSeconds specifies the maximum time for all of the attempts in total, not each individual attempt. The default value is 1 day. The maximum value is 28 days.

    The maximum time that a TrainingJob can run in total, including any time spent publishing metrics or archiving and uploading models after it has been stopped, is 30 days.

  • MaxWaitTimeInSeconds (integer) --

    The maximum length of time, in seconds, that a managed Spot training job has to complete. It is the amount of time spent waiting for Spot capacity plus the amount of time the job can run. It must be equal to or greater than MaxRuntimeInSeconds. If the job does not complete during this time, SageMaker ends the job.

    When RetryStrategy is specified in the job request, MaxWaitTimeInSeconds specifies the maximum time for all of the attempts in total, not each individual attempt.

  • MaxPendingTimeInSeconds (integer) --

    The maximum length of time, in seconds, that a training or compilation job can be pending before it is stopped.

type Tags:

list

param Tags:

A list of key-value pairs associated with the optimization job. For more information, see Tagging Amazon Web Services resources in the Amazon Web Services General Reference Guide.

  • (dict) --

    A tag object that consists of a key and an optional value, used to manage metadata for SageMaker Amazon Web Services resources.

    You can add tags to notebook instances, training jobs, hyperparameter tuning jobs, batch transform jobs, models, labeling jobs, work teams, endpoint configurations, and endpoints. For more information on adding tags to SageMaker resources, see AddTags.

    For more information on adding metadata to your Amazon Web Services resources with tagging, see Tagging Amazon Web Services resources. For advice on best practices for managing Amazon Web Services resources with tagging, see Tagging Best Practices: Implement an Effective Amazon Web Services Resource Tagging Strategy.

    • Key (string) -- [REQUIRED]

      The tag key. Tag keys must be unique per resource.

    • Value (string) -- [REQUIRED]

      The tag value.

type VpcConfig:

dict

param VpcConfig:

A VPC in Amazon VPC that your optimized model has access to.

  • SecurityGroupIds (list) -- [REQUIRED]

    The VPC security group IDs, in the form sg-xxxxxxxx. Specify the security groups for the VPC that is specified in the Subnets field.

    • (string) --

  • Subnets (list) -- [REQUIRED]

    The ID of the subnets in the VPC to which you want to connect your optimized model.

    • (string) --

type TrainingPlanArns:

list

param TrainingPlanArns:

The Amazon Resource Name (ARN) of the training plan to use for this optimization job.

When you use reserved capacity from a training plan, the optimization job runs on that reserved capacity instead of on-demand capacity. If you omit this field, the job uses on-demand capacity. Currently, you can specify at most one training plan.

For more information about how to reserve GPU capacity for your optimization jobs using Amazon SageMaker Training Plans, see Reserve capacity with training plans.

  • (string) --

rtype:

dict

returns:

Response Syntax

{
    'OptimizationJobArn': 'string'
}

Response Structure

  • (dict) --

    • OptimizationJobArn (string) --

      The Amazon Resource Name (ARN) of the optimization job.

DescribeAIRecommendationJob (updated) Link ¶
Changes (response)
{'AdapterSource': {'ModelPackageArns': [{'AdapterId': 'string',
                                         'ModelPackageArn': 'string'}],
                   'S3Uris': [{'AdapterId': 'string', 'S3Uri': 'string'}]},
 'Recommendations': {'AdapterDetails': {'ModelPackageArns': [{'AdapterId': 'string',
                                                              'ModelPackageArn': 'string'}],
                                        'S3Uris': [{'AdapterId': 'string',
                                                    'S3Uri': 'string'}]},
                     'DeploymentConfiguration': {'MinCpuMemoryRequiredInMb': 'integer'}}}

Returns details of an AI recommendation job, including its status, model source, performance targets, optimization recommendations, and deployment configurations.

See also: AWS API Documentation

Request Syntax

client.describe_ai_recommendation_job(
    AIRecommendationJobName='string'
)
type AIRecommendationJobName:

string

param AIRecommendationJobName:

[REQUIRED]

The name of the AI recommendation job to describe.

rtype:

dict

returns:

Response Syntax

{
    'AIRecommendationJobName': 'string',
    'AIRecommendationJobArn': 'string',
    'AIRecommendationJobStatus': 'InProgress'|'Completed'|'Failed'|'Stopping'|'Stopped',
    'FailureReason': 'string',
    'ModelSource': {
        'S3': {
            'S3Uri': 'string'
        }
    },
    'OutputConfig': {
        'S3OutputLocation': 'string',
        'ModelPackageGroupIdentifier': 'string',
        'MlflowConfig': {
            'MlflowResourceArn': 'string',
            'MlflowExperimentName': 'string',
            'MlflowRunName': 'string'
        }
    },
    'InferenceSpecification': {
        'Framework': 'LMI'|'VLLM'
    },
    'AIWorkloadConfigIdentifier': 'string',
    'OptimizeModel': True|False,
    'PerformanceTarget': {
        'Constraints': [
            {
                'Metric': 'ttft-ms'|'throughput'|'cost'
            },
        ]
    },
    'Recommendations': [
        {
            'RecommendationDescription': 'string',
            'OptimizationDetails': [
                {
                    'OptimizationType': 'SpeculativeDecoding'|'KernelTuning',
                    'OptimizationConfig': {
                        'string': 'string'
                    }
                },
            ],
            'ModelDetails': {
                'ModelPackageArn': 'string',
                'InferenceSpecificationName': 'string',
                'InstanceDetails': [
                    {
                        'InstanceType': 'ml.g5.xlarge'|'ml.g5.2xlarge'|'ml.g5.4xlarge'|'ml.g5.8xlarge'|'ml.g5.12xlarge'|'ml.g5.16xlarge'|'ml.g5.24xlarge'|'ml.g5.48xlarge'|'ml.g6.xlarge'|'ml.g6.2xlarge'|'ml.g6.4xlarge'|'ml.g6.8xlarge'|'ml.g6.12xlarge'|'ml.g6.16xlarge'|'ml.g6.24xlarge'|'ml.g6.48xlarge'|'ml.g6e.xlarge'|'ml.g6e.2xlarge'|'ml.g6e.4xlarge'|'ml.g6e.8xlarge'|'ml.g6e.12xlarge'|'ml.g6e.16xlarge'|'ml.g6e.24xlarge'|'ml.g6e.48xlarge'|'ml.g7e.2xlarge'|'ml.g7e.4xlarge'|'ml.g7e.8xlarge'|'ml.g7e.12xlarge'|'ml.g7e.24xlarge'|'ml.g7e.48xlarge'|'ml.p3.2xlarge'|'ml.p3.8xlarge'|'ml.p3.16xlarge'|'ml.p4d.24xlarge'|'ml.p4de.24xlarge'|'ml.p5.4xlarge'|'ml.p5.48xlarge'|'ml.p5e.48xlarge'|'ml.p5en.48xlarge'|'ml.p6-b200.48xlarge',
                        'InstanceCount': 123,
                        'CopyCountPerInstance': 123
                    },
                ]
            },
            'DeploymentConfiguration': {
                'S3': [
                    {
                        'ChannelName': 'string',
                        'Uri': 'string'
                    },
                ],
                'ImageUri': 'string',
                'InstanceType': 'ml.g5.xlarge'|'ml.g5.2xlarge'|'ml.g5.4xlarge'|'ml.g5.8xlarge'|'ml.g5.12xlarge'|'ml.g5.16xlarge'|'ml.g5.24xlarge'|'ml.g5.48xlarge'|'ml.g6.xlarge'|'ml.g6.2xlarge'|'ml.g6.4xlarge'|'ml.g6.8xlarge'|'ml.g6.12xlarge'|'ml.g6.16xlarge'|'ml.g6.24xlarge'|'ml.g6.48xlarge'|'ml.g6e.xlarge'|'ml.g6e.2xlarge'|'ml.g6e.4xlarge'|'ml.g6e.8xlarge'|'ml.g6e.12xlarge'|'ml.g6e.16xlarge'|'ml.g6e.24xlarge'|'ml.g6e.48xlarge'|'ml.g7e.2xlarge'|'ml.g7e.4xlarge'|'ml.g7e.8xlarge'|'ml.g7e.12xlarge'|'ml.g7e.24xlarge'|'ml.g7e.48xlarge'|'ml.p3.2xlarge'|'ml.p3.8xlarge'|'ml.p3.16xlarge'|'ml.p4d.24xlarge'|'ml.p4de.24xlarge'|'ml.p5.4xlarge'|'ml.p5.48xlarge'|'ml.p5e.48xlarge'|'ml.p5en.48xlarge'|'ml.p6-b200.48xlarge',
                'InstanceCount': 123,
                'CopyCountPerInstance': 123,
                'EnvironmentVariables': {
                    'string': 'string'
                },
                'MinCpuMemoryRequiredInMb': 123
            },
            'AIBenchmarkJobArn': 'string',
            'ExpectedPerformance': [
                {
                    'Metric': 'string',
                    'Stat': 'string',
                    'Value': 'string',
                    'Unit': 'string'
                },
            ],
            'AdapterDetails': {
                'ModelPackageArns': [
                    {
                        'AdapterId': 'string',
                        'ModelPackageArn': 'string'
                    },
                ],
                'S3Uris': [
                    {
                        'AdapterId': 'string',
                        'S3Uri': 'string'
                    },
                ]
            }
        },
    ],
    'RoleArn': 'string',
    'ComputeSpec': {
        'InstanceTypes': [
            'ml.g5.xlarge'|'ml.g5.2xlarge'|'ml.g5.4xlarge'|'ml.g5.8xlarge'|'ml.g5.12xlarge'|'ml.g5.16xlarge'|'ml.g5.24xlarge'|'ml.g5.48xlarge'|'ml.g6.xlarge'|'ml.g6.2xlarge'|'ml.g6.4xlarge'|'ml.g6.8xlarge'|'ml.g6.12xlarge'|'ml.g6.16xlarge'|'ml.g6.24xlarge'|'ml.g6.48xlarge'|'ml.g6e.xlarge'|'ml.g6e.2xlarge'|'ml.g6e.4xlarge'|'ml.g6e.8xlarge'|'ml.g6e.12xlarge'|'ml.g6e.16xlarge'|'ml.g6e.24xlarge'|'ml.g6e.48xlarge'|'ml.g7e.2xlarge'|'ml.g7e.4xlarge'|'ml.g7e.8xlarge'|'ml.g7e.12xlarge'|'ml.g7e.24xlarge'|'ml.g7e.48xlarge'|'ml.p3.2xlarge'|'ml.p3.8xlarge'|'ml.p3.16xlarge'|'ml.p4d.24xlarge'|'ml.p4de.24xlarge'|'ml.p5.4xlarge'|'ml.p5.48xlarge'|'ml.p5e.48xlarge'|'ml.p5en.48xlarge'|'ml.p6-b200.48xlarge',
        ],
        'CapacityReservationConfig': {
            'CapacityReservationPreference': 'capacity-reservations-only',
            'MlReservationArns': [
                'string',
            ]
        }
    },
    'AdapterSource': {
        'ModelPackageArns': [
            {
                'AdapterId': 'string',
                'ModelPackageArn': 'string'
            },
        ],
        'S3Uris': [
            {
                'AdapterId': 'string',
                'S3Uri': 'string'
            },
        ]
    },
    'CreationTime': datetime(2015, 1, 1),
    'StartTime': datetime(2015, 1, 1),
    'EndTime': datetime(2015, 1, 1),
    'Tags': [
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • AIRecommendationJobName (string) --

      The name of the AI recommendation job.

    • AIRecommendationJobArn (string) --

      The Amazon Resource Name (ARN) of the AI recommendation job.

    • AIRecommendationJobStatus (string) --

      The status of the AI recommendation job.

    • FailureReason (string) --

      If the recommendation job failed, the reason it failed.

    • ModelSource (dict) --

      The source of the model that was analyzed.

      • S3 (dict) --

        The Amazon S3 location of the model artifacts.

        • S3Uri (string) --

          The Amazon S3 URI of the model artifacts.

    • OutputConfig (dict) --

      The output configuration for the recommendation job.

      • S3OutputLocation (string) --

        The Amazon S3 URI where the recommendation job writes its output results.

      • ModelPackageGroupIdentifier (string) --

        The name or Amazon Resource Name (ARN) of the model package group where deployment-ready model packages are registered.

      • MlflowConfig (dict) --

        The MLflow tracking configuration for the job.

        • MlflowResourceArn (string) --

          The Amazon Resource Name (ARN) of the SageMaker managed MLflow resource.

        • MlflowExperimentName (string) --

          The MLflow experiment name used for tracking.

        • MlflowRunName (string) --

          The MLflow run name used for tracking.

    • InferenceSpecification (dict) --

      The inference framework configuration.

      • Framework (string) --

        The inference framework. Valid values are LMI and VLLM.

    • AIWorkloadConfigIdentifier (string) --

      The name or Amazon Resource Name (ARN) of the AI workload configuration used for this recommendation job.

    • OptimizeModel (boolean) --

      Whether model optimization techniques were allowed.

    • PerformanceTarget (dict) --

      The performance targets specified for the recommendation job.

      • Constraints (list) --

        An array of performance constraints that define the optimization objectives.

        • (dict) --

          A performance constraint for an AI recommendation job.

          • Metric (string) --

            The performance metric. Valid values are ttft-ms (time to first token in milliseconds), throughput, and cost.

    • Recommendations (list) --

      The list of optimization recommendations generated by the job. Each recommendation includes optimization details, deployment configuration, expected performance metrics, and the associated benchmark job ARN.

      • (dict) --

        An optimization recommendation generated by an AI recommendation job.

        • RecommendationDescription (string) --

          A description of the recommendation.

        • OptimizationDetails (list) --

          The optimization techniques applied in this recommendation.

          • (dict) --

            Details about an optimization technique applied in a recommendation.

            • OptimizationType (string) --

              The type of optimization. Valid values are SpeculativeDecoding and KernelTuning.

            • OptimizationConfig (dict) --

              A map of configuration parameters for the optimization technique.

              • (string) --

                • (string) --

        • ModelDetails (dict) --

          Details about the model package associated with this recommendation.

          • ModelPackageArn (string) --

            The Amazon Resource Name (ARN) of the model package.

          • InferenceSpecificationName (string) --

            The name of the inference specification within the model package.

          • InstanceDetails (list) --

            The instance details for this recommendation, including instance type, count, and model copies per instance.

            • (dict) --

              Instance details for a recommendation.

              • InstanceType (string) --

                The recommended instance type.

              • InstanceCount (integer) --

                The recommended number of instances.

              • CopyCountPerInstance (integer) --

                The number of model copies per instance.

        • DeploymentConfiguration (dict) --

          The deployment configuration for this recommendation, including the container image, instance type, instance count, and environment variables.

          • S3 (list) --

            The Amazon S3 data channels for the deployment.

            • (dict) --

              An Amazon S3 data channel for a recommended deployment configuration, containing model artifacts or optimized model outputs.

              • ChannelName (string) --

                A custom name for this Amazon S3 data channel.

              • Uri (string) --

                The Amazon S3 URI of the data for this channel.

          • ImageUri (string) --

            The URI of the container image for the deployment.

          • InstanceType (string) --

            The recommended instance type for the deployment.

          • InstanceCount (integer) --

            The recommended number of instances for the deployment.

          • CopyCountPerInstance (integer) --

            The number of model copies per instance.

          • EnvironmentVariables (dict) --

            The environment variables for the deployment.

            • (string) --

              • (string) --

          • MinCpuMemoryRequiredInMb (integer) --

            The minimum host (CPU) memory, in MiB, to reserve per model copy when deploying the recommendation as an Inference Component. This value maps to the base Inference Component's ComputeResourceRequirements$MinMemoryRequiredInMb and is sized so that CopyCountPerInstance copies co-place within the instance's allocatable host memory.

        • AIBenchmarkJobArn (string) --

          The Amazon Resource Name (ARN) of the benchmark job associated with this recommendation.

        • ExpectedPerformance (list) --

          The expected performance metrics for this recommendation.

          • (dict) --

            An expected performance metric for a recommendation.

            • Metric (string) --

              The name of the performance metric.

            • Stat (string) --

              The statistical measure for the metric.

            • Value (string) --

              The value of the metric.

            • Unit (string) --

              The unit of the metric value.

        • AdapterDetails (dict) --

          The LoRA adapter details for this recommendation. This field contains both the model package ARNs and Amazon S3 URIs for each adapter, regardless of which form was originally supplied. This field is absent when the job was created without LoRA adapters.

          • ModelPackageArns (list) --

            The list of LoRA adapters with their model package ARNs.

            • (dict) --

              A LoRA adapter entry identified by a model package ARN.

              • AdapterId (string) --

                A unique identifier for the adapter. This ID is used as the inference component name when the adapter is deployed. The ID must start and end with an alphanumeric character, can contain hyphens between alphanumeric characters, and can be up to 63 characters long.

              • ModelPackageArn (string) --

                The Amazon Resource Name (ARN) of the model package that contains the LoRA adapter artifacts.

          • S3Uris (list) --

            The list of LoRA adapters with their Amazon S3 URIs.

            • (dict) --

              A LoRA adapter entry identified by an Amazon S3 URI.

              • AdapterId (string) --

                A unique identifier for the adapter. This ID is used as the inference component name when the adapter is deployed. The ID must start and end with an alphanumeric character, can contain hyphens between alphanumeric characters, and can be up to 63 characters long.

              • S3Uri (string) --

                The Amazon S3 URI of the directory that contains the LoRA adapter artifacts in PEFT format.

    • RoleArn (string) --

      The Amazon Resource Name (ARN) of the IAM role used by the recommendation job.

    • ComputeSpec (dict) --

      The compute resource specification for the recommendation job.

      • InstanceTypes (list) --

        The list of instance types to consider for recommendations. You can specify up to 3 instance types.

        • (string) --

      • CapacityReservationConfig (dict) --

        The capacity reservation configuration.

        • CapacityReservationPreference (string) --

          The capacity reservation preference. The only valid value is capacity-reservations-only.

        • MlReservationArns (list) --

          The list of ML reservation ARNs to use.

          • (string) --

    • AdapterSource (dict) --

      The LoRA adapter source that was specified when the recommendation job was created. This field is absent when the job was created without LoRA adapters.

      • ModelPackageArns (list) --

        A list of LoRA adapters identified by their model package ARNs. Use this when your adapters were produced by a SageMaker AI fine-tuning workflow that registers model packages.

        • (dict) --

          A LoRA adapter entry identified by a model package ARN.

          • AdapterId (string) --

            A unique identifier for the adapter. This ID is used as the inference component name when the adapter is deployed. The ID must start and end with an alphanumeric character, can contain hyphens between alphanumeric characters, and can be up to 63 characters long.

          • ModelPackageArn (string) --

            The Amazon Resource Name (ARN) of the model package that contains the LoRA adapter artifacts.

      • S3Uris (list) --

        A list of LoRA adapters identified by their Amazon S3 URIs. Use this when your adapters are stored as raw artifacts in Amazon S3.

        • (dict) --

          A LoRA adapter entry identified by an Amazon S3 URI.

          • AdapterId (string) --

            A unique identifier for the adapter. This ID is used as the inference component name when the adapter is deployed. The ID must start and end with an alphanumeric character, can contain hyphens between alphanumeric characters, and can be up to 63 characters long.

          • S3Uri (string) --

            The Amazon S3 URI of the directory that contains the LoRA adapter artifacts in PEFT format.

    • CreationTime (datetime) --

      A timestamp that indicates when the recommendation job was created.

    • StartTime (datetime) --

      A timestamp that indicates when the recommendation job started running.

    • EndTime (datetime) --

      A timestamp that indicates when the recommendation job completed.

    • Tags (list) --

      The tags associated with the recommendation job.

      • (dict) --

        A tag object that consists of a key and an optional value, used to manage metadata for SageMaker Amazon Web Services resources.

        You can add tags to notebook instances, training jobs, hyperparameter tuning jobs, batch transform jobs, models, labeling jobs, work teams, endpoint configurations, and endpoints. For more information on adding tags to SageMaker resources, see AddTags.

        For more information on adding metadata to your Amazon Web Services resources with tagging, see Tagging Amazon Web Services resources. For advice on best practices for managing Amazon Web Services resources with tagging, see Tagging Best Practices: Implement an Effective Amazon Web Services Resource Tagging Strategy.

        • Key (string) --

          The tag key. Tag keys must be unique per resource.

        • Value (string) --

          The tag value.

DescribeNotebookInstance (updated) Link ¶
Changes (response)
{'InstanceType': {'ml.g7e.12xlarge',
                  'ml.g7e.24xlarge',
                  'ml.g7e.2xlarge',
                  'ml.g7e.48xlarge',
                  'ml.g7e.4xlarge',
                  'ml.g7e.8xlarge'}}

Returns information about a notebook instance.

See also: AWS API Documentation

Request Syntax

client.describe_notebook_instance(
    NotebookInstanceName='string'
)
type NotebookInstanceName:

string

param NotebookInstanceName:

[REQUIRED]

The name of the notebook instance that you want information about.

rtype:

dict

returns:

Response Syntax

{
    'NotebookInstanceArn': 'string',
    'NotebookInstanceName': 'string',
    'NotebookInstanceStatus': 'Pending'|'InService'|'Stopping'|'Stopped'|'Failed'|'Deleting'|'Updating',
    'FailureReason': 'string',
    'Url': 'string',
    'InstanceType': 'ml.t2.medium'|'ml.t2.large'|'ml.t2.xlarge'|'ml.t2.2xlarge'|'ml.t3.medium'|'ml.t3.large'|'ml.t3.xlarge'|'ml.t3.2xlarge'|'ml.m4.xlarge'|'ml.m4.2xlarge'|'ml.m4.4xlarge'|'ml.m4.10xlarge'|'ml.m4.16xlarge'|'ml.m5.xlarge'|'ml.m5.2xlarge'|'ml.m5.4xlarge'|'ml.m5.12xlarge'|'ml.m5.24xlarge'|'ml.m5d.large'|'ml.m5d.xlarge'|'ml.m5d.2xlarge'|'ml.m5d.4xlarge'|'ml.m5d.8xlarge'|'ml.m5d.12xlarge'|'ml.m5d.16xlarge'|'ml.m5d.24xlarge'|'ml.c4.xlarge'|'ml.c4.2xlarge'|'ml.c4.4xlarge'|'ml.c4.8xlarge'|'ml.c5.xlarge'|'ml.c5.2xlarge'|'ml.c5.4xlarge'|'ml.c5.9xlarge'|'ml.c5.18xlarge'|'ml.c5d.xlarge'|'ml.c5d.2xlarge'|'ml.c5d.4xlarge'|'ml.c5d.9xlarge'|'ml.c5d.18xlarge'|'ml.p2.xlarge'|'ml.p2.8xlarge'|'ml.p2.16xlarge'|'ml.p3.2xlarge'|'ml.p3.8xlarge'|'ml.p3.16xlarge'|'ml.p3dn.24xlarge'|'ml.g4dn.xlarge'|'ml.g4dn.2xlarge'|'ml.g4dn.4xlarge'|'ml.g4dn.8xlarge'|'ml.g4dn.12xlarge'|'ml.g4dn.16xlarge'|'ml.r5.large'|'ml.r5.xlarge'|'ml.r5.2xlarge'|'ml.r5.4xlarge'|'ml.r5.8xlarge'|'ml.r5.12xlarge'|'ml.r5.16xlarge'|'ml.r5.24xlarge'|'ml.g5.xlarge'|'ml.g5.2xlarge'|'ml.g5.4xlarge'|'ml.g5.8xlarge'|'ml.g5.16xlarge'|'ml.g5.12xlarge'|'ml.g5.24xlarge'|'ml.g5.48xlarge'|'ml.inf1.xlarge'|'ml.inf1.2xlarge'|'ml.inf1.6xlarge'|'ml.inf1.24xlarge'|'ml.trn1.2xlarge'|'ml.trn1.32xlarge'|'ml.trn1n.32xlarge'|'ml.inf2.xlarge'|'ml.inf2.8xlarge'|'ml.inf2.24xlarge'|'ml.inf2.48xlarge'|'ml.p4d.24xlarge'|'ml.p4de.24xlarge'|'ml.p5.48xlarge'|'ml.p6-b200.48xlarge'|'ml.m6i.large'|'ml.m6i.xlarge'|'ml.m6i.2xlarge'|'ml.m6i.4xlarge'|'ml.m6i.8xlarge'|'ml.m6i.12xlarge'|'ml.m6i.16xlarge'|'ml.m6i.24xlarge'|'ml.m6i.32xlarge'|'ml.m7i.large'|'ml.m7i.xlarge'|'ml.m7i.2xlarge'|'ml.m7i.4xlarge'|'ml.m7i.8xlarge'|'ml.m7i.12xlarge'|'ml.m7i.16xlarge'|'ml.m7i.24xlarge'|'ml.m7i.48xlarge'|'ml.c6i.large'|'ml.c6i.xlarge'|'ml.c6i.2xlarge'|'ml.c6i.4xlarge'|'ml.c6i.8xlarge'|'ml.c6i.12xlarge'|'ml.c6i.16xlarge'|'ml.c6i.24xlarge'|'ml.c6i.32xlarge'|'ml.c7i.large'|'ml.c7i.xlarge'|'ml.c7i.2xlarge'|'ml.c7i.4xlarge'|'ml.c7i.8xlarge'|'ml.c7i.12xlarge'|'ml.c7i.16xlarge'|'ml.c7i.24xlarge'|'ml.c7i.48xlarge'|'ml.r6i.large'|'ml.r6i.xlarge'|'ml.r6i.2xlarge'|'ml.r6i.4xlarge'|'ml.r6i.8xlarge'|'ml.r6i.12xlarge'|'ml.r6i.16xlarge'|'ml.r6i.24xlarge'|'ml.r6i.32xlarge'|'ml.r7i.large'|'ml.r7i.xlarge'|'ml.r7i.2xlarge'|'ml.r7i.4xlarge'|'ml.r7i.8xlarge'|'ml.r7i.12xlarge'|'ml.r7i.16xlarge'|'ml.r7i.24xlarge'|'ml.r7i.48xlarge'|'ml.m6id.large'|'ml.m6id.xlarge'|'ml.m6id.2xlarge'|'ml.m6id.4xlarge'|'ml.m6id.8xlarge'|'ml.m6id.12xlarge'|'ml.m6id.16xlarge'|'ml.m6id.24xlarge'|'ml.m6id.32xlarge'|'ml.c6id.large'|'ml.c6id.xlarge'|'ml.c6id.2xlarge'|'ml.c6id.4xlarge'|'ml.c6id.8xlarge'|'ml.c6id.12xlarge'|'ml.c6id.16xlarge'|'ml.c6id.24xlarge'|'ml.c6id.32xlarge'|'ml.r6id.large'|'ml.r6id.xlarge'|'ml.r6id.2xlarge'|'ml.r6id.4xlarge'|'ml.r6id.8xlarge'|'ml.r6id.12xlarge'|'ml.r6id.16xlarge'|'ml.r6id.24xlarge'|'ml.r6id.32xlarge'|'ml.g6.xlarge'|'ml.g6.2xlarge'|'ml.g6.4xlarge'|'ml.g6.8xlarge'|'ml.g6.12xlarge'|'ml.g6.16xlarge'|'ml.g6.24xlarge'|'ml.g6.48xlarge'|'ml.g7e.2xlarge'|'ml.g7e.4xlarge'|'ml.g7e.8xlarge'|'ml.g7e.12xlarge'|'ml.g7e.24xlarge'|'ml.g7e.48xlarge'|'ml.p5.4xlarge'|'ml.p5en.48xlarge'|'ml.g6e.xlarge'|'ml.g6e.2xlarge'|'ml.g6e.4xlarge'|'ml.g6e.8xlarge'|'ml.g6e.12xlarge'|'ml.g6e.16xlarge'|'ml.g6e.24xlarge'|'ml.g6e.48xlarge',
    'IpAddressType': 'ipv4'|'dualstack',
    'SubnetId': 'string',
    'SecurityGroups': [
        'string',
    ],
    'RoleArn': 'string',
    'KmsKeyId': 'string',
    'NetworkInterfaceId': 'string',
    'LastModifiedTime': datetime(2015, 1, 1),
    'CreationTime': datetime(2015, 1, 1),
    'NotebookInstanceLifecycleConfigName': 'string',
    'DirectInternetAccess': 'Enabled'|'Disabled',
    'VolumeSizeInGB': 123,
    'AcceleratorTypes': [
        'ml.eia1.medium'|'ml.eia1.large'|'ml.eia1.xlarge'|'ml.eia2.medium'|'ml.eia2.large'|'ml.eia2.xlarge',
    ],
    'DefaultCodeRepository': 'string',
    'AdditionalCodeRepositories': [
        'string',
    ],
    'RootAccess': 'Enabled'|'Disabled',
    'PlatformIdentifier': 'string',
    'InstanceMetadataServiceConfiguration': {
        'MinimumInstanceMetadataServiceVersion': 'string'
    }
}

Response Structure

  • (dict) --

    • NotebookInstanceArn (string) --

      The Amazon Resource Name (ARN) of the notebook instance.

    • NotebookInstanceName (string) --

      The name of the SageMaker AI notebook instance.

    • NotebookInstanceStatus (string) --

      The status of the notebook instance.

    • FailureReason (string) --

      If status is Failed, the reason it failed.

    • Url (string) --

      The URL that you use to connect to the Jupyter notebook that is running in your notebook instance.

    • InstanceType (string) --

      The type of ML compute instance running on the notebook instance.

    • IpAddressType (string) --

      The IP address type configured for the notebook instance. Returns ipv4 for IPv4-only connectivity or dualstack for both IPv4 and IPv6 connectivity.

    • SubnetId (string) --

      The ID of the VPC subnet.

    • SecurityGroups (list) --

      The IDs of the VPC security groups.

      • (string) --

    • RoleArn (string) --

      The Amazon Resource Name (ARN) of the IAM role associated with the instance.

    • KmsKeyId (string) --

      The Amazon Web Services KMS key ID SageMaker AI uses to encrypt data when storing it on the ML storage volume attached to the instance.

    • NetworkInterfaceId (string) --

      The network interface IDs that SageMaker AI created at the time of creating the instance.

    • LastModifiedTime (datetime) --

      A timestamp. Use this parameter to retrieve the time when the notebook instance was last modified.

    • CreationTime (datetime) --

      A timestamp. Use this parameter to return the time when the notebook instance was created

    • NotebookInstanceLifecycleConfigName (string) --

      Returns the name of a notebook instance lifecycle configuration.

      For information about notebook instance lifestyle configurations, see Step 2.1: (Optional) Customize a Notebook Instance

    • DirectInternetAccess (string) --

      Describes whether SageMaker AI provides internet access to the notebook instance. If this value is set to Disabled, the notebook instance does not have internet access, and cannot connect to SageMaker AI training and endpoint services.

      For more information, see Notebook Instances Are Internet-Enabled by Default.

    • VolumeSizeInGB (integer) --

      The size, in GB, of the ML storage volume attached to the notebook instance.

    • AcceleratorTypes (list) --

      This parameter is no longer supported. Elastic Inference (EI) is no longer available.

      This parameter was used to specify a list of the EI instance types associated with this notebook instance.

      • (string) --

    • DefaultCodeRepository (string) --

      The Git repository associated with the notebook instance as its default code repository. This can be either the name of a Git repository stored as a resource in your account, or the URL of a Git repository in Amazon Web Services CodeCommit or in any other Git repository. When you open a notebook instance, it opens in the directory that contains this repository. For more information, see Associating Git Repositories with SageMaker AI Notebook Instances.

    • AdditionalCodeRepositories (list) --

      An array of up to three Git repositories associated with the notebook instance. These can be either the names of Git repositories stored as resources in your account, or the URL of Git repositories in Amazon Web Services CodeCommit or in any other Git repository. These repositories are cloned at the same level as the default repository of your notebook instance. For more information, see Associating Git Repositories with SageMaker AI Notebook Instances.

      • (string) --

    • RootAccess (string) --

      Whether root access is enabled or disabled for users of the notebook instance.

    • PlatformIdentifier (string) --

      The platform identifier of the notebook instance runtime environment.

    • InstanceMetadataServiceConfiguration (dict) --

      Information on the IMDS configuration of the notebook instance

      • MinimumInstanceMetadataServiceVersion (string) --

        Indicates the minimum IMDS version that the notebook instance supports. When passed as part of CreateNotebookInstance, if no value is selected, then it defaults to IMDSv1. This means that both IMDSv1 and IMDSv2 are supported. If passed as part of UpdateNotebookInstance, there is no default.

DescribeOptimizationJob (updated) Link ¶
Changes (response)
{'DeploymentInstanceType': {'ml.g7e.12xlarge',
                            'ml.g7e.24xlarge',
                            'ml.g7e.2xlarge',
                            'ml.g7e.48xlarge',
                            'ml.g7e.4xlarge',
                            'ml.g7e.8xlarge',
                            'ml.p6-b200.48xlarge'},
 'TrainingPlanArns': ['string']}

Provides the properties of the specified optimization job.

See also: AWS API Documentation

Request Syntax

client.describe_optimization_job(
    OptimizationJobName='string'
)
type OptimizationJobName:

string

param OptimizationJobName:

[REQUIRED]

The name that you assigned to the optimization job.

rtype:

dict

returns:

Response Syntax

{
    'OptimizationJobArn': 'string',
    'OptimizationJobStatus': 'INPROGRESS'|'COMPLETED'|'FAILED'|'STARTING'|'STOPPING'|'STOPPED',
    'OptimizationStartTime': datetime(2015, 1, 1),
    'OptimizationEndTime': datetime(2015, 1, 1),
    'CreationTime': datetime(2015, 1, 1),
    'LastModifiedTime': datetime(2015, 1, 1),
    'FailureReason': 'string',
    'OptimizationJobName': 'string',
    'ModelSource': {
        'S3': {
            'S3Uri': 'string',
            'ModelAccessConfig': {
                'AcceptEula': True|False
            }
        },
        'SageMakerModel': {
            'ModelName': 'string'
        }
    },
    'OptimizationEnvironment': {
        'string': 'string'
    },
    'DeploymentInstanceType': 'ml.p4d.24xlarge'|'ml.p4de.24xlarge'|'ml.p5.48xlarge'|'ml.p5e.48xlarge'|'ml.p5en.48xlarge'|'ml.g4dn.xlarge'|'ml.g4dn.2xlarge'|'ml.g4dn.4xlarge'|'ml.g4dn.8xlarge'|'ml.g4dn.12xlarge'|'ml.g4dn.16xlarge'|'ml.g5.xlarge'|'ml.g5.2xlarge'|'ml.g5.4xlarge'|'ml.g5.8xlarge'|'ml.g5.12xlarge'|'ml.g5.16xlarge'|'ml.g5.24xlarge'|'ml.g5.48xlarge'|'ml.g6.xlarge'|'ml.g6.2xlarge'|'ml.g6.4xlarge'|'ml.g6.8xlarge'|'ml.g6.12xlarge'|'ml.g6.16xlarge'|'ml.g6.24xlarge'|'ml.g6.48xlarge'|'ml.g6e.xlarge'|'ml.g6e.2xlarge'|'ml.g6e.4xlarge'|'ml.g6e.8xlarge'|'ml.g6e.12xlarge'|'ml.g6e.16xlarge'|'ml.g6e.24xlarge'|'ml.g6e.48xlarge'|'ml.inf2.xlarge'|'ml.inf2.8xlarge'|'ml.inf2.24xlarge'|'ml.inf2.48xlarge'|'ml.trn1.2xlarge'|'ml.trn1.32xlarge'|'ml.trn1n.32xlarge'|'ml.p6-b200.48xlarge'|'ml.g7e.2xlarge'|'ml.g7e.4xlarge'|'ml.g7e.8xlarge'|'ml.g7e.12xlarge'|'ml.g7e.24xlarge'|'ml.g7e.48xlarge',
    'MaxInstanceCount': 123,
    'OptimizationConfigs': [
        {
            'ModelQuantizationConfig': {
                'Image': 'string',
                'OverrideEnvironment': {
                    'string': 'string'
                }
            },
            'ModelCompilationConfig': {
                'Image': 'string',
                'OverrideEnvironment': {
                    'string': 'string'
                }
            },
            'ModelShardingConfig': {
                'Image': 'string',
                'OverrideEnvironment': {
                    'string': 'string'
                }
            },
            'ModelSpeculativeDecodingConfig': {
                'Technique': 'EAGLE',
                'TrainingDataSource': {
                    'S3Uri': 'string',
                    'S3DataType': 'S3Prefix'|'ManifestFile'
                }
            }
        },
    ],
    'OutputConfig': {
        'KmsKeyId': 'string',
        'S3OutputLocation': 'string',
        'SageMakerModel': {
            'ModelName': 'string'
        }
    },
    'OptimizationOutput': {
        'RecommendedInferenceImage': 'string'
    },
    'RoleArn': 'string',
    'StoppingCondition': {
        'MaxRuntimeInSeconds': 123,
        'MaxWaitTimeInSeconds': 123,
        'MaxPendingTimeInSeconds': 123
    },
    'VpcConfig': {
        'SecurityGroupIds': [
            'string',
        ],
        'Subnets': [
            'string',
        ]
    },
    'TrainingPlanArns': [
        'string',
    ]
}

Response Structure

  • (dict) --

    • OptimizationJobArn (string) --

      The Amazon Resource Name (ARN) of the optimization job.

    • OptimizationJobStatus (string) --

      The current status of the optimization job.

    • OptimizationStartTime (datetime) --

      The time when the optimization job started.

    • OptimizationEndTime (datetime) --

      The time when the optimization job finished processing.

    • CreationTime (datetime) --

      The time when you created the optimization job.

    • LastModifiedTime (datetime) --

      The time when the optimization job was last updated.

    • FailureReason (string) --

      If the optimization job status is FAILED, the reason for the failure.

    • OptimizationJobName (string) --

      The name that you assigned to the optimization job.

    • ModelSource (dict) --

      The location of the source model to optimize with an optimization job.

      • S3 (dict) --

        The Amazon S3 location of a source model to optimize with an optimization job.

        • S3Uri (string) --

          An Amazon S3 URI that locates a source model to optimize with an optimization job.

        • ModelAccessConfig (dict) --

          The access configuration settings for the source ML model for an optimization job, where you can accept the model end-user license agreement (EULA).

          • AcceptEula (boolean) --

            Specifies agreement to the model end-user license agreement (EULA). The AcceptEula value must be explicitly defined as True in order to accept the EULA that this model requires. You are responsible for reviewing and complying with any applicable license terms and making sure they are acceptable for your use case before downloading or using a model.

      • SageMakerModel (dict) --

        The name of an existing SageMaker model to optimize with an optimization job.

        • ModelName (string) --

          The name of a SageMaker model.

    • OptimizationEnvironment (dict) --

      The environment variables to set in the model container.

      • (string) --

        • (string) --

    • DeploymentInstanceType (string) --

      The type of instance that hosts the optimized model that you create with the optimization job.

    • MaxInstanceCount (integer) --

      The maximum number of instances to use for the optimization job.

    • OptimizationConfigs (list) --

      Settings for each of the optimization techniques that the job applies.

      • (dict) --

        Settings for an optimization technique that you apply with a model optimization job.

        • ModelQuantizationConfig (dict) --

          Settings for the model quantization technique that's applied by a model optimization job.

          • Image (string) --

            The URI of an LMI DLC in Amazon ECR. SageMaker uses this image to run the optimization.

          • OverrideEnvironment (dict) --

            Environment variables that override the default ones in the model container.

            • (string) --

              • (string) --

        • ModelCompilationConfig (dict) --

          Settings for the model compilation technique that's applied by a model optimization job.

          • Image (string) --

            The URI of an LMI DLC in Amazon ECR. SageMaker uses this image to run the optimization.

          • OverrideEnvironment (dict) --

            Environment variables that override the default ones in the model container.

            • (string) --

              • (string) --

        • ModelShardingConfig (dict) --

          Settings for the model sharding technique that's applied by a model optimization job.

          • Image (string) --

            The URI of an LMI DLC in Amazon ECR. SageMaker uses this image to run the optimization.

          • OverrideEnvironment (dict) --

            Environment variables that override the default ones in the model container.

            • (string) --

              • (string) --

        • ModelSpeculativeDecodingConfig (dict) --

          Settings for the model speculative decoding technique that's applied by a model optimization job.

          • Technique (string) --

            The speculative decoding technique to apply during model optimization.

          • TrainingDataSource (dict) --

            The location of the training data to use for speculative decoding. The data must be formatted as ShareGPT, OpenAI Completions or OpenAI Chat Completions. The input can also be unencrypted captured data from a SageMaker endpoint as long as the endpoint uses one of the above formats.

            • S3Uri (string) --

              The Amazon S3 URI that points to the training data for speculative decoding.

            • S3DataType (string) --

              The type of data stored in the Amazon S3 location. Valid values are S3Prefix or ManifestFile.

    • OutputConfig (dict) --

      Details for where to store the optimized model that you create with the optimization job.

      • KmsKeyId (string) --

        The Amazon Resource Name (ARN) of a key in Amazon Web Services KMS. SageMaker uses they key to encrypt the artifacts of the optimized model when SageMaker uploads the model to Amazon S3.

      • S3OutputLocation (string) --

        The Amazon S3 URI for where to store the optimized model that you create with an optimization job.

      • SageMakerModel (dict) --

        The name of a SageMaker model to use as the output destination for an optimization job.

        • ModelName (string) --

          The name of a SageMaker model.

    • OptimizationOutput (dict) --

      Output values produced by an optimization job.

      • RecommendedInferenceImage (string) --

        The image that SageMaker recommends that you use to host the optimized model that you created with an optimization job.

    • RoleArn (string) --

      The ARN of the IAM role that you assigned to the optimization job.

    • StoppingCondition (dict) --

      Specifies a limit to how long a job can run. When the job reaches the time limit, SageMaker ends the job. Use this API to cap costs.

      To stop a training job, SageMaker sends the algorithm the SIGTERM signal, which delays job termination for 120 seconds. Algorithms can use this 120-second window to save the model artifacts, so the results of training are not lost.

      The training algorithms provided by SageMaker automatically save the intermediate results of a model training job when possible. This attempt to save artifacts is only a best effort case as model might not be in a state from which it can be saved. For example, if training has just started, the model might not be ready to save. When saved, this intermediate data is a valid model artifact. You can use it to create a model with CreateModel.

      • MaxRuntimeInSeconds (integer) --

        The maximum length of time, in seconds, that a training or compilation job can run before it is stopped.

        For compilation jobs, if the job does not complete during this time, a TimeOut error is generated. We recommend starting with 900 seconds and increasing as necessary based on your model.

        For all other jobs, if the job does not complete during this time, SageMaker ends the job. When RetryStrategy is specified in the job request, MaxRuntimeInSeconds specifies the maximum time for all of the attempts in total, not each individual attempt. The default value is 1 day. The maximum value is 28 days.

        The maximum time that a TrainingJob can run in total, including any time spent publishing metrics or archiving and uploading models after it has been stopped, is 30 days.

      • MaxWaitTimeInSeconds (integer) --

        The maximum length of time, in seconds, that a managed Spot training job has to complete. It is the amount of time spent waiting for Spot capacity plus the amount of time the job can run. It must be equal to or greater than MaxRuntimeInSeconds. If the job does not complete during this time, SageMaker ends the job.

        When RetryStrategy is specified in the job request, MaxWaitTimeInSeconds specifies the maximum time for all of the attempts in total, not each individual attempt.

      • MaxPendingTimeInSeconds (integer) --

        The maximum length of time, in seconds, that a training or compilation job can be pending before it is stopped.

    • VpcConfig (dict) --

      A VPC in Amazon VPC that your optimized model has access to.

      • SecurityGroupIds (list) --

        The VPC security group IDs, in the form sg-xxxxxxxx. Specify the security groups for the VPC that is specified in the Subnets field.

        • (string) --

      • Subnets (list) --

        The ID of the subnets in the VPC to which you want to connect your optimized model.

        • (string) --

    • TrainingPlanArns (list) --

      The Amazon Resource Name (ARN) of the training plan associated with this optimization job. This field appears only when you specified a training plan when you created the job. Optimization jobs that use on-demand capacity don't return this field.

      • (string) --

ListNotebookInstances (updated) Link ¶
Changes (response)
{'NotebookInstances': {'InstanceType': {'ml.g7e.12xlarge',
                                        'ml.g7e.24xlarge',
                                        'ml.g7e.2xlarge',
                                        'ml.g7e.48xlarge',
                                        'ml.g7e.4xlarge',
                                        'ml.g7e.8xlarge'}}}

Returns a list of the SageMaker AI notebook instances in the requester's account in an Amazon Web Services Region.

See also: AWS API Documentation

Request Syntax

client.list_notebook_instances(
    NextToken='string',
    MaxResults=123,
    SortBy='Name'|'CreationTime'|'Status',
    SortOrder='Ascending'|'Descending',
    NameContains='string',
    CreationTimeBefore=datetime(2015, 1, 1),
    CreationTimeAfter=datetime(2015, 1, 1),
    LastModifiedTimeBefore=datetime(2015, 1, 1),
    LastModifiedTimeAfter=datetime(2015, 1, 1),
    StatusEquals='Pending'|'InService'|'Stopping'|'Stopped'|'Failed'|'Deleting'|'Updating',
    NotebookInstanceLifecycleConfigNameContains='string',
    DefaultCodeRepositoryContains='string',
    AdditionalCodeRepositoryEquals='string'
)
type NextToken:

string

param NextToken:

If the previous call to the ListNotebookInstances is truncated, the response includes a NextToken. You can use this token in your subsequent ListNotebookInstances request to fetch the next set of notebook instances.

type MaxResults:

integer

param MaxResults:

The maximum number of notebook instances to return.

type SortBy:

string

param SortBy:

The field to sort results by. The default is Name.

type SortOrder:

string

param SortOrder:

The sort order for results.

type NameContains:

string

param NameContains:

A string in the notebook instances' name. This filter returns only notebook instances whose name contains the specified string.

type CreationTimeBefore:

datetime

param CreationTimeBefore:

A filter that returns only notebook instances that were created before the specified time (timestamp).

type CreationTimeAfter:

datetime

param CreationTimeAfter:

A filter that returns only notebook instances that were created after the specified time (timestamp).

type LastModifiedTimeBefore:

datetime

param LastModifiedTimeBefore:

A filter that returns only notebook instances that were modified before the specified time (timestamp).

type LastModifiedTimeAfter:

datetime

param LastModifiedTimeAfter:

A filter that returns only notebook instances that were modified after the specified time (timestamp).

type StatusEquals:

string

param StatusEquals:

A filter that returns only notebook instances with the specified status.

type NotebookInstanceLifecycleConfigNameContains:

string

param NotebookInstanceLifecycleConfigNameContains:

A string in the name of a notebook instances lifecycle configuration associated with this notebook instance. This filter returns only notebook instances associated with a lifecycle configuration with a name that contains the specified string.

type DefaultCodeRepositoryContains:

string

param DefaultCodeRepositoryContains:

A string in the name or URL of a Git repository associated with this notebook instance. This filter returns only notebook instances associated with a git repository with a name that contains the specified string.

type AdditionalCodeRepositoryEquals:

string

param AdditionalCodeRepositoryEquals:

A filter that returns only notebook instances with associated with the specified git repository.

rtype:

dict

returns:

Response Syntax

{
    'NextToken': 'string',
    'NotebookInstances': [
        {
            'NotebookInstanceName': 'string',
            'NotebookInstanceArn': 'string',
            'NotebookInstanceStatus': 'Pending'|'InService'|'Stopping'|'Stopped'|'Failed'|'Deleting'|'Updating',
            'Url': 'string',
            'InstanceType': 'ml.t2.medium'|'ml.t2.large'|'ml.t2.xlarge'|'ml.t2.2xlarge'|'ml.t3.medium'|'ml.t3.large'|'ml.t3.xlarge'|'ml.t3.2xlarge'|'ml.m4.xlarge'|'ml.m4.2xlarge'|'ml.m4.4xlarge'|'ml.m4.10xlarge'|'ml.m4.16xlarge'|'ml.m5.xlarge'|'ml.m5.2xlarge'|'ml.m5.4xlarge'|'ml.m5.12xlarge'|'ml.m5.24xlarge'|'ml.m5d.large'|'ml.m5d.xlarge'|'ml.m5d.2xlarge'|'ml.m5d.4xlarge'|'ml.m5d.8xlarge'|'ml.m5d.12xlarge'|'ml.m5d.16xlarge'|'ml.m5d.24xlarge'|'ml.c4.xlarge'|'ml.c4.2xlarge'|'ml.c4.4xlarge'|'ml.c4.8xlarge'|'ml.c5.xlarge'|'ml.c5.2xlarge'|'ml.c5.4xlarge'|'ml.c5.9xlarge'|'ml.c5.18xlarge'|'ml.c5d.xlarge'|'ml.c5d.2xlarge'|'ml.c5d.4xlarge'|'ml.c5d.9xlarge'|'ml.c5d.18xlarge'|'ml.p2.xlarge'|'ml.p2.8xlarge'|'ml.p2.16xlarge'|'ml.p3.2xlarge'|'ml.p3.8xlarge'|'ml.p3.16xlarge'|'ml.p3dn.24xlarge'|'ml.g4dn.xlarge'|'ml.g4dn.2xlarge'|'ml.g4dn.4xlarge'|'ml.g4dn.8xlarge'|'ml.g4dn.12xlarge'|'ml.g4dn.16xlarge'|'ml.r5.large'|'ml.r5.xlarge'|'ml.r5.2xlarge'|'ml.r5.4xlarge'|'ml.r5.8xlarge'|'ml.r5.12xlarge'|'ml.r5.16xlarge'|'ml.r5.24xlarge'|'ml.g5.xlarge'|'ml.g5.2xlarge'|'ml.g5.4xlarge'|'ml.g5.8xlarge'|'ml.g5.16xlarge'|'ml.g5.12xlarge'|'ml.g5.24xlarge'|'ml.g5.48xlarge'|'ml.inf1.xlarge'|'ml.inf1.2xlarge'|'ml.inf1.6xlarge'|'ml.inf1.24xlarge'|'ml.trn1.2xlarge'|'ml.trn1.32xlarge'|'ml.trn1n.32xlarge'|'ml.inf2.xlarge'|'ml.inf2.8xlarge'|'ml.inf2.24xlarge'|'ml.inf2.48xlarge'|'ml.p4d.24xlarge'|'ml.p4de.24xlarge'|'ml.p5.48xlarge'|'ml.p6-b200.48xlarge'|'ml.m6i.large'|'ml.m6i.xlarge'|'ml.m6i.2xlarge'|'ml.m6i.4xlarge'|'ml.m6i.8xlarge'|'ml.m6i.12xlarge'|'ml.m6i.16xlarge'|'ml.m6i.24xlarge'|'ml.m6i.32xlarge'|'ml.m7i.large'|'ml.m7i.xlarge'|'ml.m7i.2xlarge'|'ml.m7i.4xlarge'|'ml.m7i.8xlarge'|'ml.m7i.12xlarge'|'ml.m7i.16xlarge'|'ml.m7i.24xlarge'|'ml.m7i.48xlarge'|'ml.c6i.large'|'ml.c6i.xlarge'|'ml.c6i.2xlarge'|'ml.c6i.4xlarge'|'ml.c6i.8xlarge'|'ml.c6i.12xlarge'|'ml.c6i.16xlarge'|'ml.c6i.24xlarge'|'ml.c6i.32xlarge'|'ml.c7i.large'|'ml.c7i.xlarge'|'ml.c7i.2xlarge'|'ml.c7i.4xlarge'|'ml.c7i.8xlarge'|'ml.c7i.12xlarge'|'ml.c7i.16xlarge'|'ml.c7i.24xlarge'|'ml.c7i.48xlarge'|'ml.r6i.large'|'ml.r6i.xlarge'|'ml.r6i.2xlarge'|'ml.r6i.4xlarge'|'ml.r6i.8xlarge'|'ml.r6i.12xlarge'|'ml.r6i.16xlarge'|'ml.r6i.24xlarge'|'ml.r6i.32xlarge'|'ml.r7i.large'|'ml.r7i.xlarge'|'ml.r7i.2xlarge'|'ml.r7i.4xlarge'|'ml.r7i.8xlarge'|'ml.r7i.12xlarge'|'ml.r7i.16xlarge'|'ml.r7i.24xlarge'|'ml.r7i.48xlarge'|'ml.m6id.large'|'ml.m6id.xlarge'|'ml.m6id.2xlarge'|'ml.m6id.4xlarge'|'ml.m6id.8xlarge'|'ml.m6id.12xlarge'|'ml.m6id.16xlarge'|'ml.m6id.24xlarge'|'ml.m6id.32xlarge'|'ml.c6id.large'|'ml.c6id.xlarge'|'ml.c6id.2xlarge'|'ml.c6id.4xlarge'|'ml.c6id.8xlarge'|'ml.c6id.12xlarge'|'ml.c6id.16xlarge'|'ml.c6id.24xlarge'|'ml.c6id.32xlarge'|'ml.r6id.large'|'ml.r6id.xlarge'|'ml.r6id.2xlarge'|'ml.r6id.4xlarge'|'ml.r6id.8xlarge'|'ml.r6id.12xlarge'|'ml.r6id.16xlarge'|'ml.r6id.24xlarge'|'ml.r6id.32xlarge'|'ml.g6.xlarge'|'ml.g6.2xlarge'|'ml.g6.4xlarge'|'ml.g6.8xlarge'|'ml.g6.12xlarge'|'ml.g6.16xlarge'|'ml.g6.24xlarge'|'ml.g6.48xlarge'|'ml.g7e.2xlarge'|'ml.g7e.4xlarge'|'ml.g7e.8xlarge'|'ml.g7e.12xlarge'|'ml.g7e.24xlarge'|'ml.g7e.48xlarge'|'ml.p5.4xlarge'|'ml.p5en.48xlarge'|'ml.g6e.xlarge'|'ml.g6e.2xlarge'|'ml.g6e.4xlarge'|'ml.g6e.8xlarge'|'ml.g6e.12xlarge'|'ml.g6e.16xlarge'|'ml.g6e.24xlarge'|'ml.g6e.48xlarge',
            'CreationTime': datetime(2015, 1, 1),
            'LastModifiedTime': datetime(2015, 1, 1),
            'NotebookInstanceLifecycleConfigName': 'string',
            'DefaultCodeRepository': 'string',
            'AdditionalCodeRepositories': [
                'string',
            ]
        },
    ]
}

Response Structure

  • (dict) --

    • NextToken (string) --

      If the response to the previous ListNotebookInstances request was truncated, SageMaker AI returns this token. To retrieve the next set of notebook instances, use the token in the next request.

    • NotebookInstances (list) --

      An array of NotebookInstanceSummary objects, one for each notebook instance.

      • (dict) --

        Provides summary information for an SageMaker AI notebook instance.

        • NotebookInstanceName (string) --

          The name of the notebook instance that you want a summary for.

        • NotebookInstanceArn (string) --

          The Amazon Resource Name (ARN) of the notebook instance.

        • NotebookInstanceStatus (string) --

          The status of the notebook instance.

        • Url (string) --

          The URL that you use to connect to the Jupyter notebook running in your notebook instance.

        • InstanceType (string) --

          The type of ML compute instance that the notebook instance is running on.

        • CreationTime (datetime) --

          A timestamp that shows when the notebook instance was created.

        • LastModifiedTime (datetime) --

          A timestamp that shows when the notebook instance was last modified.

        • NotebookInstanceLifecycleConfigName (string) --

          The name of a notebook instance lifecycle configuration associated with this notebook instance.

          For information about notebook instance lifestyle configurations, see Step 2.1: (Optional) Customize a Notebook Instance.

        • DefaultCodeRepository (string) --

          The Git repository associated with the notebook instance as its default code repository. This can be either the name of a Git repository stored as a resource in your account, or the URL of a Git repository in Amazon Web Services CodeCommit or in any other Git repository. When you open a notebook instance, it opens in the directory that contains this repository. For more information, see Associating Git Repositories with SageMaker AI Notebook Instances.

        • AdditionalCodeRepositories (list) --

          An array of up to three Git repositories associated with the notebook instance. These can be either the names of Git repositories stored as resources in your account, or the URL of Git repositories in Amazon Web Services CodeCommit or in any other Git repository. These repositories are cloned at the same level as the default repository of your notebook instance. For more information, see Associating Git Repositories with SageMaker AI Notebook Instances.

          • (string) --

ListOptimizationJobs (updated) Link ¶
Changes (response)
{'OptimizationJobSummaries': {'DeploymentInstanceType': {'ml.g7e.12xlarge',
                                                         'ml.g7e.24xlarge',
                                                         'ml.g7e.2xlarge',
                                                         'ml.g7e.48xlarge',
                                                         'ml.g7e.4xlarge',
                                                         'ml.g7e.8xlarge',
                                                         'ml.p6-b200.48xlarge'}}}

Lists the optimization jobs in your account and their properties.

See also: AWS API Documentation

Request Syntax

client.list_optimization_jobs(
    NextToken='string',
    MaxResults=123,
    CreationTimeAfter=datetime(2015, 1, 1),
    CreationTimeBefore=datetime(2015, 1, 1),
    LastModifiedTimeAfter=datetime(2015, 1, 1),
    LastModifiedTimeBefore=datetime(2015, 1, 1),
    OptimizationContains='string',
    NameContains='string',
    StatusEquals='INPROGRESS'|'COMPLETED'|'FAILED'|'STARTING'|'STOPPING'|'STOPPED',
    SortBy='Name'|'CreationTime'|'Status',
    SortOrder='Ascending'|'Descending'
)
type NextToken:

string

param NextToken:

A token that you use to get the next set of results following a truncated response. If the response to the previous request was truncated, that response provides the value for this token.

type MaxResults:

integer

param MaxResults:

The maximum number of optimization jobs to return in the response. The default is 50.

type CreationTimeAfter:

datetime

param CreationTimeAfter:

Filters the results to only those optimization jobs that were created after the specified time.

type CreationTimeBefore:

datetime

param CreationTimeBefore:

Filters the results to only those optimization jobs that were created before the specified time.

type LastModifiedTimeAfter:

datetime

param LastModifiedTimeAfter:

Filters the results to only those optimization jobs that were updated after the specified time.

type LastModifiedTimeBefore:

datetime

param LastModifiedTimeBefore:

Filters the results to only those optimization jobs that were updated before the specified time.

type OptimizationContains:

string

param OptimizationContains:

Filters the results to only those optimization jobs that apply the specified optimization techniques. You can specify either Quantization or Compilation.

type NameContains:

string

param NameContains:

Filters the results to only those optimization jobs with a name that contains the specified string.

type StatusEquals:

string

param StatusEquals:

Filters the results to only those optimization jobs with the specified status.

type SortBy:

string

param SortBy:

The field by which to sort the optimization jobs in the response. The default is CreationTime

type SortOrder:

string

param SortOrder:

The sort order for results. The default is Ascending

rtype:

dict

returns:

Response Syntax

{
    'OptimizationJobSummaries': [
        {
            'OptimizationJobName': 'string',
            'OptimizationJobArn': 'string',
            'CreationTime': datetime(2015, 1, 1),
            'OptimizationJobStatus': 'INPROGRESS'|'COMPLETED'|'FAILED'|'STARTING'|'STOPPING'|'STOPPED',
            'OptimizationStartTime': datetime(2015, 1, 1),
            'OptimizationEndTime': datetime(2015, 1, 1),
            'LastModifiedTime': datetime(2015, 1, 1),
            'DeploymentInstanceType': 'ml.p4d.24xlarge'|'ml.p4de.24xlarge'|'ml.p5.48xlarge'|'ml.p5e.48xlarge'|'ml.p5en.48xlarge'|'ml.g4dn.xlarge'|'ml.g4dn.2xlarge'|'ml.g4dn.4xlarge'|'ml.g4dn.8xlarge'|'ml.g4dn.12xlarge'|'ml.g4dn.16xlarge'|'ml.g5.xlarge'|'ml.g5.2xlarge'|'ml.g5.4xlarge'|'ml.g5.8xlarge'|'ml.g5.12xlarge'|'ml.g5.16xlarge'|'ml.g5.24xlarge'|'ml.g5.48xlarge'|'ml.g6.xlarge'|'ml.g6.2xlarge'|'ml.g6.4xlarge'|'ml.g6.8xlarge'|'ml.g6.12xlarge'|'ml.g6.16xlarge'|'ml.g6.24xlarge'|'ml.g6.48xlarge'|'ml.g6e.xlarge'|'ml.g6e.2xlarge'|'ml.g6e.4xlarge'|'ml.g6e.8xlarge'|'ml.g6e.12xlarge'|'ml.g6e.16xlarge'|'ml.g6e.24xlarge'|'ml.g6e.48xlarge'|'ml.inf2.xlarge'|'ml.inf2.8xlarge'|'ml.inf2.24xlarge'|'ml.inf2.48xlarge'|'ml.trn1.2xlarge'|'ml.trn1.32xlarge'|'ml.trn1n.32xlarge'|'ml.p6-b200.48xlarge'|'ml.g7e.2xlarge'|'ml.g7e.4xlarge'|'ml.g7e.8xlarge'|'ml.g7e.12xlarge'|'ml.g7e.24xlarge'|'ml.g7e.48xlarge',
            'MaxInstanceCount': 123,
            'OptimizationTypes': [
                'string',
            ]
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • OptimizationJobSummaries (list) --

      A list of optimization jobs and their properties that matches any of the filters you specified in the request.

      • (dict) --

        Summarizes an optimization job by providing some of its key properties.

        • OptimizationJobName (string) --

          The name that you assigned to the optimization job.

        • OptimizationJobArn (string) --

          The Amazon Resource Name (ARN) of the optimization job.

        • CreationTime (datetime) --

          The time when you created the optimization job.

        • OptimizationJobStatus (string) --

          The current status of the optimization job.

        • OptimizationStartTime (datetime) --

          The time when the optimization job started.

        • OptimizationEndTime (datetime) --

          The time when the optimization job finished processing.

        • LastModifiedTime (datetime) --

          The time when the optimization job was last updated.

        • DeploymentInstanceType (string) --

          The type of instance that hosts the optimized model that you create with the optimization job.

        • MaxInstanceCount (integer) --

          The maximum number of instances to use for the optimization job.

        • OptimizationTypes (list) --

          The optimization techniques that are applied by the optimization job.

          • (string) --

    • NextToken (string) --

      The token to use in a subsequent request to get the next set of results following a truncated response.

UpdateNotebookInstance (updated) Link ¶
Changes (request)
{'InstanceType': {'ml.g7e.12xlarge',
                  'ml.g7e.24xlarge',
                  'ml.g7e.2xlarge',
                  'ml.g7e.48xlarge',
                  'ml.g7e.4xlarge',
                  'ml.g7e.8xlarge'}}

Updates a notebook instance. NotebookInstance updates include upgrading or downgrading the ML compute instance used for your notebook instance to accommodate changes in your workload requirements.

See also: AWS API Documentation

Request Syntax

client.update_notebook_instance(
    NotebookInstanceName='string',
    InstanceType='ml.t2.medium'|'ml.t2.large'|'ml.t2.xlarge'|'ml.t2.2xlarge'|'ml.t3.medium'|'ml.t3.large'|'ml.t3.xlarge'|'ml.t3.2xlarge'|'ml.m4.xlarge'|'ml.m4.2xlarge'|'ml.m4.4xlarge'|'ml.m4.10xlarge'|'ml.m4.16xlarge'|'ml.m5.xlarge'|'ml.m5.2xlarge'|'ml.m5.4xlarge'|'ml.m5.12xlarge'|'ml.m5.24xlarge'|'ml.m5d.large'|'ml.m5d.xlarge'|'ml.m5d.2xlarge'|'ml.m5d.4xlarge'|'ml.m5d.8xlarge'|'ml.m5d.12xlarge'|'ml.m5d.16xlarge'|'ml.m5d.24xlarge'|'ml.c4.xlarge'|'ml.c4.2xlarge'|'ml.c4.4xlarge'|'ml.c4.8xlarge'|'ml.c5.xlarge'|'ml.c5.2xlarge'|'ml.c5.4xlarge'|'ml.c5.9xlarge'|'ml.c5.18xlarge'|'ml.c5d.xlarge'|'ml.c5d.2xlarge'|'ml.c5d.4xlarge'|'ml.c5d.9xlarge'|'ml.c5d.18xlarge'|'ml.p2.xlarge'|'ml.p2.8xlarge'|'ml.p2.16xlarge'|'ml.p3.2xlarge'|'ml.p3.8xlarge'|'ml.p3.16xlarge'|'ml.p3dn.24xlarge'|'ml.g4dn.xlarge'|'ml.g4dn.2xlarge'|'ml.g4dn.4xlarge'|'ml.g4dn.8xlarge'|'ml.g4dn.12xlarge'|'ml.g4dn.16xlarge'|'ml.r5.large'|'ml.r5.xlarge'|'ml.r5.2xlarge'|'ml.r5.4xlarge'|'ml.r5.8xlarge'|'ml.r5.12xlarge'|'ml.r5.16xlarge'|'ml.r5.24xlarge'|'ml.g5.xlarge'|'ml.g5.2xlarge'|'ml.g5.4xlarge'|'ml.g5.8xlarge'|'ml.g5.16xlarge'|'ml.g5.12xlarge'|'ml.g5.24xlarge'|'ml.g5.48xlarge'|'ml.inf1.xlarge'|'ml.inf1.2xlarge'|'ml.inf1.6xlarge'|'ml.inf1.24xlarge'|'ml.trn1.2xlarge'|'ml.trn1.32xlarge'|'ml.trn1n.32xlarge'|'ml.inf2.xlarge'|'ml.inf2.8xlarge'|'ml.inf2.24xlarge'|'ml.inf2.48xlarge'|'ml.p4d.24xlarge'|'ml.p4de.24xlarge'|'ml.p5.48xlarge'|'ml.p6-b200.48xlarge'|'ml.m6i.large'|'ml.m6i.xlarge'|'ml.m6i.2xlarge'|'ml.m6i.4xlarge'|'ml.m6i.8xlarge'|'ml.m6i.12xlarge'|'ml.m6i.16xlarge'|'ml.m6i.24xlarge'|'ml.m6i.32xlarge'|'ml.m7i.large'|'ml.m7i.xlarge'|'ml.m7i.2xlarge'|'ml.m7i.4xlarge'|'ml.m7i.8xlarge'|'ml.m7i.12xlarge'|'ml.m7i.16xlarge'|'ml.m7i.24xlarge'|'ml.m7i.48xlarge'|'ml.c6i.large'|'ml.c6i.xlarge'|'ml.c6i.2xlarge'|'ml.c6i.4xlarge'|'ml.c6i.8xlarge'|'ml.c6i.12xlarge'|'ml.c6i.16xlarge'|'ml.c6i.24xlarge'|'ml.c6i.32xlarge'|'ml.c7i.large'|'ml.c7i.xlarge'|'ml.c7i.2xlarge'|'ml.c7i.4xlarge'|'ml.c7i.8xlarge'|'ml.c7i.12xlarge'|'ml.c7i.16xlarge'|'ml.c7i.24xlarge'|'ml.c7i.48xlarge'|'ml.r6i.large'|'ml.r6i.xlarge'|'ml.r6i.2xlarge'|'ml.r6i.4xlarge'|'ml.r6i.8xlarge'|'ml.r6i.12xlarge'|'ml.r6i.16xlarge'|'ml.r6i.24xlarge'|'ml.r6i.32xlarge'|'ml.r7i.large'|'ml.r7i.xlarge'|'ml.r7i.2xlarge'|'ml.r7i.4xlarge'|'ml.r7i.8xlarge'|'ml.r7i.12xlarge'|'ml.r7i.16xlarge'|'ml.r7i.24xlarge'|'ml.r7i.48xlarge'|'ml.m6id.large'|'ml.m6id.xlarge'|'ml.m6id.2xlarge'|'ml.m6id.4xlarge'|'ml.m6id.8xlarge'|'ml.m6id.12xlarge'|'ml.m6id.16xlarge'|'ml.m6id.24xlarge'|'ml.m6id.32xlarge'|'ml.c6id.large'|'ml.c6id.xlarge'|'ml.c6id.2xlarge'|'ml.c6id.4xlarge'|'ml.c6id.8xlarge'|'ml.c6id.12xlarge'|'ml.c6id.16xlarge'|'ml.c6id.24xlarge'|'ml.c6id.32xlarge'|'ml.r6id.large'|'ml.r6id.xlarge'|'ml.r6id.2xlarge'|'ml.r6id.4xlarge'|'ml.r6id.8xlarge'|'ml.r6id.12xlarge'|'ml.r6id.16xlarge'|'ml.r6id.24xlarge'|'ml.r6id.32xlarge'|'ml.g6.xlarge'|'ml.g6.2xlarge'|'ml.g6.4xlarge'|'ml.g6.8xlarge'|'ml.g6.12xlarge'|'ml.g6.16xlarge'|'ml.g6.24xlarge'|'ml.g6.48xlarge'|'ml.g7e.2xlarge'|'ml.g7e.4xlarge'|'ml.g7e.8xlarge'|'ml.g7e.12xlarge'|'ml.g7e.24xlarge'|'ml.g7e.48xlarge'|'ml.p5.4xlarge'|'ml.p5en.48xlarge'|'ml.g6e.xlarge'|'ml.g6e.2xlarge'|'ml.g6e.4xlarge'|'ml.g6e.8xlarge'|'ml.g6e.12xlarge'|'ml.g6e.16xlarge'|'ml.g6e.24xlarge'|'ml.g6e.48xlarge',
    IpAddressType='ipv4'|'dualstack',
    PlatformIdentifier='string',
    RoleArn='string',
    LifecycleConfigName='string',
    DisassociateLifecycleConfig=True|False,
    VolumeSizeInGB=123,
    DefaultCodeRepository='string',
    AdditionalCodeRepositories=[
        'string',
    ],
    AcceleratorTypes=[
        'ml.eia1.medium'|'ml.eia1.large'|'ml.eia1.xlarge'|'ml.eia2.medium'|'ml.eia2.large'|'ml.eia2.xlarge',
    ],
    DisassociateAcceleratorTypes=True|False,
    DisassociateDefaultCodeRepository=True|False,
    DisassociateAdditionalCodeRepositories=True|False,
    RootAccess='Enabled'|'Disabled',
    InstanceMetadataServiceConfiguration={
        'MinimumInstanceMetadataServiceVersion': 'string'
    }
)
type NotebookInstanceName:

string

param NotebookInstanceName:

[REQUIRED]

The name of the notebook instance to update.

type InstanceType:

string

param InstanceType:

The Amazon ML compute instance type.

type IpAddressType:

string

param IpAddressType:

The IP address type for the notebook instance. Specify ipv4 for IPv4-only connectivity or dualstack for both IPv4 and IPv6 connectivity. The notebook instance must be stopped before updating this setting. When you specify dualstack, the subnet must support IPv6 addressing.

type PlatformIdentifier:

string

param PlatformIdentifier:

The platform identifier of the notebook instance runtime environment.

type RoleArn:

string

param RoleArn:

The Amazon Resource Name (ARN) of the IAM role that SageMaker AI can assume to access the notebook instance. For more information, see SageMaker AI Roles.

type LifecycleConfigName:

string

param LifecycleConfigName:

The name of a lifecycle configuration to associate with the notebook instance. For information about lifestyle configurations, see Step 2.1: (Optional) Customize a Notebook Instance.

type DisassociateLifecycleConfig:

boolean

param DisassociateLifecycleConfig:

Set to true to remove the notebook instance lifecycle configuration currently associated with the notebook instance. This operation is idempotent. If you specify a lifecycle configuration that is not associated with the notebook instance when you call this method, it does not throw an error.

type VolumeSizeInGB:

integer

param VolumeSizeInGB:

The size, in GB, of the ML storage volume to attach to the notebook instance. The default value is 5 GB. ML storage volumes are encrypted, so SageMaker AI can't determine the amount of available free space on the volume. Because of this, you can increase the volume size when you update a notebook instance, but you can't decrease the volume size. If you want to decrease the size of the ML storage volume in use, create a new notebook instance with the desired size.

type DefaultCodeRepository:

string

param DefaultCodeRepository:

The Git repository to associate with the notebook instance as its default code repository. This can be either the name of a Git repository stored as a resource in your account, or the URL of a Git repository in Amazon Web Services CodeCommit or in any other Git repository. When you open a notebook instance, it opens in the directory that contains this repository. For more information, see Associating Git Repositories with SageMaker AI Notebook Instances.

type AdditionalCodeRepositories:

list

param AdditionalCodeRepositories:

An array of up to three Git repositories to associate with the notebook instance. These can be either the names of Git repositories stored as resources in your account, or the URL of Git repositories in Amazon Web Services CodeCommit or in any other Git repository. These repositories are cloned at the same level as the default repository of your notebook instance. For more information, see Associating Git Repositories with SageMaker AI Notebook Instances.

  • (string) --

type AcceleratorTypes:

list

param AcceleratorTypes:

This parameter is no longer supported. Elastic Inference (EI) is no longer available.

This parameter was used to specify a list of the EI instance types to associate with this notebook instance.

  • (string) --

type DisassociateAcceleratorTypes:

boolean

param DisassociateAcceleratorTypes:

This parameter is no longer supported. Elastic Inference (EI) is no longer available.

This parameter was used to specify a list of the EI instance types to remove from this notebook instance.

type DisassociateDefaultCodeRepository:

boolean

param DisassociateDefaultCodeRepository:

The name or URL of the default Git repository to remove from this notebook instance. This operation is idempotent. If you specify a Git repository that is not associated with the notebook instance when you call this method, it does not throw an error.

type DisassociateAdditionalCodeRepositories:

boolean

param DisassociateAdditionalCodeRepositories:

A list of names or URLs of the default Git repositories to remove from this notebook instance. This operation is idempotent. If you specify a Git repository that is not associated with the notebook instance when you call this method, it does not throw an error.

type RootAccess:

string

param RootAccess:

Whether root access is enabled or disabled for users of the notebook instance. The default value is Enabled.

type InstanceMetadataServiceConfiguration:

dict

param InstanceMetadataServiceConfiguration:

Information on the IMDS configuration of the notebook instance

  • MinimumInstanceMetadataServiceVersion (string) -- [REQUIRED]

    Indicates the minimum IMDS version that the notebook instance supports. When passed as part of CreateNotebookInstance, if no value is selected, then it defaults to IMDSv1. This means that both IMDSv1 and IMDSv2 are supported. If passed as part of UpdateNotebookInstance, there is no default.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --