Amazon SageMaker JumpStart is a machine studying (ML) hub providing pre-trained fashions and pre-built options. It gives entry to a whole lot of basis fashions (FMs). A non-public hub is a function in SageMaker JumpStart that permits a corporation to share their fashions and notebooks in order to centralize mannequin artifacts, facilitate discoverability, and improve the reuse throughout the group. With new fashions launched every day, many enterprise admins need extra management over the FMs that may be found and utilized by customers inside their group (for instance, solely permitting fashions based mostly on pytorch framework to be found).
Now enterprise admins can effortlessly configure granular entry management over the FMs that SageMaker JumpStart gives out of field in order that solely allowed fashions could be accessed by customers inside their organizations. On this put up, we talk about the steps required for an administrator to configure granular entry management of fashions in SageMaker JumpStart utilizing a personal hub, in addition to the steps for customers to entry and devour fashions from the non-public hub.
Resolution overview
Beginning right now, with SageMaker JumpStart and its non-public hub function, directors can create repositories for a subset of fashions tailor-made to totally different groups, use instances, or license necessities utilizing the Amazon SageMaker Python SDK. Admins may arrange a number of non-public hubs with totally different lists of fashions discoverable for various teams of customers. Customers are then solely in a position to uncover and use fashions throughout the non-public hubs they’ve entry to by Amazon SageMaker Studio and the SDK. This degree of management empowers enterprises to devour the newest in open weight generative synthetic intelligence (AI) growth whereas imposing governance guardrails. Lastly, admins can share entry to non-public hubs throughout a number of AWS accounts, enabling collaborative mannequin administration whereas sustaining centralized management. SageMaker JumpStart makes use of AWS Resource Access Manager (AWS RAM) to securely share non-public hubs with different accounts in the identical group. The brand new function is out there within the us-east-2 AWS Area as of writing, and shall be obtainable to extra Areas quickly.
The next diagram reveals an instance structure of SageMaker JumpStart with its private and non-private hub options. The diagram illustrates how SageMaker JumpStart gives entry to totally different mannequin repositories, with some customers accessing the general public SageMaker JumpStart hub and others utilizing non-public curated hubs.

Within the following part, we reveal how admins can configure granular entry management of fashions in SageMaker JumpStart utilizing a personal hub. Then we present how customers can entry and devour allowlisted fashions within the non-public hub utilizing SageMaker Studio and the SageMaker Python SDK. Lastly, we have a look at how an admin person can share the non-public hub with customers in one other account.
Conditions
To make use of the SageMaker Python SDK and run the code related to this put up, you want the next conditions:
- An AWS account that accommodates all of your AWS assets
- An AWS Identity and Access Management (IAM) position with entry to SageMaker Studio notebooks
- SageMaker JumpStart enabled in a SageMaker Studio area
Create a personal hub, curate fashions, and configure entry management (admins)
This part gives a step-by-step information for directors to create a personal hub, curate fashions, and configure entry management on your group’s customers.
- As a result of the function has been built-in within the newest SageMaker Python SDK, to make use of the mannequin granular entry management function with a personal hub, let’s first replace the SageMaker Python SDK:
!pip3 set up sagemaker —force-reinstall —quiet - Subsequent, import the SageMaker and Boto3 libraries:
import boto3 from sagemaker import Session from sagemaker.jumpstart.hub.hub import Hub - Configure your non-public hub:
HUB_NAME="CompanyHub" HUB_DISPLAY_NAME="Allowlisted Fashions" HUB_DESCRIPTION="These are allowlisted fashions taken from the JumpStart Public Hub." REGION="" # for instance, "us-west-2" Within the previous code,
HUB_NAMEspecifies the identify of your Hub.HUB_DISPLAY_NAMEis the show identify on your hub that shall be proven to customers in UI experiences.HUB_DESCRIPTIONis the outline on your hub that shall be proven to customers. - Arrange a Boto3 shopper for SageMaker:
sm_client = boto3.shopper('sagemaker') session = Session(sagemaker_client=sm_client) session.get_caller_identity_arn() - Verify if the next insurance policies have been already added to your admin IAM position; if not, you’ll be able to add them as inline insurance policies:
{ Â Â Â "Model": "2012-10-17", Â Â Â "Assertion": [ Â Â Â Â Â { Â Â Â Â Â Â Â "Action": [ Â Â Â Â Â Â Â Â Â "s3:ListBucket", Â Â Â Â Â Â Â Â Â "s3:GetObject", Â Â Â Â Â Â Â Â Â "s3:GetObjectTagging" Â Â Â Â Â Â Â ], Â Â Â Â Â Â Â "Useful resource": [ Â Â Â Â Â Â Â Â Â "arn:aws:s3:::jumpstart-cache-prod-", Â Â Â Â Â Â Â Â Â "arn:aws:s3:::jumpstart-cache-prod- /*" Â Â Â Â Â Â Â ], Â Â Â Â Â Â Â "Impact": "Permit" Â Â Â Â Â } Â Â Â ] } Change the
placeholder utilizing the configurations in Step 3.Along with establishing IAM permissions to the admin position, it is advisable scope down permissions on your customers to allow them to’t entry public contents.
- Use the next coverage to disclaim entry to the general public hub on your customers. These could be added as inline insurance policies within the person’s IAM position:
{ "Model": "2012-10-17", "Assertion": [ { "Action": "s3:*", "Effect": "Deny", "Resource": [ "arn:aws:s3:::jumpstart-cache-prod-", "arn:aws:s3:::jumpstart-cache-prod- /*" ], "Situation": { "StringNotLike": {"s3:prefix": ["*.ipynb", "*/eula.txt"]} } }, { "Motion": "sagemaker:*", "Impact": "Deny", "Useful resource": [ "arn:aws:sagemaker: :aws:hub/SageMakerPublicHub", "arn:aws:sagemaker: :aws:hub-content/SageMakerPublicHub/*/*" ] } ] } Change the
placeholder within the coverage utilizing the configurations in Step 3.After you may have arrange the non-public hub configuration and permissions, you’re able to create the non-public hub.
- Use the next code to create the non-public hub inside your AWS account within the Area you specified earlier:
hub = Hub(hub_name=HUB_NAME, sagemaker_session=session) attempt: hub.create( description=HUB_DESCRIPTION, display_name=HUB_DISPLAY_NAME ) print(f"Efficiently created Hub with identify {HUB_NAME} in {REGION}") besides Exception as e: if "ResourceInUse" in str(e): print(f"A hub with the identify {HUB_NAME} already exists in your account.") else: elevate e - Use
hub.describe()to confirm the configuration of your hub.After your non-public hub is ready up, you’ll be able to add a reference to fashions from the SageMaker JumpStart public hub to your non-public hub. No mannequin artifacts have to be managed by the client. The SageMaker staff will handle any model or safety updates.For an inventory of obtainable fashions, discuss with Built-in Algorithms with pre-trained Model Table. - To look programmatically, run the command
filter_value = "framework == meta" response = hub.list_sagemaker_public_hub_models(filter=filter_value) fashions = response["hub_content_summaries"] whereas response["next_token"]: response = hub.list_sagemaker_public_hub_models(filter=filter_value, next_token=response["next_token"]) fashions.lengthen(response["hub_content_summaries"]) print(fashions)The filter argument is non-obligatory. For an inventory of filters you’ll be able to apply, discuss with SageMaker Python SDK.
- Use the retrieved fashions from the previous command to create mannequin references on your non-public hub:
for mannequin in fashions: print(f"Including {mannequin.get('hub_content_name')} to Hub") hub.create_model_reference(model_arn=mannequin.get("hub_content_arn"), model_name=mannequin.get("hub_content_name"))The SageMaker JumpStart non-public hub affords different helpful options for managing and interacting with the curated fashions. Directors can test the metadata of a particular mannequin utilizing the
hub.describe_model(model_name=command. To record all obtainable fashions within the non-public hub, you should use a easy loop:) response = hub.list_models() fashions = response["hub_content_summaries"] whereas response["next_token"]: response = hub.list_models(next_token=response["next_token"]) fashions.lengthen(response["hub_content_summaries"]) for mannequin in fashions: print(mannequin.get('HubContentArn'))If it is advisable take away a particular mannequin reference from the non-public hub, use the next command:
hub.delete_model_reference("") If you wish to delete the non-public hub out of your account and Area, you’ll must delete all of the HubContents first, then delete the non-public hub. Use the next code:
for mannequin in fashions: hub.delete_model_reference(model_name=mannequin.get('HubContentName')) hub.delete()
Work together with allowlisted fashions (customers)
This part affords a step-by-step information for customers to work together with allowlisted fashions in SageMaker JumpStart. We reveal learn how to record obtainable fashions, determine a mannequin from the general public hub, and deploy the mannequin to endpoints from SageMaker Studio in addition to the SageMaker Python SDK.
Consumer expertise in SageMaker Studio
Full the next steps to work together with allowlisted fashions utilizing SageMaker Studio:
- Â On the SageMaker Studio console, select JumpStart within the navigation pane or within the Prebuilt and automatic options part.

- Select one in every of mannequin hubs you may have entry to. If the person has entry to a number of hubs, you’ll see an inventory of hubs, as proven within the following screenshot.

If the person has entry to just one hub, you’ll go straight to the mannequin record.
You possibly can view the mannequin particulars and supported actions like prepare, deploy, and consider. - To deploy a mannequin, select Deploy.

- Modify your mannequin configurations like situations and deployment parameters, and select Deploy.

Consumer expertise utilizing the SageMaker Python SDK
To work together together with your fashions utilizing the SageMaker Python SDK, full the next steps:
- Similar to the admin course of, step one is to power reinstall the SageMaker Python SDK:
!pip3 set up sagemaker —force-reinstall —quiet - Import the SageMaker and Boto3 libraries:
import boto3 from sagemaker import Session from sagemaker.jumpstart.hub.hub import Hub from sagemaker.jumpstart.mannequin import JumpStartModel from sagemaker.jumpstart.estimator import JumpStartEstimator - To entry the fashions in your non-public hub, you want the Area and the identify of the hub in your account. Fill out the
HUB_NAMEandREGIONfields with the knowledge supplied by your administrator:HUB_NAME="CompanyHub" REGION="" # for instance, "us-west-2" sm_client = boto3.shopper('sagemaker') sm_runtime_client = boto3.shopper('sagemaker-runtime') session = Session(sagemaker_client=sm_client, sagemaker_runtime_client=sm_runtime_client) hub = Hub(hub_name=HUB_NAME, sagemaker_session=session) - Checklist the fashions obtainable in your non-public hub utilizing the next command:
response = hub.list_models() fashions = response["hub_content_summaries"] whereas response["next_token"]: response = hub.list_models(next_token=response["next_token"]) fashions.lengthen(response["hub_content_summaries"]) print(fashions) - To get extra details about a selected mannequin, use the
describe_modeltechnique:model_name = "huggingface-llm-phi-2" response = hub.describe_model(model_name=model_name) print(response) - You possibly can deploy fashions in a hub with the Python SDK by utilizing
JumpStartModel. To deploy a mannequin from the hub to an endpoint and invoke the endpoint with the default payloads, run the next code. To pick which mannequin out of your hub you wish to use, go in amodel_idandmodel. When you go in*for themodel, it’s going to take the newest model obtainable for thatmodel_idwithin the hub. When you’re utilizing a mannequin gated behind a EULA settlement, go inaccept_eula=True.model_id, model = "huggingface-llm-phi-2", "1.0.0" mannequin = JumpStartModel(model_id, model, hub_name=HUB_NAME, area=REGION, sagemaker_session=session) predictor = mannequin.deploy(accept_eula=False) - To invoke your deployed mannequin with the default payloads, use the next code:
example_payloads = mannequin.retrieve_all_examples() for payload in example_payloads: response = predictor.predict(payload.physique) print("nInputn", payload.physique, "nnOutputn", response[0]["generated_text"], "nn===============") - To delete the mannequin endpoints that you simply created, use the next code:
predictor.delete_model() predictor.delete_endpoint()
Cross-account sharing of personal hubs
SageMaker JumpStart non-public hubs assist cross-account sharing, permitting you to increase the advantages of your curated mannequin repository past your individual AWS account. This function permits collaboration throughout totally different groups or departments inside your group, even once they function in separate AWS accounts. By utilizing AWS RAM, you’ll be able to securely share your non-public hubs whereas sustaining management over entry.
To share your non-public hub throughout accounts, full the next steps:
- On the AWS RAM console, select Create useful resource share.
- When specifying useful resource share particulars, select the SageMaker hub useful resource kind and choose a number of non-public hubs that you simply wish to share. While you share a hub with every other account, all of its contents are additionally shared implicitly.
- Affiliate permissions together with your useful resource share.
- Use AWS account IDs to specify the accounts to which you wish to grant entry to your shared assets.
- Assessment your useful resource share configuration and select Create useful resource share.
It might take a couple of minutes for the useful resource share and principal associations to finish.
Admins that wish to carry out the previous steps programmatically can enter the next command to provoke the sharing:
# create a useful resource share utilizing the non-public hub
aws ram create-resource-share
--name test-share
--resource-arns arn:aws:sagemaker:::hub/
--principals
--region
Change the , , , and placeholders with the suitable values for the useful resource proprietor account ID, shopper account ID, identify of the hub, and Area to make use of.
After you arrange the useful resource share, the desired AWS account will obtain an invite to hitch. They need to settle for this invitation by AWS RAM to realize entry to the shared non-public hub. This course of makes certain entry is granted solely with specific consent from each the hub proprietor and the recipient account. For extra data, discuss with Using shared AWS resources.
It’s also possible to carry out this step programmatically:
# record useful resource shares
aws ram get-resource-share-invitations
--region
# settle for useful resource share
# utilizing the arn from the earlier response
aws ram accept-resource-share-invitation
--resource-share-invitation-arn
--region
For detailed directions on creating useful resource shares and accepting invites, discuss with Creating a resource share in AWS RAM. By extending your non-public hub throughout accounts, you’ll be able to foster collaboration and keep constant mannequin governance throughout your total group.
Conclusion
SageMaker JumpStart permits enterprises to undertake FMs whereas sustaining granular management over mannequin entry and utilization. By making a curated repository of accepted fashions in non-public hubs, organizations can align their AI initiatives with company insurance policies and regulatory necessities. The non-public hub decouples mannequin curation from mannequin consumption, enabling directors to handle the mannequin stock whereas knowledge scientists deal with growing AI options.
This put up defined the non-public hub function in SageMaker JumpStart and supplied steps to arrange and use a personal hub, with minimal further configuration required. Directors can choose fashions from the general public SageMaker JumpStart hub, add them to the non-public hub, and handle person entry by IAM insurance policies. Customers can then deploy these preapproved fashions, fine-tune them on customized datasets, and combine them into their functions utilizing acquainted SageMaker interfaces. The non-public hub makes use of the SageMaker underlying infrastructure, permitting it to scale with enterprise-level ML calls for.
For extra details about SageMaker JumpStart, discuss with SageMaker JumpStart. To get began utilizing SageMaker JumpStart, entry it by SageMaker Studio.
In regards to the Authors
Raju Rangan is a Senior Options Architect at AWS. He works with government-sponsored entities, serving to them construct AI/ML options utilizing AWS. When not tinkering with cloud options, you’ll catch him hanging out with household or smashing birdies in a vigorous recreation of badminton with buddies.
Sherry Ding is a senior AI/ML specialist options architect at AWS. She has in depth expertise in machine studying with a PhD in pc science. She primarily works with public sector prospects on numerous AI/ML-related enterprise challenges, serving to them speed up their machine studying journey on the AWS Cloud. When not serving to prospects, she enjoys out of doors actions.
June Received is a product supervisor with Amazon SageMaker JumpStart. He focuses on making basis fashions simply discoverable and usable to assist prospects construct generative AI functions. His expertise at Amazon additionally contains cellular purchasing functions and final mile supply.
Bhaskar Pratap is a Senior Software program Engineer with the Amazon SageMaker staff. He’s keen about designing and constructing elegant methods that deliver machine studying to folks’s fingertips. Moreover, he has in depth expertise with constructing scalable cloud storage providers.

