Deploy proprietary foundation models with the ModelPackage class - Amazon SageMaker AI
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Deploy proprietary foundation models with the ModelPackage class

Proprietary models must be deployed using the model package information after subscribing to the model in Amazon Web Services Marketplace. For more information about SageMaker AI and Amazon Web Services Marketplace, see Buy and Sell Amazon SageMaker AI Algorithms and Models in Amazon Web Services Marketplace. To find Amazon Web Services Marketplace links for the latest proprietary models, see Getting started with Amazon SageMaker JumpStart.

After subscribing to the model of your choice in Amazon Web Services Marketplace, you can deploy the foundation model using the SageMaker Python SDK and the SDK associated with the model provider. For example, AI21 Labs, Cohere, and LightOn use the "ai21[SM]", cohere-sagemaker, and lightonsage packages, respectively.

For example, to define a JumpStart model using Jurassic-2 Jumbo Instruct from AI21 Labs, use the following code:

import sagemaker import ai21 role = get_execution_role() sagemaker_session = sagemaker.Session() model_package_arn = "arn:aws:sagemaker:us-east-1:865070037744:model-package/j2-jumbo-instruct-v1-1-43-4e47c49e61743066b9d95efed6882f35" my_model = ModelPackage( role=role, model_package_arn=model_package_arn, sagemaker_session=sagemaker_session )

For step-by-step examples, find and run the notebook associated with the proprietary foundation model of your choice in SageMaker Studio Classic. See Use foundation models in Amazon SageMaker Studio Classic for more information. For more information on the SageMaker Python SDK, see ModelPackage.