SageMaker / Client / update_model_package



Updates a versioned model.

See also: AWS API Documentation

Request Syntax

response = client.update_model_package(
        'string': 'string'
            'Name': 'string',
            'Description': 'string',
            'Containers': [
                    'ContainerHostname': 'string',
                    'Image': 'string',
                    'ImageDigest': 'string',
                    'ModelDataUrl': 'string',
                    'ProductId': 'string',
                    'Environment': {
                        'string': 'string'
                    'ModelInput': {
                        'DataInputConfig': 'string'
                    'Framework': 'string',
                    'FrameworkVersion': 'string',
                    'NearestModelName': 'string',
                    'AdditionalS3DataSource': {
                        'S3DataType': 'S3Object',
                        'S3Uri': 'string',
                        'CompressionType': 'None'|'Gzip'
            'SupportedTransformInstanceTypes': [
            'SupportedRealtimeInferenceInstanceTypes': [
            'SupportedContentTypes': [
            'SupportedResponseMIMETypes': [
  • ModelPackageArn (string) –


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

  • ModelApprovalStatus (string) – The approval status of the model.

  • ApprovalDescription (string) – A description for the approval status of the model.

  • CustomerMetadataProperties (dict) –

    The metadata properties associated with the model package versions.

    • (string) –

      • (string) –

  • CustomerMetadataPropertiesToRemove (list) –

    The metadata properties associated with the model package versions to remove.

    • (string) –

  • AdditionalInferenceSpecificationsToAdd (list) –

    An array of additional Inference Specification objects to be added to the existing array additional Inference Specification. Total number of additional Inference Specifications can not exceed 15. Each additional Inference Specification specifies artifacts based on this model package that can be used on inference endpoints. Generally used with SageMaker Neo to store the compiled artifacts.

    • (dict) –

      A structure of additional Inference Specification. Additional Inference Specification specifies details about inference jobs that can be run with models based on this model package

      • Name (string) – [REQUIRED]

        A unique name to identify the additional inference specification. The name must be unique within the list of your additional inference specifications for a particular model package.

      • Description (string) –

        A description of the additional Inference specification

      • Containers (list) – [REQUIRED]

        The Amazon ECR registry path of the Docker image that contains the inference code.

        • (dict) –

          Describes the Docker container for the model package.

          • ContainerHostname (string) –

            The DNS host name for the Docker container.

          • Image (string) – [REQUIRED]

            The Amazon EC2 Container Registry (Amazon ECR) path where inference code is stored.

            If you are using your own custom algorithm instead of an algorithm provided by SageMaker, the inference code must meet SageMaker requirements. SageMaker supports both registry/repository[:tag] and registry/repository[@digest] image path formats. For more information, see Using Your Own Algorithms with Amazon SageMaker.

          • ImageDigest (string) –

            An MD5 hash of the training algorithm that identifies the Docker image used for training.

          • ModelDataUrl (string) –

            The Amazon S3 path where the model artifacts, which result from model training, are stored. This path must point to a single gzip compressed tar archive ( .tar.gz suffix).


            The model artifacts must be in an S3 bucket that is in the same region as the model package.

          • ProductId (string) –

            The Amazon Web Services Marketplace product ID of the model package.

          • Environment (dict) –

            The environment variables to set in the Docker container. Each key and value in the Environment string to string map can have length of up to 1024. We support up to 16 entries in the map.

            • (string) –

              • (string) –

          • ModelInput (dict) –

            A structure with Model Input details.

            • DataInputConfig (string) – [REQUIRED]

              The input configuration object for the model.

          • Framework (string) –

            The machine learning framework of the model package container image.

          • FrameworkVersion (string) –

            The framework version of the Model Package Container Image.

          • NearestModelName (string) –

            The name of a pre-trained machine learning benchmarked by Amazon SageMaker Inference Recommender model that matches your model. You can find a list of benchmarked models by calling ListModelMetadata.

          • AdditionalS3DataSource (dict) –

            The additional data source that is used during inference in the Docker container for your model package.

            • S3DataType (string) – [REQUIRED]

              The data type of the additional data source that you specify for use in inference or training.

            • S3Uri (string) – [REQUIRED]

              The uniform resource identifier (URI) used to identify an additional data source used in inference or training.

            • CompressionType (string) –

              The type of compression used for an additional data source used in inference or training. Specify None if your additional data source is not compressed.

      • SupportedTransformInstanceTypes (list) –

        A list of the instance types on which a transformation job can be run or on which an endpoint can be deployed.

        • (string) –

      • SupportedRealtimeInferenceInstanceTypes (list) –

        A list of the instance types that are used to generate inferences in real-time.

        • (string) –

      • SupportedContentTypes (list) –

        The supported MIME types for the input data.

        • (string) –

      • SupportedResponseMIMETypes (list) –

        The supported MIME types for the output data.

        • (string) –

Return type:



Response Syntax

    'ModelPackageArn': 'string'

Response Structure

  • (dict) –

    • ModelPackageArn (string) –

      The Amazon Resource Name (ARN) of the model.