Skip to main content

model_packages

Creates, updates, deletes, gets or lists a model_packages resource.

Overview

Namemodel_packages
TypeResource
Idaws.sagemaker.model_packages

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
additional_inference_specificationsarrayAn array of additional Inference Specification objects. 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.
approval_descriptionstringA description provided for the model approval. (pattern: <code>.*</code>)
certify_for_marketplacebooleanWhether the model package is certified for listing on Amazon Web Services Marketplace.
created_byobjectInformation about the user who created or modified a SageMaker resource.
creation_timestring (date-time)A timestamp specifying when the model package was created.
customer_metadata_propertiesobjectThe metadata properties associated with the model package versions.
domainstringThe machine learning domain of the model package you specified. Common machine learning domains include computer vision and natural language processing.
drift_check_baselinesobjectRepresents the drift check baselines that can be used when the model monitor is set using the model package. For more information, see the topic on Drift Detection against Previous Baselines in SageMaker Pipelines in the Amazon SageMaker Developer Guide.
inference_specificationobjectDetails about inference jobs that you can run with models based on this model package.
last_modified_byobjectInformation about the user who created or modified a SageMaker resource.
last_modified_timestring (date-time)The last time that the model package was modified.
managed_storage_typestringThe storage type of the model package. (Restricted)
metadata_propertiesobjectMetadata properties of the tracking entity, trial, or trial component.
model_approval_statusstringThe approval status of the model package. (Approved, Rejected, PendingManualApproval)
model_cardobjectThe model card associated with the model package. Since ModelPackageModelCard is tied to a model package, it is a specific usage of a model card and its schema is simplified compared to the schema of ModelCard. The ModelPackageModelCard schema does not include model_package_details, and model_overview is composed of the model_creator and model_artifact properties. For more information about the model package model card schema, see Model package model card schema. For more information about the model card associated with the model package, see View the Details of a Model Version. When you set IncludedData to MetadataOnly in the request, ModelCardStatus is preserved and ModelCardContent is sanitized to include only the following JSON paths, when present in the model card: model_overview.model_id model_overview.model_name intended_uses.risk_rating model_package_details.model_package_group_name model_package_details.model_package_arn Because the ModelPackageModelCard schema does not include model_package_details and limits model_overview to model_creator and model_artifact, the sanitized ModelCardContent for a model package typically contains only intended_uses.risk_rating if it was provided when the model card was created. To retrieve the complete ModelCardContent, set IncludedData to AllData or omit the parameter.
model_life_cycleobjectA structure describing the current state of the model in its life cycle.
model_metricsobjectMetrics for the model.
model_package_arnstringThe Amazon Resource Name (ARN) of the model package. (pattern: <code>arn:aws[a-z-]*:sagemaker:[a-z0-9-]{9,16}:[0-9]{12}:model-package/[\S]{1,2048}</code>)
model_package_descriptionstringA brief summary of the model package. (pattern: <code>[\p{L}\p{M}\p{Z}\p{S}\p{N}\p{P}]*</code>)
model_package_group_namestringIf the model is a versioned model, the name of the model group that the versioned model belongs to. (pattern: <code>[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}</code>)
model_package_namestringThe name of the model package being described. (pattern: <code>[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}</code>)
model_package_registration_typestringThe package registration type of the model package output. (Logged, Registered)
model_package_statusstringThe current status of the model package. (Pending, InProgress, Completed, Failed, Deleting)
model_package_status_detailsobjectDetails about the current status of the model package.
model_package_versionintegerThe version of the model package.
sample_payload_urlstringThe Amazon Simple Storage Service (Amazon S3) path where the sample payload are stored. This path points to a single gzip compressed tar archive (.tar.gz suffix).
security_configobjectThe KMS Key ID (KMSKeyId) used for encryption of model package information.
skip_model_validationstringIndicates if you want to skip model validation. (All, None)
source_algorithm_specificationobjectDetails about the algorithm that was used to create the model package.
source_uristringThe URI of the source for the model package. (pattern: <code>[\p{L}\p{M}\p{Z}\p{N}\p{P}]{0,1024}</code>)
taskstringThe machine learning task you specified that your model package accomplishes. Common machine learning tasks include object detection and image classification.
validation_specificationobjectConfigurations for one or more transform jobs that SageMaker runs to test the model package.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_model_packageselectregionReturns a description of the specified model package, which is used to create SageMaker models or list them on Amazon Web Services Marketplace. If you provided a KMS Key ID when you created your model package, you will see the KMS Decrypt API call in your CloudTrail logs when you use this API. To call this operation without requiring kms:Decrypt permission on the customer-managed key, set IncludedData to MetadataOnly; the response is returned with the embedded ModelCard.ModelCardContent field sanitized. To create models in SageMaker, buyers can subscribe to model packages listed on Amazon Web Services Marketplace.
list_model_packagesselectregionLists the model packages that have been created.
create_model_packageinsertregionCreates a model package that you can use to create SageMaker models or list on Amazon Web Services Marketplace, or a versioned model that is part of a model group. Buyers can subscribe to model packages listed on Amazon Web Services Marketplace to create models in 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 Amazon Web Services Marketplace, provide a value for SourceAlgorithmSpecification. There are two types of model packages: Versioned - a model that is part of a model group in the model registry. Unversioned - a model package that is not part of a model group.
update_model_packageupdateregion, ModelPackageArnUpdates a versioned model.
delete_model_packagedeleteregionDeletes a model package. A model package is used to create SageMaker models or list on Amazon Web Services Marketplace. Buyers can subscribe to model packages listed on Amazon Web Services Marketplace to create models in SageMaker.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Returns a description of the specified model package, which is used to create SageMaker models or list them on Amazon Web Services Marketplace. If you provided a KMS Key ID when you created your model package, you will see the KMS Decrypt API call in your CloudTrail logs when you use this API. To call this operation without requiring kms:Decrypt permission on the customer-managed key, set IncludedData to MetadataOnly; the response is returned with the embedded ModelCard.ModelCardContent field sanitized. To create models in SageMaker, buyers can subscribe to model packages listed on Amazon Web Services Marketplace.

SELECT
additional_inference_specifications,
approval_description,
certify_for_marketplace,
created_by,
creation_time,
customer_metadata_properties,
domain,
drift_check_baselines,
inference_specification,
last_modified_by,
last_modified_time,
managed_storage_type,
metadata_properties,
model_approval_status,
model_card,
model_life_cycle,
model_metrics,
model_package_arn,
model_package_description,
model_package_group_name,
model_package_name,
model_package_registration_type,
model_package_status,
model_package_status_details,
model_package_version,
sample_payload_url,
security_config,
skip_model_validation,
source_algorithm_specification,
source_uri,
task,
validation_specification
FROM aws.sagemaker.model_packages
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a model package that you can use to create SageMaker models or list on Amazon Web Services Marketplace, or a versioned model that is part of a model group. Buyers can subscribe to model packages listed on Amazon Web Services Marketplace to create models in 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 Amazon Web Services Marketplace, provide a value for SourceAlgorithmSpecification. There are two types of model packages: Versioned - a model that is part of a model group in the model registry. Unversioned - a model package that is not part of a model group.

INSERT INTO aws.sagemaker.model_packages (
ModelPackageName,
ModelPackageGroupName,
ModelPackageDescription,
ModelPackageRegistrationType,
InferenceSpecification,
ValidationSpecification,
SourceAlgorithmSpecification,
CertifyForMarketplace,
Tags,
ModelApprovalStatus,
MetadataProperties,
ModelMetrics,
ClientToken,
Domain,
Task,
SamplePayloadUrl,
CustomerMetadataProperties,
DriftCheckBaselines,
AdditionalInferenceSpecifications,
SkipModelValidation,
SourceUri,
SecurityConfig,
ModelCard,
ModelLifeCycle,
ManagedStorageType,
region
)
SELECT
'{{ ModelPackageName }}',
'{{ ModelPackageGroupName }}',
'{{ ModelPackageDescription }}',
'{{ ModelPackageRegistrationType }}',
'{{ InferenceSpecification }}',
'{{ ValidationSpecification }}',
'{{ SourceAlgorithmSpecification }}',
{{ CertifyForMarketplace }},
'{{ Tags }}',
'{{ ModelApprovalStatus }}',
'{{ MetadataProperties }}',
'{{ ModelMetrics }}',
'{{ ClientToken }}',
'{{ Domain }}',
'{{ Task }}',
'{{ SamplePayloadUrl }}',
'{{ CustomerMetadataProperties }}',
'{{ DriftCheckBaselines }}',
'{{ AdditionalInferenceSpecifications }}',
'{{ SkipModelValidation }}',
'{{ SourceUri }}',
'{{ SecurityConfig }}',
'{{ ModelCard }}',
'{{ ModelLifeCycle }}',
'{{ ManagedStorageType }}',
'{{ region }}'
RETURNING
model_package_arn
;

UPDATE examples

Updates a versioned model.

UPDATE aws.sagemaker.model_packages
SET
ModelPackageArn = '{{ ModelPackageArn }}',
ModelApprovalStatus = '{{ ModelApprovalStatus }}',
ModelPackageRegistrationType = '{{ ModelPackageRegistrationType }}',
ApprovalDescription = '{{ ApprovalDescription }}',
CustomerMetadataProperties = '{{ CustomerMetadataProperties }}',
CustomerMetadataPropertiesToRemove = '{{ CustomerMetadataPropertiesToRemove }}',
AdditionalInferenceSpecificationsToAdd = '{{ AdditionalInferenceSpecificationsToAdd }}',
InferenceSpecification = '{{ InferenceSpecification }}',
SourceUri = '{{ SourceUri }}',
ModelCard = '{{ ModelCard }}',
ModelLifeCycle = '{{ ModelLifeCycle }}',
ClientToken = '{{ ClientToken }}'
WHERE
region = '{{ region }}' --required
AND ModelPackageArn = '{{ ModelPackageArn }}' --required
RETURNING
model_package_arn;

DELETE examples

Deletes a model package. A model package is used to create SageMaker models or list on Amazon Web Services Marketplace. Buyers can subscribe to model packages listed on Amazon Web Services Marketplace to create models in SageMaker.

DELETE FROM aws.sagemaker.model_packages
WHERE region = '{{ region }}' --required
;