agent-platform-model-registry
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAgent Platform Model Registry Management
Agent Platform模型注册表管理
Overview
概述
This skill provides instructions for managing machine learning models in the
Agent Platform Model Registry. It covers listing models, describing model
details, uploading new models or versions, updating metadata, and deleting
models.
本技能提供了在Agent Platform模型注册表中管理机器学习模型的操作指南,涵盖列出模型、描述模型详情、上传新模型或版本、更新元数据以及删除模型等操作。
Safety & Confirmation Tiers (CRITICAL)
安全与确认层级(CRITICAL)
Before executing any commands on behalf of the user, you MUST adhere to the
following safety tiers based on the action requested:
- Tier R: Read-only (,
list,describe)get- No confirmation needed. Execute immediately to gather information.
- Tier M: Mutating & Reversible (,
upload)update- Requires interactive confirmation with 'Yes'/'No' options. The
confirmation prompt MUST contain the exact, literal command string
with all required flags (e.g. ,
--region=us-central1) — natural-language paraphrases are NOT sufficient.--display-name="..." - Same-turn restriction: NEVER execute the command in the same turn as presenting the confirmation prompt. Stop and wait for the user's reply; only execute after explicit 'Yes' / approval.
- Requires interactive confirmation with 'Yes'/'No' options. The
confirmation prompt MUST contain the exact, literal command string
with all required flags (e.g.
- Tier D: Destructive & Irreversible ()
delete- Requires explicit typed confirmation (e.g. "I confirm" or "Yes, delete it"). Ask for confirmation IMMEDIATELY — before any pre-flight checks (don't check if the model is deployed to endpoints first).
- Same-turn restriction: NEVER execute in the same turn as asking for typed confirmation. Wait for the user to reply in a new turn.
在代表用户执行任何命令之前,你必须根据请求的操作遵循以下安全层级:
- R级:只读操作(、
list、describe)get- 无需确认,立即执行以收集信息。
- M级:可变更且可撤销操作(、
upload)update- 需要交互式确认,提供“是/否”选项。确认提示必须包含完整的命令字符串及所有必要的参数(例如、
--region=us-central1)——自然语言转述是不够的。--display-name="..." - 同轮次限制:绝对不能在展示确认提示的同一轮次执行命令。停止并等待用户回复;仅在收到明确的“是”或批准后再执行。
- 需要交互式确认,提供“是/否”选项。确认提示必须包含完整的命令字符串及所有必要的参数(例如
- D级:破坏性且不可撤销操作()
delete- 需要明确的输入确认(例如“我确认”或“是的,删除它”)。立即请求确认——在任何预检检查之前(不要先检查模型是否已部署到端点)。
- 同轮次限制:绝对不能在请求输入确认的同一轮次执行命令。等待用户在新的轮次回复。
Phase 0: Environment Setup
阶段0:环境设置
CRITICAL: Before running any commands, you MUST ensure the environment is
correctly initialized by following these steps:
- Google Cloud Authentication: Authenticate with your Google Cloud
credentials and configure active Application Default Credentials (ADC) for
Agent Platform access:
bash
gcloud auth login gcloud auth application-default login - Set Project: Configure the active project for subsequent commands:
bash
gcloud config set project $PROJECT_ID - Region: Always specify on each command below. Do NOT use
--region=$LOCATION_ID.global
CRITICAL:在运行任何命令之前,你必须按照以下步骤确保环境已正确初始化:
- Google Cloud身份验证:使用你的Google Cloud凭据进行身份验证,并为Agent Platform访问配置有效的应用默认凭据(ADC):
bash
gcloud auth login gcloud auth application-default login - 设置项目:为后续命令配置当前项目:
bash
gcloud config set project $PROJECT_ID - 区域:在以下每个命令中必须指定。请勿使用
--region=$LOCATION_ID。global
1. Listing Models (Tier R)
1. 列出模型(R级)
Use this command to discover existing models in the registry and retrieve their
numeric IDs. No confirmation is required.
bash
gcloud ai models list \
--region=$LOCATION_ID使用此命令发现注册表中的现有模型并获取其数字ID。无需确认。
bash
gcloud ai models list \
--region=$LOCATION_ID2. Describing a Model (Tier R)
2. 描述模型(R级)
Retrieve the full metadata for a specific model or version. No confirmation is
required.
bash
gcloud ai models describe $MODEL_ID \
--region=$LOCATION_IDTo target a specific version:
bash
gcloud ai models describe ${MODEL_ID}@${VERSION_ID} \
--region=$LOCATION_ID获取特定模型或版本的完整元数据。无需确认。
bash
gcloud ai models describe $MODEL_ID \
--region=$LOCATION_ID若要指定特定版本:
bash
gcloud ai models describe ${MODEL_ID}@${VERSION_ID} \
--region=$LOCATION_ID3. Uploading a Model (Tier M)
3. 上传模型(M级)
Register a new model or a new version of an existing model. This is a
long-running operation.
Action requires an inline confirmation card before proceeding.
注册新模型或现有模型的新版本。这是一个长时间运行的操作。
操作前需要内嵌确认卡片。
Example: Uploading a Custom Model
示例:上传自定义模型
bash
gcloud ai models upload \
--region=$LOCATION_ID \
--display-name="my-custom-model" \
--container-image-uri="gcr.io/my-project/my-model:latest" \
--artifact-uri="gs://my-bucket/path/to/artifacts"[!IMPORTANT] This is a Tier M operation — see [Safety & Confirmation Tiers] above.
To upload a new version of an existing model, use the flag or
specify the parent model ID.
--parent-modelbash
gcloud ai models upload \
--region=$LOCATION_ID \
--display-name="my-custom-model" \
--container-image-uri="gcr.io/my-project/my-model:latest" \
--artifact-uri="gs://my-bucket/path/to/artifacts"[!IMPORTANT] 这是M级操作——请参阅上方的[安全与确认层级]。
若要上传现有模型的新版本,请使用参数或指定父模型ID。
--parent-model4. Updating a Model (Tier M)
4. 更新模型(M级)
Update metadata fields like display name, description, or labels.
Action requires an inline confirmation card before proceeding.
bash
gcloud ai models update $MODEL_ID \
--region=$LOCATION_ID \
--display-name="new-display-name" \
--description="Updated description"[!IMPORTANT] This is a Tier M operation — see [Safety & Confirmation Tiers] above.
更新元数据字段,如显示名称、描述或标签。
操作前需要内嵌确认卡片。
bash
gcloud ai models update $MODEL_ID \
--region=$LOCATION_ID \
--display-name="new-display-name" \
--description="Updated description"[!IMPORTANT] 这是M级操作——请参阅上方的[安全与确认层级]。
5. Deleting a Model (Tier D)
5. 删除模型(D级)
Permanently delete a Model and all its versions.
Action requires explicit typed confirmation before proceeding.
bash
gcloud ai models delete $MODEL_ID \
--region=$LOCATION_ID[!WARNING] This operation is irreversible. All model versions must be undeployed from all Endpoints before deletion.
永久删除模型及其所有版本。
操作前需要明确的输入确认。
bash
gcloud ai models delete $MODEL_ID \
--region=$LOCATION_ID[!WARNING] 此操作不可撤销。删除前必须将所有模型版本从所有端点中移除。