

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# Amazon Bedrock Marketplace
<a name="amazon-bedrock-marketplace"></a>

使用 Amazon Bedrock Marketplace 来发现、测试和使用 100 多种流行、新兴和专业基础模型 (FMs)。这些模型是 Amazon Bedrock 中业界领先模型选择的补充。

您可以在一个目录中发现这些模型。发现模型后，您可以订阅该模型并将其部署到由 SageMaker AI 管理的终端节点。

您可以通过 Amazon Bedrock 访问已部署的 APIs模型。通过 Amazon Bedrock 访问模型 APIs 可以让你在本地将其与 Amazon Bedrock 的工具（例如代理、知识库和护栏）一起使用。

有关 Amazon Bedrock Marketplace 模型的列表，请参阅[模型兼容性](bedrock-marketplace-model-reference.md)。

您可以通过以下方式访问 Amazon Bedrock Marketplace 模型：
+ [InvokeModel](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InvokeModel.html) 操作
+ [Converse](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html) 操作
+ Amazon Bedrock 控制台

有关设置 Amazon Bedrock Marketplace 的信息，请参阅[设置 Amazon Bedrock Marketplace](setup-amazon-bedrock-marketplace.md)。有关各个模型的许可条款的信息，请参阅 [Amazon Bedrock 上的无服务器第三方模型](https://aws.amazon.com/legal/bedrock/third-party-models/)。

**重要**  
设置 Amazon Bedrock Marketplace 后，您可以使用我们为整个工作流提供的代码，也可以开始使用 AWS 管理控制台。  
有关运行 end-to-end工作流程的代码，请参阅[End-to-end 工作流程](bedrock-marketplace-end-to-end-workflow.md)。要开始使用 AWS 管理控制台，请参阅[搜索模型](bedrock-marketplace-discover-a-model.md)。

**Topics**
+ [设置 Amazon Bedrock Marketplace](setup-amazon-bedrock-marketplace.md)
+ [控制 Amazon Bedrock Marketplace 模型的访问](control-amazon-bedrock-marketplace.md)
+ [End-to-end 工作流程](bedrock-marketplace-end-to-end-workflow.md)
+ [搜索模型](bedrock-marketplace-discover-a-model.md)
+ [订阅模型](bedrock-marketplace-subscribe-to-a-model.md)
+ [部署模型](bedrock-marketplace-deploy-a-model.md)
+ [自带端点](bedrock-marketplace-bring-your-own-endpoint.md)
+ [调用端点](bedrock-marketplace-call-the-endpoint.md)
+ [管理端点](bedrock-marketplace-manage-your-endpoints.md)
+ [模型兼容性](bedrock-marketplace-model-reference.md)

# 设置 Amazon Bedrock Marketplace
<a name="setup-amazon-bedrock-marketplace"></a>

您可以使用 [Amazon Bedrock 完全访问权限策略](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AmazonBedrockFullAccess.html)为 SageMaker AI 提供权限。建议使用托管式策略，但如果您无法使用托管式策略，请确保您的 IAM 角色具有以下权限。

以下是 Amazon Bedrock 完全访问策略提供的权限。

------
#### [ 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"
    					]
    				}
    			}
    		}
    	]
    }
```

------

**重要**  
Amazon Bedrock 完全访问策略仅提供对 Amazon Bedrock API 的权限。要在中使用 Amazon BedrockAWS 管理控制台，您的 IAM 角色还必须具有以下权限：  

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

如果您要自行编写策略，则必须附上支持对资源执行 Amazon Bedrock Marketplace 操作的策略声明。例如，以下策略支持 Amazon Bedrock 对已部署到端点的模型使用 `InvokeModel` 操作。

------
#### [ 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"
                    }
                }
            }
        ]
    
}
```

------

有关设置 Amazon Bedrock 的更多信息，请参阅[快速入门](getting-started.md)。

您可能需要使用AWS Key Management Service密钥对部署模型的端点进行加密。您必须修改前述策略，以便提供使用 AWS KMS 密钥的权限。

AWS KMS密钥还必须具有加密端点的权限。您必须修改 AWS KMS 资源策略来加密端点。有关修改策略的更多信息，请参阅[将 IAM 策略与一起使用AWS Key Management Service](https://docs.aws.amazon.com/kms/latest/developerguide/iam-policies)。

您的AWS KMS密钥还必须具有`CreateGrant`权限。下面是密钥策略中必须具有的权限的示例。

```
{
"Sid": "Allow access for AmazonSageMaker-ExecutionRole",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::111122223333:role/SagemakerExecutionRole"
},
"Action": "kms:CreateGrant",
"Resource": "*"
}
```

有关提供创建授予权限的更多信息，请参阅[授予 CreateGrant 权限](https://docs.aws.amazon.com/kms/latest/developerguide/create-grant-overview.html#grant-creategrant)。

# 控制 Amazon Bedrock Marketplace 模型的访问
<a name="control-amazon-bedrock-marketplace"></a>

您可以使用 [Amazon Bedrock 完全访问权限策略](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AmazonBedrockFullAccess.html)为 SageMaker AI 提供权限。要阻止用户访问特定的 Bedrock Marketplace 模型，同时保持对所有其他模型的访问权限，请使用拒绝策略。以下策略演示如何拒绝访问特定模型。

拒绝访问特定模型：

**重要**  
此策略明确拒绝对指定模型的访问，同时允许访问所有其他 Bedrock Marketplace 模型（假设已具备所有其他必需权限）。

**仅允许访问特定模型**

要限制用户只能访问特定的 Bedrock Marketplace 模型，请使用允许策略并明确指定模型规格。以下策略演示如何仅允许访问特定模型：

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "MarketplaceModelAllow",
            "Effect": "Allow",
            "Action": [
                "sagemaker:CreateEndpoint",
                "sagemaker:CreateEndpointConfig",
                "sagemaker:CreateModel",
                "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",
                    "aws:ResourceTag/sagemaker-sdk:bedrock": "compatible"
                },
                "StringLike": {
                    "aws:ResourceTag/sagemaker-studio:hub-content-arn": "arn:aws:sagemaker:*:aws:hub-content/SageMakerPublicHub/Model/<model-id-to-allow>/*"
                }
            }
        },
        {
            "Sid": "BedrockEndpointTaggingOperations",
            "Effect": "Allow",
            "Action": [
                "sagemaker:AddTags",
                "sagemaker:DeleteTags"
            ],
            "Resource": [
                "arn:aws:sagemaker:*:*:endpoint/*",
                "arn:aws:sagemaker:*:*:endpoint-config/*",
                "arn:aws:sagemaker:*:*:model/*"
            ],
            "Condition": {
                "StringLike": {
                    "aws:ResourceTag/sagemaker-studio:hub-content-arn": "arn:aws:sagemaker:*:aws:hub-content/SageMakerPublicHub/Model/<model-id-to-allow>/*"
                }
            }
        }
    ]
}
```

------

此策略仅允许访问指定的模型，并拒绝访问所有其他模型。如果您的策略基于 `AmazonBedrockFullAccess`，则此策略应该取代 `MarketplaceModelEndpointMutatingAPIs` 和 `BedrockEndpointTaggingOperations` 语句。

# End-to-end 工作流程
<a name="bedrock-marketplace-end-to-end-workflow"></a>

设置 Amazon Bedrock Marketplace 后，你可以在 end-to-end工作流程中使用以下示例代码。如需更多上下文信息，您可以阅读代码后面的部分。

```
from botocore.exceptions import ClientError
import pprint
from datetime import datetime
import json
import time
import sys
import boto3
import argparse

SM_HUB_NAME = 'SageMakerPublicHub'
DELIMITER = "\n\n\n\n================================================================================================"


class Bedrock:
    def __init__(self, region_name) -> None:
        self.region_name = region_name
        self.boto3_session = boto3.session.Session()
        self.sagemaker_client = self.boto3_session.client(
            service_name='sagemaker',
            region_name=self.region_name,
        )

        self.bedrock_client = self.boto3_session.client(
            service_name='bedrock',
            region_name=self.region_name
        )
        self.endpoint_paginator = self.bedrock_client.get_paginator('list_marketplace_model_endpoints')
        self.bedrock_runtime_client = self.boto3_session.client(
            service_name='bedrock-runtime',
            region_name=self.region_name)

    def list_models(self):
        SM_RESPONSE_FIELD_NAME = 'HubContentSummaries'
        SM_HUB_CONTENT_TYPE = 'Model'

        response = self.sagemaker_client.list_hub_contents(
            MaxResults=100,
            HubName=SM_HUB_NAME,
            HubContentType=SM_HUB_CONTENT_TYPE
        )

        all_models = Bedrock.extract_bedrock_models(response[SM_RESPONSE_FIELD_NAME])

        while ("NextToken" in response) and response["NextToken"]:
            response = self.sagemaker_client.list_hub_contents(
                MaxResults=100,
                HubName=SM_HUB_NAME,
                HubContentType=SM_HUB_CONTENT_TYPE,
                NextToken=response['NextToken']
            )
            extracted_models = Bedrock.extract_bedrock_models(response[SM_RESPONSE_FIELD_NAME])
            if not extracted_models:
                # Bedrock enabled models always appear first, therefore can return when results are empty.
                return all_models
            all_models.extend(extracted_models)
            time.sleep(1)
        return all_models

    def describe_model(self, hub_name: str, hub_content_name: str):
        return self.sagemaker_client.describe_hub_content(
            HubName=hub_name,
            HubContentType='Model',
            HubContentName=hub_content_name
        )

    def list_endpoints(self):
        for response in self.endpoint_paginator.paginate():
            for endpoint in response['marketplaceModelEndpoints']:
                yield endpoint

    def list_endpoints_for_model(self, hub_content_arn: str):
        for response in self.endpoint_paginator.paginate(
                modelSourceEquals=hub_content_arn):
            for endpoint in response['marketplaceModelEndpoints']:
                yield endpoint

    # acceptEula needed only for gated models
    def create_endpoint(self, model, endpoint_config, endpoint_name: str, tags = []):
        model_arn = model['HubContentArn']
        if self._requires_eula(model=model):
            return self.bedrock_client.create_marketplace_model_endpoint(
                modelSourceIdentifier=model_arn,
                endpointConfig=endpoint_config,
                endpointName=endpoint_name,
                acceptEula=True,
                tags=tags
            )
        else:
            return self.bedrock_client.create_marketplace_model_endpoint(
                modelSourceIdentifier=model_arn,
                endpointConfig=endpoint_config,
                endpointName=endpoint_name,
                tags=tags
            )

    def delete_endpoint(self, endpoint_arn: str):
        return self.bedrock_client.delete_marketplace_model_endpoint(endpointArn=endpoint_arn)

    def describe_endpoint(self, endpoint_arn: str):
        return self.bedrock_client.get_marketplace_model_endpoint(endpointArn=endpoint_arn)['marketplaceModelEndpoint']

    def update_endpoint(self, endpoint_arn: str, endpoint_config):
        return self.bedrock_client.update_marketplace_model_endpoint(endpointArn=endpoint_arn,
                                                                 endpointConfig=endpoint_config)

    def register_endpoint(self, endpoint_arn: str, model_arn: str):
        return self.bedrock_client.register_marketplace_model_endpoint(endpointIdentifier=endpoint_arn,
                                                                       modelSourceIdentifier=model_arn)['marketplaceModelEndpoint']['endpointArn']

    def deregister_endpoint(self, endpoint_arn: str):
        return self.bedrock_client.deregister_marketplace_model_endpoint(endpointArn=endpoint_arn)

    def invoke(self, endpoint_arn: str, body):
        response = self.bedrock_runtime_client.invoke_model(modelId=endpoint_arn, body=body,
                                                            contentType='application/json')
        return json.loads(response["body"].read())

    def invoke_with_stream(self, endpoint_arn: str, body):
        return self.bedrock_runtime_client.invoke_model_with_response_stream(modelId=endpoint_arn, body=body)

    def converse(self, endpoint_arn: str, conversation):
        return self.bedrock_runtime_client.converse(modelId=endpoint_arn, messages=conversation)

    def converse_with_stream(self, endpoint_arn: str, conversation):
        return self.bedrock_runtime_client.converse_stream(modelId=endpoint_arn, messages=conversation,
                                                           inferenceConfig={"maxTokens": 4096, "temperature": 0.5,
                                                                            "topP": 0.9})

    def wait_for_endpoint(self, endpoint_arn: str):
        endpoint = self.describe_endpoint(endpoint_arn=endpoint_arn)
        while endpoint['endpointStatus'] in ['Creating', 'Updating']:
            print(
                f"Endpoint {endpoint_arn} status is still {endpoint['endpointStatus']}. Waiting 10 seconds before continuing...")
            time.sleep(10)
            endpoint = self.describe_endpoint(endpoint_arn=endpoint_arn)
        print(f"Endpoint status: {endpoint['status']}")

    def _requires_eula(self, model):
        if 'HubContentDocument' in model:
            hcd = json.loads(model['HubContentDocument'])
            if ('HostingEulaUri' in hcd) and hcd['HostingEulaUri']:
                return True
        return False

    @staticmethod
    def extract_bedrock_models(hub_content_summaries):
        models = []
        for content in hub_content_summaries:
            if ('HubContentSearchKeywords' in content) and (
                    '@capability:bedrock_console' in content['HubContentSearchKeywords']):
                print(f"ModelName: {content['HubContentDisplayName']}, modelSourceIdentifier: {content['HubContentArn']}")
                models.append(content)
        return models


def run_script(sagemaker_execution_role: str, region: str):
    # Script params
    model_arn = 'arn:aws:sagemaker:AWS 区域:aws:hub-content/SageMakerPublicHub/Model/example-model-name/hub-content-arn'
    model_name = 'example-model-name'
    sample_endpoint_name = f'test-ep-{datetime.now().strftime("%Y-%m-%d%H%M%S")}'
    sagemaker_execution_role = sagemaker_execution_role
    conversation = [
        {
            "role": "user",
            "content": [
                {
                    "text": "whats the best park in the US?"
                }
            ]
        }
    ]

    bedrock = Bedrock(region_name=region)

    ###
    ###  Model discovery
    ###

    # List all models - no new Bedrock Marketplace API here. Uses existing SageMaker APIs
    print(DELIMITER)
    print("All models:")
    all_models = bedrock.list_models()
    # Describe a model - no new Bedrock Marketplace API here. Uses existing SageMaker APIs
    # Examples:
    #     bedrock.describe_model("SageMakerPublicHub", "huggingface-llm-amazon-mistrallite")
    #     bedrock.describe_model("SageMakerPublicHub", "huggingface-llm-gemma-2b-instruct")
    print(DELIMITER)
    print(f'Describing model: {model_name}')
    model = bedrock.describe_model(SM_HUB_NAME, model_name)
    pprint.pprint(model)

    ## If customer wants to use a proprietary model, they need to subscribe to it first
    ## If customer wants to use a gated model, they need to accept EULA. Note: EULA Acceptance is on-creation, and needs
    ##     to be provided on every call. Cannot un-accept a EULA
    ## If customer wants to use an open weight model, they can proceed to deploy

    ###
    ###  Model deployment to create endpoints
    ###

    # # Create endpoint - uses Bedrock Marketplace API
    endpoint_arn = bedrock.create_endpoint(
        endpoint_name=sample_endpoint_name,
        endpoint_config={
            "sageMaker": {
                "initialInstanceCount": 1,
                "instanceType": "ml.g5.2xlarge",
                "executionRole": sagemaker_execution_role
                # Other fields:
                #   kmsEncryptionKey: KmsKeyId
                #   vpc: VpcConfig
            }
        },
        # Optional:
        # tags: TagList
        model=model
    )['marketplaceModelEndpoint']['endpointArn']

    # # Describe endpoint - uses Bedrock Marketplace API
    endpoint = bedrock.describe_endpoint(endpoint_arn=endpoint_arn)
    print(DELIMITER)
    print('Created endpoint:')
    pprint.pprint(endpoint)

    # Wait while endpoint is being created
    print(DELIMITER)
    bedrock.wait_for_endpoint(endpoint_arn=endpoint_arn)

    ###
    ###   Currently, customers cannot use self-hosted endpoints with Bedrock Runtime APIs and tools. They can only pass a model ID to the APIs.
    ###   Bedrock Marketplace will enable customers to use self-hosted endpoints through existing Bedrock Runtime APIs and tools
    ###   See below examples of calling invoke_model, invoke_model_with_response_stream, converse and converse_stream
    ###   Customers will be able to use the endpoints with Bedrock dev tools also (Guardrails, Model eval, Agents, Knowledge bases, Prompt flows, Prompt management) - examples not shown below
    ###

    # Prepare sample data for invoke calls by getting default payload in model metadata
    model_data = json.loads(bedrock.describe_model('SageMakerPublicHub', model_name)['HubContentDocument'])
    payload = list(model_data["DefaultPayloads"].keys())[0]
    invoke_body = model_data["DefaultPayloads"][payload]["Body"]
    invoke_content_field_name = 'generated_text'

    # Invoke model (text) - without stream - uses existing Bedrock Runtime API
    print(DELIMITER)
    print(f'Invoking model with body: {invoke_body}')
    invoke_generated_response = bedrock.invoke(endpoint_arn=endpoint_arn, body=json.dumps(invoke_body))
    print(f'Generated text:')
    print(invoke_generated_response[invoke_content_field_name])
    sys.stdout.flush()

    # Converse with model (chat) - without stream - uses existing Bedrock Runtime API
    print(DELIMITER)
    print(f'Converse model with conversation: {conversation}')
    print(bedrock.converse(endpoint_arn=endpoint_arn, conversation=conversation)['output'])

    ###
    ##  Other endpoint management operations
    ###

    # List all endpoints - uses Bedrock Marketplace API
    print(DELIMITER)
    print('Listing all endpoints')
    for endpoint in bedrock.list_endpoints():
        pprint.pprint(endpoint)

    # List endpoints for a model
    # Example: bedrock.list_endpoints_for_model(hub_content_arn='arn:aws:sagemaker:us-west-2:aws:hub-content/SageMakerPublicHub/Model/huggingface-textgeneration1-mpt-7b-storywriter-bf16/3.2.0')
    print(DELIMITER)
    print(f"Listing all endpoints for model: {model_arn}")
    for endpoint in bedrock.list_endpoints_for_model(hub_content_arn=model_arn):
        pprint.pprint(endpoint)

    # # Update endpoint - uses new API provided by Bedrock Marketplace
    updated_endpoint_arn = bedrock.update_endpoint(
        endpoint_arn=endpoint_arn,
        endpoint_config={
            "sageMaker": {
                "initialInstanceCount": 2,  # update to increase instance count
                "instanceType": "ml.g5.2xlarge",
                "executionRole": sagemaker_execution_role
                # Other fields:
                #   kmsEncryptionKey: KmsKeyId
                #   vpc: VpcConfig
            }
        # Optional:
        # tags: TagList
        }
    )['marketplaceModelEndpoint']['endpointArn']

    # Wait while endpoint is being updated
    print(DELIMITER)
    bedrock.wait_for_endpoint(endpoint_arn=updated_endpoint_arn)

    # Confirm endpoint update
    updated_endpoint = bedrock.describe_endpoint(endpoint_arn=updated_endpoint_arn)
    print(f'Updated endpoint: {updated_endpoint}')
    assert updated_endpoint['endpointConfig']['sageMaker']['initialInstanceCount'] == 2
    print(DELIMITER)
    print(f'Confirmed that updated endpoint\'s initialInstanceCount config changed from 1 to 2')

    # Wait while endpoint is being updated
    print(DELIMITER)
    bedrock.wait_for_endpoint(endpoint_arn=updated_endpoint_arn)

    # Deregister endpoint - uses Bedrock Marketplace API
    print(DELIMITER)
    print(f'De-registering endpoint: {updated_endpoint_arn}')
    bedrock.deregister_endpoint(endpoint_arn=updated_endpoint_arn)
    try:
        pprint.pprint(bedrock.describe_endpoint(endpoint_arn=updated_endpoint_arn))
    except ClientError as err:
        assert err.response['Error']['Code'] == 'ResourceNotFoundException'
        print(f"Confirmed that endpoint {updated_endpoint_arn} was de-registered")

    # Re-register endpoint - uses Bedrock Marketplace API
    print(DELIMITER)
    print(f'Registered endpoint: {bedrock.register_endpoint(endpoint_arn=updated_endpoint_arn, model_arn=model_arn)}')
    pprint.pprint(bedrock.describe_endpoint(endpoint_arn=updated_endpoint_arn))

    # Delete endpoint - uses Bedrock Marketplace API
    print(DELIMITER)
    print(f'Deleting endpoint: {updated_endpoint_arn}')
    bedrock.delete_endpoint(endpoint_arn=updated_endpoint_arn)
    try:
        pprint.pprint(bedrock.describe_endpoint(endpoint_arn=updated_endpoint_arn))
    except ClientError as err:
        assert err.response['Error']['Code'] == 'ResourceNotFoundException'
        print(f"Confirmed that endpoint {updated_endpoint_arn} was deleted")


if __name__ == '__main__':

    parser = argparse.ArgumentParser()

    parser.add_argument('--sagemaker-execution-role', required=True)
    parser.add_argument('--region', required=True)

    args = parser.parse_args()
    run_script(args.sagemaker_execution_role, args.region)
```

# 搜索模型
<a name="bedrock-marketplace-discover-a-model"></a>

您可以从模型目录中搜索 Amazon Bedrock Marketplace 模型和 Amazon Bedrock 无服务器模型。

使用以下步骤来搜索 Amazon Bedrock Marketplace 模型。

**搜索 Amazon Bedrock Marketplace 模型**

1.  AWS 管理控制台 使用具有 Amazon Bedrock 权限的 IAM 角色登录。

1. 在搜索栏中，指定“Amazon Bedrock”，然后从下拉列表中选择 **Amazon Bedrock**。

1. 在导航窗格中选择**模型目录**。

1. 将**模型集合**的筛选条件设置为 **Bedrock Marketplace** 来加载 Amazon Bedrock Marketplace 模型。

1. 此外，您可以直接在搜索栏中搜索模型名称。

**注意**  
对于 Amazon Bedrock Marketplace 中的专有模型，您必须订阅模型才能访问。

# 订阅模型
<a name="bedrock-marketplace-subscribe-to-a-model"></a>

要使用 Amazon Bedrock Marketplace 中的模型，您必须订阅该模型。如果您使用的是公开可用的模型，例如 HuggingFace 模型，则无需订阅。模型可以是公开模型，也可以是专有模型。订阅模特时，即表示您查看并接受模型提供商 EULAs 的价格。

**注意**  
由于自动启用，在首次调用之前不需要订阅，Amazon Bedrock 会在后台自动启动订阅流程。在订阅完成期间，API 调用可能会暂时成功。但是，如果订阅失败，后续请求将失败，请参阅[访问 Amazon Bedrock 基础模型](model-access.md)。

**订阅模型**

1.  AWS 管理控制台 使用具有 Amazon Bedrock 权限的 IAM 角色登录。

1. 在搜索栏中，指定“Amazon Bedrock”，然后从下拉列表中选择 **Amazon Bedrock**。

1. 在导航窗格中选择模型目录。

1. 将**模型集合**指定为 **Bedrock Marketplace** 来加载 Amazon Bedrock Marketplace 模型。

   1. 此外，您可以直接在搜索栏中搜索模型名称。

1. 选择模型卡片打开**模型详细信息**页面。

1. 选择**查看订阅选项**来打开订阅模式。

1. 查看报价和费用。

1. 查看法律条款和条件。

1. 选择**订阅**。

订阅过程通常可在 10 到 15 分钟内完成，但可能因提供商的要求而异。

这些费用仅为软件成本。将根据您选择的实例类型和实例数量向您单独收取 SageMaker AI 基础设施成本。

# 部署模型
<a name="bedrock-marketplace-deploy-a-model"></a>

订阅模型后，将其部署到 A SageMaker I 终端节点。然后对端点进行推理调用。该模型由 SageMaker AI 托管。在部署过程中，您必须提供以下信息：
+  SageMaker AI 端点的名称
+ 对端点进行推理调用的实例数量
+ 端点的实例类型

您还可以配置可选的高级选项，例如标签。

A SageMaker I 服务角色会自动创建， SageMaker 让 AI 代表您担任和执行操作。有关 Amazon A SageMaker I 权限的更多信息，请参阅[如何使用 SageMaker AI 执行角色](https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-roles.html )。

您也可以选择现有角色或创建新角色。要了解如何部署 Amazon Bedrock Marketplace 模型，请选择与您选择的方法相对应的选项卡，然后按照以下步骤操作：

**要部署模型**

1.  AWS 管理控制台 使用具有 Amazon Bedrock 权限的 IAM 角色登录。

1. 在搜索栏中，指定“Amazon Bedrock”，然后从下拉列表中选择 **Amazon Bedrock**。

1. 在导航窗格中选择**模型目录**。

1. 为您要部署的模型选择模型卡片。

1. 选择**部署**。

1. 在**端点名称**中指定端点的名称。

1. 选择实例的数量以及实例类型。

1. 在**高级设置**下，您可以选择：

   1. 设置 VPC

   1. 配置服务访问角色。

   1. 自定义加密设置

   1. 添加标签

1. 选择 “**部署**”，将您的亚马逊 Bedrock Marketplace 模型部署到 SageMaker 人工智能终端节点。此过程通常需要 10 到 15 分钟。

使用 `CreateMarketplaceModelEndpoint` 操作创建端点。某些模型具有最终用户许可协议（EULA）。要接受 EULA，请将 `AcceptEula` 设置为 `True`。

以下示例使用示例 AWS Command Line Interface 命令创建终端节点：

```
aws bedrock create-marketplace-model-endpoint --model-source-identifier HubContentArn --endpoint-config "{\"sageMaker\":{\"initialInstanceCount\":1,\"instanceType\":\"ml.g5.xlarge\",\"executionRole\":\"arn:aws:iam::111122223333:role/example-IAM-role\"}}" --endpoint-name "example-endpoint-name"
```

**注意**  
`CreateMarketplaceModelEndpoint`、`UpdateMarketplaceModelEndpoint` 和 `RegisterMarketplaceModelEndpoint` 操作的响应是相同的。

```
{"marketplaceModelEndpoint":{"createdAt":"2024-11-12T02:31:58.201474085Z","endpoint":{"sageMaker":{"executionRole":"arn:aws:iam::111122223333:role/service-role/amazon-sagemaker-execution-role","initialInstanceCount":1,"instanceType":"ml.g5.2xlarge","kmsEncryptionKey":null,"vpc":null}},"endpointArn":"arn:aws:sagemaker:region:555555555555:endpoint/example-endpoint-name","endpointStatus":"Creating","endpointStatusMessage":"","modelSourceIdentifier":"arn:aws:sagemaker:region:aws:hub-content/SageMakerPublicHub/Model/example-model-name/1.2.2","status":"ACTIVE","statusMessage":"","updatedAt":"2024-11-12T02:31:58.201474085Z"}}
```

你可以在亚马逊 Bedrock Marketplace 和亚马逊 A SageMaker I 中修改终端节点。建议仅在 Amazon Bedrock 中修改端点。如果您在 SageMaker AI 中修改终端节点，则可能无法在 Amazon Bedrock 中使用该终端节点。以下修改可能导致端点在 Amazon Bedrock 中出现故障：
+ 设置[EnableNetworkIsolation](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateModel.html#sagemaker-CreateModel-request-EnableNetworkIsolation)为 `False`
+ 修改[PrimaryContainer](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateModel.html#sagemaker-CreateModel-request-PrimaryContainer)对象内的模型定义

要使端点正常运行，必须注册端点并将其投入使用。您可以使用以下 AWS Command Line Interface 命令来检查终端节点的状态。

```
aws bedrock get-marketplace-model-endpoint --endpoint-arn arn:aws:sagemaker:region:111122223333:endpoint/example-endpoint-name            
```

端点必须具有以下状态，才能与 Amazon Bedrock 配合使用：

```
endpointStatus: InService
status: REGISTERED
```

如果所做的修改导致端点出现故障，您可以取消注册并重新注册该端点。使用 `DeregisterEndpoint` 操作取消注册端点。使用 `RegisterEndpoint` 操作重新注册端点。

```
aws bedrock deregister-marketplace-model-endpoint --endpoint-arn arn:aws:sagemaker:region:111122223333:endpoint/example-endpoint-name
```

```
aws bedrock register-marketplace-model-endpoint --endpoint-identifier arn:aws:sagemaker:region:111122223333:endpoint/example-endpoint-name --model-source-identifier
         HubContentArn
```

# 自带端点
<a name="bedrock-marketplace-bring-your-own-endpoint"></a>

您可以注册托管您在 SageMaker 人工智能中创建的 Amazon Bedrock AWS Marketplace 模型的终端节点。在注册过程中，系统会检查模型是否符合 Amazon Bedrock Marketplace 的要求。您必须在端点上启用网络隔离。此外，您无法从提供商所提供的基础模型更改模型构件。

有关注册终端节点的更多信息，请参阅在 A [mazon Bedrock 中使用你的 A SageMaker I JumpStart 模型](https://docs.aws.amazon.com/sagemaker/latest/dg/jumpstart-foundation-models-use-studio-updated-register-bedrock)

# 调用端点
<a name="bedrock-marketplace-call-the-endpoint"></a>

在将模型部署到端点后，您可以开始使用模型。您可以使用 `Converse` 或 `InvokeModel` 操作来调用模型。

有关 `Converse` 操作支持的模型列表，请参阅[模型兼容性](bedrock-marketplace-model-reference.md)。有关代理的信息，请参阅[使用人工智能代理在应用程序中自动执行任务](agents.md)。有关知识库的信息，请参阅[利用 Amazon Bedrock 知识库检索数据并生成人工智能响应](knowledge-base.md)。

**使用模型**

1.  AWS 管理控制台 使用具有 Amazon Bedrock 权限的 IAM 角色登录。

1. 在搜索栏中，指定“Amazon Bedrock”，然后从下拉列表中选择 **Amazon Bedrock**。

1. 选择您要使用的工具。**演练场**是您用来访问所部署模型的最快捷的方式。

1. 选择**选择模型**。

1. 选择模型的端点。

您也可以使用以下示例 AWS Command Line Interface 命令来调用终端节点。

```
aws bedrock-runtime converse --model-id arn:aws:sagemaker:region:111122223333:endpoint/example-endpoint-name --messages '[{"role": "user", "content": [{"text": "Describe the purpose of a \"hello world\" program in one line."}]}]'
```

```
aws bedrock-runtime invoke-model --model-id arn:aws:sagemaker:region:111122223333:endpoint/example-endpoint-name --body '{"inputs": "Hello? How are you?", "parameters": {"details": true}}' --cli-binary-format raw-in-base64-out test.txt
```

# 管理端点
<a name="bedrock-marketplace-manage-your-endpoints"></a>

您可以通过以下方式查看和管理 Amazon Bedrock Marketplace 模型的端点：
+ 编辑实例数量或实例类型
+ 更改标签
+ 删除端点

您还可以注册和注销您通过 AI 创建的 Amazon Bedrock Marketplace 模型的终端节点。 SageMaker 

**管理端点**

1.  AWS 管理控制台 使用具有 Amazon Bedrock 权限的 IAM 角色登录。

1. 在搜索栏中，指定“Amazon Bedrock”，然后从下拉列表中选择 **Amazon Bedrock**。

1. 在**基础模型**下选择 **Marketplace 部署**

1. 从**操作**栏中选择**注册**、**编辑**或**删除**。

1. 要查看更多详细信息，请选择端点。

您可以使用以下 AWS Command Line Interface 命令删除终端节点。

```
aws bedrock delete-marketplace-model-endpoint --endpoint-arn "arn:aws:sagemaker:region:111122223333:endpoint/example-endpoint"
```

前述命令不返回响应。

您可以使用以下 AWS Command Line Interface 命令更新端点。

```
aws bedrock update-marketplace-model-endpoint --endpoint-config "{\"sageMaker\":{\"initialInstanceCount\":2,\"instanceType\":\"ml.g5.xlarge\",\"executionRole\":\"arn:aws:iam::111122223333:role/service-role/example-sagemaker-service-role\"}}" --endpoint-arn "arn:aws:sagemaker:region:account-number:endpoint/example-endpoint-name"
```

**注意**  
`CreateMarketplaceModelEndpoint`、`RegisterMarketplaceModelEndpoint` 和 `UpdateMarketplaceModelEndpoint` 操作的响应是相同的。

# 模型兼容性
<a name="bedrock-marketplace-model-reference"></a>

所有模型都可以使用 `InvokeModel` 操作。部分模型可以使用 `Converse` 操作。

对于 Amazon Bedrock Marketplace 模型，请使用 [ApplyGuardrail](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ApplyGuardrail.html) API 来使用 Amazon Bedrock 护栏。

下表列出了可用的模型以及这些模型是否可以使用 `Converse` 操作：


| 名称 | 支持 Converse API | 支持流式处理 | 
| --- | --- | --- | 
|  Arcee Lite  |  支持  |  是  | 
|  Arcee Nova  |  支持  |  是  | 
|  Arcee SuperNova  |  支持  |  是  | 
|  Arcee Virtuoso Small  |  支持  |  是  | 
|  Aya 101  |  否  |  是  | 
|  Bart Large CNN samsum  |  否  |  否  | 
|  Bloom 1b1  |  否  |  是  | 
|  Bloom 1b7  |  否  |  是  | 
|  Bloom 3B  |  否  |  是  | 
|  Bloom 560m  |  否  |  是  | 
|  Bloom 7B1  |  否  |  是  | 
|  Bloomz 1b1  |  否  |  是  | 
|  Bloomz 1b7  |  否  |  是  | 
|  BloomZ 3B FP16  |  否  |  是  | 
|  BloomZ 7B1 FP16  |  否  |  是  | 
|  Bria 2.2HD Commercial  |  否  |  否  | 
|  Bria 2.3 Commercial   |  否  |  否  | 
|  Bria 2.3 Fast Commercial   |  否  |  否  | 
|  CyberAgentLM3-22B-Chat（CALM3-22B-Chat）  |  支持  |  是  | 
|  DBRX Base  |  否  |  是  | 
|  DBRX Instruct  |  支持  |  是  | 
|  DeepSeek-R1-Distill-Llama-70B  |  否  |  是  | 
|  DeepSeek-R1-Distill-Llama-8B  |  否  |  是  | 
|  DeepSeek-R1-Distill-Qwen-32B  |  否  |  是  | 
|  DeepSeek-R1-Distill-Qwen-14B  |  否  |  是  | 
|  DeepSeek-R1-Distill-Qwen-7B  |  否  |  是  | 
|  DeepSeek-R1-Distill-Qwen-1.5B  |  否  |  是  | 
|  DeepSeek-R1  |  否  |  是  | 
|  Distilbart CNN 12-6  |  否  |  否  | 
|  Distilbart CNN 6-6  |  否  |  否  | 
|  Distilbart xsum 12-3  |  否  |  否  | 
|  DistilGPT 2  |  否  |  是  | 
|  Dolly V2 12b BF16  |  否  |  是  | 
|  Dolly V2 3b BF16  |  否  |  是  | 
|  Dolly V2 7b BF16  |  否  |  是  | 
|  Dolphin 2.2.1 Mistral 7B  |  支持  |  是  | 
|  Dolphin 2.5 Mixtral 8 7B  |  支持  |  是  | 
|  EleutherAI GPT Neo 1.3B  |  否  |  是  | 
|  EleutherAI GPT Neo 2.7B  |  否  |  是  | 
|  ESM3-open  |  否  |  否  | 
|  EXAONE\$1v3.0 7.8B Instruct  |  是  |  否  | 
|  Falcon 40B BF16  |  否  |  是  | 
|  Falcon Lite  |  否  |  是  | 
|  Falcon Lite 2  |  否  |  是  | 
|  Falcon RW 1B  |  否  |  是  | 
|  Falcon3 1B Instruct  |  支持  |  是  | 
|  Falcon3 3B Base   |  否  |  是  | 
|  Falcon3 3B Instruct  |  支持  |  是  | 
|  Falcon3 7B Base  |  否  |  是  | 
|  Falcon3 7B Instruct  |  支持  |  是  | 
|  Falcon3 10B Base   |  否  |  是  | 
|  Falcon3 10B Instruct  |  支持  |  是  | 
|  Flan-T5 Base  |  否  |  是  | 
|  在 Samsum 数据集上微调 Flan-T5 基本模型  |  否  |  是  | 
|  Flan-T5 Large  |  否  |  是  | 
|  Flan-T5 Small  |  否  |  是  | 
|  Gemma 2 27B  |  否  |  是  | 
|  Gemma 2 27B Instruct  |  支持  |  是  | 
|  Gemma 2 2B  |  否  |  是  | 
|  Gemma 2 2B Instruct  |  支持  |  是  | 
|  Gemma 2 9B  |  否  |  是  | 
|  Gemma 2 9B Instruct  |  支持  |  是  | 
|  Gemma 2B  |  否  |  是  | 
|  Gemma 2B Instruct  |  支持  |  是  | 
|  Gemma 7B  |  否  |  是  | 
|  Gemma 7B Instruct  |  支持  |  是  | 
|  GPT 2  |  否  |  是  | 
|  GPT NeoX 20B FP16  |  否  |  是  | 
|  GPT-2 XL  |  否  |  是  | 
|  GPT-J 6B  |  否  |  是  | 
|  GPT-Neo 1.3B  |  否  |  是  | 
|  GPT-Neo 125M  |  否  |  是  | 
|  GPT-NEO 2.7B  |  否  |  是  | 
|  Granite 3.0 2B Instruct  |  支持  |  是  | 
|  Granite 3.0 8B Instruct  |  支持  |  是  | 
|  Gretel Navigator Tabular  |  支持  |  是  | 
|  IBM Granite 20B Code Instruct - 8K  |  支持  |  是  | 
|  IBM Granite 34B Code Instruct - 8K  |  支持  |  是  | 
|  IBM Granite 3B Code Instruct - 128K  |  支持  |  是  | 
|  IBM Granite 8B Code Instruct - 128K  |  支持  |  是  | 
|  KARAKURI LM 8x7b instruct  |  否  |  是  | 
|  Liquid  |  支持  |  是  | 
|  Llama 3.1 SuperNova Lite  |  支持  |  是  | 
|  Llama Spark  |  支持  |  是  | 
|  Llama-3-Varco-Offsetbias-8B  |  否  |  是  | 
|  Llama3 8B SEA-Lion v2.1 Instruct  |  支持  |  是  | 
|  MARS6  |  否  |  否  | 
|  Medical LLM - Medium  |  否  |  否  | 
|  Medical LLM - Small  |  否  |  否  | 
|  Medical Text Translation (EN-ES)  |  否  |  否  | 
|  Mistral 7B OpenOrca AWQ  |  支持  |  是  | 
|  Mistral 7B OpenOrca GPTQ  |  支持  |  是  | 
|  Mistral 7B SFT Alpha  |  支持  |  是  | 
|  Mistral 7B SFT Beta  |  支持  |  是  | 
|  Mistral Lite  |  支持  |  是  | 
|  Mistral Nemo Base 2407  |  否  |  是  | 
|  Mistral Nemo Instruct 2407  |  支持  |  是  | 
|  Mistral Trix V1  |  否  |  是  | 
|  MPT 7B BF16  |  否  |  是  | 
|  MPT 7B Instruct BF16  |  否  |  是  | 
|  MPT 7B StoryWriter-65k\$1 BF16  |  否  |  是  | 
|  Multilingual GPT  |  否  |  是  | 
|  NVIDIA Nemotron-4 15B NIM Microservice  |  是  |  否  | 
|  Open Hermes 2 Mistral 7B  |  支持  |  是  | 
|  Phi-2  |  否  |  是  | 
|  Phi-3-Mini-128K-Instruct  |  支持  |  是  | 
|  Phi-3-Mini-4K-Instruct  |  支持  |  是  | 
|  Phi-3.5-mini-instruct  |  支持  |  是  | 
|  Pixtral 12B 2409  |  支持  |  是  | 
|  PLaMo API  |  否  |  是  | 
|  Snowflake Arctic Instruct Vllm  |  支持  |  是  | 
|  Solar Mini Chat  |  支持  |  是  | 
|  Solar Mini Chat - Quant  |  支持  |  是  | 
|  Solar Mini Chat ja  |  支持  |  是  | 
|  Solar Mini Chat ja - Quant  |  支持  |  是  | 
|  Solar Pro  |  支持  |  是  | 
|  Solar Pro（Quantized）  |  支持  |  是  | 
|  Stable Diffusion 3.5 Large  |  否  |  否  | 
|  Stockmark-LLM-13b  |  否  |  否  | 
|  文本摘要  |  否  |  否  | 
|  VARCO LLM KO/EN-13B-IST  |  是  |  否  | 
|  Whisper Large V3 Turbo  |  否  |  是  | 
|  Widn Llama3-Tower Vesuvius  |  支持  |  是  | 
|  Widn Tower Anthill  |  支持  |  是  | 
|  Widn Tower Sugarloaf  |  支持  |  是  | 
|  Writer Palmyra Small  |  否  |  是  | 
|  Writer Palmyra-Fin-70B-32K  |  支持  |  是  | 
|  Writer Palmyra-Med-70B-32K  |  支持  |  是  | 
|  YARN Mistral 7B 128k  |  否  |  是  | 
|  Yi-1.5-34B  |  否  |  是  | 
|  Yi-1.5-34B-Chat  |  支持  |  是  | 
|  Yi-1.5-6B  |  否  |  是  | 
|  Yi-1.5-6B-Chat  |  支持  |  是  | 
|  Yi-1.5-9B  |  否  |  是  | 
|  Yi-1.5-9B-Chat  |  支持  |  是  | 
|  Zephyr 7B Alpha  |  否  |  是  | 
|  Zephyr 7B Beta  |  否  |  是  | 
|  Zephyr 7B Gemma  |  否  |  是  | 