借助 Model Garden,您可以自行部署精选的合作伙伴模型(预览版)。自行部署的模型不是无服务器模型。您必须先将其部署在 Gemini Enterprise Agent Platform 上,然后才能使用。这些模型会安全地部署在您的Google Cloud 项目和 VPC 网络中。如需详细了解自行部署的模型,请参阅“自行部署的模型”文档。
购买可自行部署的合作伙伴模型
如需在 Gemini Enterprise Agent Platform 上部署可自行部署的合作伙伴模型,您必须先通过 Google Cloud Marketplace 购买它们。如需购买可自行部署的合作伙伴模型,请执行以下操作:
前往 Model Garden。
在模型集合中,点击可自行部署的合作伙伴模型以过滤模型列表。
点击要购买的合作伙伴模型的模型卡片。
点击与销售人员联系。
填写表单并提交申请。
完成上述步骤后,您将与 Google Cloud 销售代表取得联系以完成购买。
部署模型
购买可自行部署的合作伙伴模型后,您可以使用一键式部署将其部署到 Gemini Enterprise Agent Platform 端点。此过程通过预先配置必要的设置来简化部署。
您可以使用 Google Cloud 控制台或 Python 版 Agent Platform SDK 执行一键式部署。
控制台
如需在 Google Cloud 控制台中部署合作伙伴模型,请执行以下操作:
前往 Model Garden。
找到并点击要使用的合作伙伴模型的模型卡片。
点击部署模型。
按照提示配置您的部署设置。
点击部署。
Python
以下示例展示了如何使用 Agent Platform SDK for Python 部署合作伙伴模型。请将占位值替换为您的具体信息。
import agentplatform
from agentplatform import types
client = agentplatform.Client(project="PROJECT_ID", location="LOCATION")
response = client.model_garden.deploy_publisher_model(
# Replace with the actual partner model ID from Model Garden
model="PARTNER_MODEL_ID",
config=types.DeployPublisherModelConfig(
accept_eula=True,
machine_type="MACHINE_TYPE", # e.g., "a3-ultragpu-8g"
accelerator_type="ACCELERATOR_TYPE", # e.g., "NVIDIA_H200_141GB"
accelerator_count=ACCELERATOR_COUNT, # e.g., 8
endpoint_display_name="ENDPOINT_DISPLAY_NAME",
model_display_name="MODEL_DISPLAY_NAME",
),
)
print(f"Model deployed to endpoint: {response.endpoint}")
使用模型的经过验证的部署选项中的机器类型和加速器。如需列出这些内容,请调用 client.model_garden.list_publisher_model_deploy_options(model="PARTNER_MODEL_ID")。
合作伙伴模型使用其发布者的服务容器,因此您无法替换容器映像。