Usa i tuoi SageMaker JumpStart modelli in Amazon Bedrock - Amazon SageMaker AI

Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.

Usa i tuoi SageMaker JumpStart modelli in Amazon Bedrock

Puoi registrare i modelli che hai distribuito da Amazon SageMaker JumpStart ad Amazon Bedrock. Amazon Bedrock consente di ospitare il modello dietro più endpoint. Inoltre, puoi utilizzare le funzionalità di Amazon Bedrock, come agenti e knowledge base. Per ulteriori informazioni sull’utilizzo dei modelli di Amazon Bedrock, consulta https://docs.aws.amazon.com/bedrock/latest/userguide/amazon-bedrock-marketplace.html.

Importante

Per migrare i tuoi modelli su Amazon Bedrock, ti consigliamo di allegare una AmazonBedrockFullAccesspolicy al tuo ruolo IAM. Se non è possibile collegare la policy gestita, assicurati che il tuo ruolo IAM disponga delle seguenti autorizzazioni:

JSON
{ "Version":"2012-10-17", "Statement": [ { "Sid": "BedrockAll", "Effect": "Allow", "Action": [ "bedrock:*" ], "Resource": "*" }, { "Sid": "DescribeKey", "Effect": "Allow", "Action": [ "kms:DescribeKey" ], "Resource": "arn:*:kms:*:::*" }, { "Sid": "APIsWithAllResourceAccess", "Effect": "Allow", "Action": [ "iam:ListRoles", "ec2:DescribeVpcs", "ec2:DescribeSubnets", "ec2:DescribeSecurityGroups" ], "Resource": "*" }, { "Sid": "MarketplaceModelEndpointMutatingAPIs", "Effect": "Allow", "Action": [ "sagemaker:CreateEndpoint", "sagemaker:CreateEndpointConfig", "sagemaker:CreateModel", "sagemaker:CreateInferenceComponent", "sagemaker:DeleteInferenceComponent", "sagemaker:DeleteEndpoint", "sagemaker:UpdateEndpoint" ], "Resource": [ "arn:aws:sagemaker:*:*:endpoint/*", "arn:aws:sagemaker:*:*:endpoint-config/*", "arn:aws:sagemaker:*:*:model/*" ], "Condition": { "StringEquals": { "aws:CalledViaLast": "bedrock.amazonaws.com" } } }, { "Sid": "BedrockEndpointTaggingOperations", "Effect": "Allow", "Action": [ "sagemaker:AddTags", "sagemaker:DeleteTags" ], "Resource": [ "arn:aws:sagemaker:*:*:endpoint/*", "arn:aws:sagemaker:*:*:endpoint-config/*", "arn:aws:sagemaker:*:*:model/*" ] }, { "Sid": "MarketplaceModelEndpointNonMutatingAPIs", "Effect": "Allow", "Action": [ "sagemaker:DescribeEndpoint", "sagemaker:DescribeEndpointConfig", "sagemaker:DescribeModel", "sagemaker:DescribeInferenceComponent", "sagemaker:ListEndpoints", "sagemaker:ListTags" ], "Resource": [ "arn:aws:sagemaker:*:*:endpoint/*", "arn:aws:sagemaker:*:*:endpoint-config/*", "arn:aws:sagemaker:*:*:model/*" ], "Condition": { "StringEquals": { "aws:CalledViaLast": "bedrock.amazonaws.com" } } }, { "Sid": "BedrockEndpointInvokingOperations", "Effect": "Allow", "Action": [ "sagemaker:InvokeEndpoint", "sagemaker:InvokeEndpointWithResponseStream" ], "Resource": [ "arn:aws:sagemaker:*:*:endpoint/*" ], "Condition": { "StringEquals": { "aws:CalledViaLast": "bedrock.amazonaws.com" } } }, { "Sid": "DiscoveringMarketplaceModel", "Effect": "Allow", "Action": [ "sagemaker:DescribeHubContent" ], "Resource": [ "arn:aws:sagemaker:*:aws:hub-content/SageMakerPublicHub/Model/*", "arn:aws:sagemaker:*:aws:hub/SageMakerPublicHub" ] }, { "Sid": "AllowMarketplaceModelsListing", "Effect": "Allow", "Action": [ "sagemaker:ListHubContents" ], "Resource": "arn:aws:sagemaker:*:aws:hub/SageMakerPublicHub" }, { "Sid": "RetrieveSubscribedMarketplaceLicenses", "Effect": "Allow", "Action": [ "license-manager:ListReceivedLicenses" ], "Resource": [ "*" ] }, { "Sid": "PassRoleToSageMaker", "Effect": "Allow", "Action": [ "iam:PassRole" ], "Resource": [ "arn:aws:iam::*:role/*Sagemaker*ForBedrock*" ], "Condition": { "StringEquals": { "iam:PassedToService": [ "sagemaker.amazonaws.com", "bedrock.amazonaws.com" ] } } }, { "Sid": "PassRoleToBedrock", "Effect": "Allow", "Action": [ "iam:PassRole" ], "Resource": "arn:aws:iam::*:role/*AmazonBedrock*", "Condition": { "StringEquals": { "iam:PassedToService": [ "bedrock.amazonaws.com" ] } } } ] }
Importante

La policy di accesso completo di Amazon Bedrock fornisce solo le autorizzazioni per l’API Amazon Bedrock. Per utilizzare Amazon Bedrock inConsole di gestione AWS, il tuo ruolo IAM deve disporre anche delle seguenti autorizzazioni:

{ "Sid": "AllowConsoleS3AccessForBedrockMarketplace", "Effect": "Allow", "Action": [ "s3:GetObject", "s3:GetBucketCORS", "s3:ListBucket", "s3:ListBucketVersions", "s3:GetBucketLocation" ], "Resource": "*" }

Se crei una policy personale, è necessario includere le istruzioni di policy che consentono l’azione di Marketplace Amazon Bedrock per la risorsa. Ad esempio, la seguente policy consente ad Amazon Bedrock di utilizzare l’operazione InvokeModel per un modello che hai implementato su un endpoint.

JSON
{ "Version":"2012-10-17", "Statement": [ { "Sid": "BedrockAll", "Effect": "Allow", "Action": [ "bedrock:InvokeModel" ], "Resource": [ "arn:aws:bedrock:us-east-1:111122223333:marketplace/model-endpoint/all-access" ] }, { "Sid": "VisualEditor1", "Effect": "Allow", "Action": ["sagemaker:InvokeEndpoint"], "Resource": "arn:aws:sagemaker:us-east-1:111122223333:endpoint/*", "Condition": { "StringEquals": { "aws:ResourceTag/project": "example-project-id", "aws:CalledViaLast": "bedrock.amazonaws.com" } } } ] }

Se implementi un modello, dovresti riuscire a utilizzarlo in Amazon Bedrock. Per verificare se è possibile utilizzarlo in Amazon Bedrock, accedi alla scheda dei dettagli del modello nell’interfaccia utente di Studio. Se la scheda del modello indica che questo è Pronto per Bedrock, puoi registrare il modello con Amazon Bedrock.

Importante

Per impostazione predefinita, Amazon SageMaker JumpStart disabilita l'accesso alla rete per i modelli che distribuisci. Se hai abilitato l’accesso alla rete, non potrai utilizzare il modello con Amazon Bedrock. Se desideri utilizzare il modello con Amazon Bedrock, devi implementarlo nuovamente con l’accesso alla rete disabilitato.

Per utilizzarlo con Amazon Bedrock, accedi alla pagina Dettagli dell’endpoint e scegli Usa con Bedrock nell’angolo in alto a destra dell’interfaccia utente di Studio. Dopo aver visualizzato la finestra pop-up, scegli Registrati a Bedrock.