Amazon SageMaker
Developer Guide

CreateModelPackage

Creates a model package that you can use to create Amazon SageMaker models or list on AWS Marketplace. Buyers can subscribe to model packages listed on AWS Marketplace to create models in Amazon SageMaker.

To create a model package by specifying a Docker container that contains your inference code and the Amazon S3 location of your model artifacts, provide values for InferenceSpecification. To create a model from an algorithm resource that you created or subscribed to in AWS Marketplace, provide a value for SourceAlgorithmSpecification.

Request Syntax

{ "CertifyForMarketplace": boolean, "InferenceSpecification": { "Containers": [ { "ContainerHostname": "string", "Image": "string", "ImageDigest": "string", "ModelDataUrl": "string", "ProductId": "string" } ], "SupportedContentTypes": [ "string" ], "SupportedRealtimeInferenceInstanceTypes": [ "string" ], "SupportedResponseMIMETypes": [ "string" ], "SupportedTransformInstanceTypes": [ "string" ] }, "ModelPackageDescription": "string", "ModelPackageName": "string", "SourceAlgorithmSpecification": { "SourceAlgorithms": [ { "AlgorithmName": "string", "ModelDataUrl": "string" } ] }, "ValidationSpecification": { "ValidationProfiles": [ { "ProfileName": "string", "TransformJobDefinition": { "BatchStrategy": "string", "Environment": { "string" : "string" }, "MaxConcurrentTransforms": number, "MaxPayloadInMB": number, "TransformInput": { "CompressionType": "string", "ContentType": "string", "DataSource": { "S3DataSource": { "S3DataType": "string", "S3Uri": "string" } }, "SplitType": "string" }, "TransformOutput": { "Accept": "string", "AssembleWith": "string", "KmsKeyId": "string", "S3OutputPath": "string" }, "TransformResources": { "InstanceCount": number, "InstanceType": "string", "VolumeKmsKeyId": "string" } } } ], "ValidationRole": "string" } }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

CertifyForMarketplace

Whether to certify the model package for listing on AWS Marketplace.

Type: Boolean

Required: No

InferenceSpecification

Specifies details about inference jobs that can be run with models based on this model package, including the following:

  • The Amazon ECR paths of containers that contain the inference code and model artifacts.

  • The instance types that the model package supports for transform jobs and real-time endpoints used for inference.

  • The input and output content formats that the model package supports for inference.

Type: InferenceSpecification object

Required: No

ModelPackageDescription

A description of the model package.

Type: String

Length Constraints: Maximum length of 1024.

Pattern: [\p{L}\p{M}\p{Z}\p{S}\p{N}\p{P}]*

Required: No

ModelPackageName

The name of the model package. The name must have 1 to 63 characters. Valid characters are a-z, A-Z, 0-9, and - (hyphen).

Type: String

Length Constraints: Minimum length of 1. Maximum length of 63.

Pattern: ^[a-zA-Z0-9](-*[a-zA-Z0-9])*$

Required: Yes

SourceAlgorithmSpecification

Details about the algorithm that was used to create the model package.

Type: SourceAlgorithmSpecification object

Required: No

ValidationSpecification

Specifies configurations for one or more transform jobs that Amazon SageMaker runs to test the model package.

Type: ModelPackageValidationSpecification object

Required: No

Response Syntax

{ "ModelPackageArn": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

ModelPackageArn

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

Type: String

Length Constraints: Minimum length of 1. Maximum length of 2048.

Pattern: arn:aws[a-z\-]*:sagemaker:[a-z0-9\-]*:[0-9]{12}:model-package/.*

Errors

For information about the errors that are common to all actions, see Common Errors.

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: