{"data":{"slug":"github-google-skills-skills-cloud-agent-platform-model-registry-c681da31adf1","title":"Manage Agent Platform Models","summary":"Efficiently manage machine learning models in the Agent Platform Model Registry with commands for listing, describing, uploading, updating, and deleting models.","url":"https:\/\/skillshunter.net\/skills\/github-google-skills-skills-cloud-agent-platform-model-registry-c681da31adf1","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-google-skills-skills-cloud-agent-platform-model-registry-c681da31adf1","markdown_url":"https:\/\/skillshunter.net\/skills\/github-google-skills-skills-cloud-agent-platform-model-registry-c681da31adf1.md","download_url":"https:\/\/skillshunter.net\/skills\/github-google-skills-skills-cloud-agent-platform-model-registry-c681da31adf1\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Before running any commands, verify that all necessary parameters are known, including region, project, and model ID. If missing, pause and ask the user for the required information.","instructions":"---\nname: agent-platform-model-registry\nmetadata:\n  version: \"1.0.2\"\n  category: AiAndMachineLearning\ndescription: >-\n  Agent Platform Model Registry Management. Use when you need to upload, list,\n  describe, update, or delete machine learning models (and their versions)\n  in the Agent Platform Model Registry. Don't use for model training, model\n  deployment to endpoints, or managing non-Agent Platform models.\n---\n\n# Agent Platform Model Registry Management\n\n## Attribution\n\n**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you MUST\nread [Usage Attribution](references\/attribution.md). For commands executed\ndirectly in the terminal (never in generated scripts, Terraform, or user code),\nprefix `gcloud` with `CLOUDSDK_METRICS_REQUEST_ATTRIBUTION` and append the\nattribution suffix to `User-Agent` headers:\n\n```text\nCLOUDSDK_METRICS_REQUEST_ATTRIBUTION=\"agent-skills\/1.0 (skill:agent-platform-model-registry)\"\nUser-Agent: <existing_user_agent> agent-skills\/1.0 (skill:agent-platform-model-registry)\n```\n\n## Overview\n\nThis skill provides instructions for managing machine learning models in the\nAgent Platform Model Registry. It covers listing models, describing model\ndetails, uploading new models or versions, updating metadata, and deleting\nmodels.\n\n## Safety & Confirmation Tiers (CRITICAL)\n\nBefore executing any commands on behalf of the user, you MUST adhere to the\nfollowing safety tiers based on the action requested:\n\n1.  **Tier R: Read-only (`list`, `describe`, `get`)**\n    *   No confirmation needed. Execute immediately to gather information.\n2.  **Tier M: Mutating & Reversible (`upload`, `update`)**\n    *   Requires **interactive confirmation** with 'Yes'\/'No' options. The\n        confirmation prompt MUST contain the exact, literal command string with\n        all required flags (e.g. `--region=us-central1`, `--project=...`,\n        `--display-name=\"...\"`) \u2014 natural-language paraphrases are NOT\n        sufficient.\n    *   **Same-turn restriction**: NEVER execute the command in the same turn as\n        receiving the request or presenting the confirmation prompt! In Turn 1,\n        you MUST ONLY present the interactive confirmation card with the exact,\n        literal command string. Stop and wait for the user's reply; only execute\n        in the subsequent turn after explicit 'Yes' \/ approval. Executing\n        `upload` or `update` in Turn 1 without prior confirmation is strictly\n        prohibited.\n    *   **Mid-flow parameter changes \/ rejection**: If the user rejects the\n        prompt or changes any parameters (e.g., display name, description,\n        parent model), do NOT execute the old command. Adapt immediately and\n        present a NEW confirmation prompt with the updated literal command and\n        wait for approval.\n3.  **Tier D: Destructive & Irreversible (`delete`)**\n    *   Requires **explicit typed confirmation** (e.g. \"I confirm\" or \"Yes,\n        delete it\"). Ask for confirmation IMMEDIATELY \u2014 before any pre-flight\n        checks (don't check if the model is deployed to endpoints first).\n    *   **Same-turn restriction**: NEVER execute in the same turn as asking for\n        typed confirmation. Wait for the user to reply in a new turn.\n    *   **Mid-flow target changes**: If the user changes their mind (e.g.,\n        \"delete the second model instead\"), do NOT delete the first model.\n        Present a fresh typed confirmation prompt for the newly selected model\n        ID and wait for approval.\n4.  **Cost Estimation**: Model Registry operations manage catalog metadata and\n    stored model artifacts without provisioning serving compute or endpoints. Do\n    NOT call the `estimate_cost` tool for Model Registry actions, as\n    `estimate_cost` is designed for serving infrastructure (endpoints\/batch\n    prediction) and will return an error if called for registry operations. If\n    including cost in the preview card, state that Model Registry operations\n    incur no serving compute charges ($0.00 compute charges; standard Cloud\n    Storage pricing applies to model artifacts).\n\n## Phase 0: Environment Setup & Parameter Resolution\n\n**CRITICAL**: Before running any commands, verify that all necessary parameters\nare known:\n\n1.  **Missing Region or Project**: Follow the base environment grounding policy:\n    if a session location or project is already set from prior turns, reuse it\n    without re-asking. If missing from both prompt and session context, at most\n    one direct lookup is permitted (e.g. `gcloud config get project` or `gcloud\n    config get compute\/region`). If the user refers to \"my project\" or their\n    configured environment and `compute\/region` is `(unset)`, fall back to\n    `us-central1` per base environment grounding; otherwise, if the region is\n    still unresolved, pause and explicitly ask the user for the missing\n    parameter before executing regional commands.\n2.  **Missing Model ID**: If the user asks to update or describe a model without\n    providing the model ID, pause and ask the user for the model ID, or offer to\n    list models first to help them find it.\n3.  **Placeholder Substitution**: If the user's requested display name contains\n    a placeholder token (e.g., `<unique-suffix>`, `[suffix]`, or `<timestamp>`),\n    generate a short unique alphanumeric string or timestamp and substitute it\n    cleanly. Never pass unexpanded literal placeholder tokens to the API.\n4.  **Region and Project Flags**: Always pass `--region=$LOCATION_ID` and\n    `--project=$PROJECT_ID` explicitly on all `gcloud ai models` commands. Do\n    NOT use `global`.\n\n## 1. Listing Models (Tier R)\n\nUse this command to discover existing models in the registry and retrieve their\nnumeric IDs. No confirmation is required.\n\nAlways pass `--limit`. A project can hold thousands of models, and an unbounded\nlist pages through every one of them, which can take over a minute and return\nhundreds of KB of output. Results come back most recently updated first, so\n`--limit=50` returns the newest models in a few seconds.\n\n```bash\ngcloud ai models list \\\n    --region=$LOCATION_ID \\\n    --project=$PROJECT_ID \\\n    --limit=50\n```\n\n*   Keep `--limit=50` when the user asks to list \"all\" models, and say the reply\n    shows the 50 most recently updated models. Do NOT page through the whole\n    registry (with gcloud or `Model.list()`) unless the user asks for a count or\n    the complete inventory; offer to look up a specific model by display name\n    instead.\n*   If the user pushes back and asks for the complete inventory, drop `--limit`\n    and print one compact line per model with\n    `--format=\"value(name.basename(),displayName)\"`. Warn that this can take a\n    minute or more in a large project.\n*   If the user asks how many models there are, count the IDs without printing\n    the list. There is no count API, so this still pages through every model\n    (about a minute per 1,500 models); tell the user it may take a while. Do not\n    run a `--limit` list first.\n\n    ```bash\n    gcloud ai models list \\\n        --region=$LOCATION_ID \\\n        --project=$PROJECT_ID \\\n        --format=\"value(name)\" | wc -l\n    ```\n*   Do NOT use `--filter` or `--sort-by` to narrow the list. gcloud applies both\n    client-side after fetching every page, so they are as slow as an unbounded\n    list.\n*   To find a model by display name (e.g. to confirm an upload or deletion),\n    filter on the server with the Python SDK:\n\n```bash\npython3 - <<'PY'\nfrom google.cloud import aiplatform\n\naiplatform.init(project='<PROJECT_ID>', location='<LOCATION_ID>')\nfor m in aiplatform.Model.list(filter='display_name=\"<DISPLAY_NAME>\"'):\n    print(m.name, m.display_name, m.create_time)\nPY\n```\n\n## 2. Describing a Model (Tier R)\n\nRetrieve the full metadata for a specific model or version. No confirmation is\nrequired.\n\n```bash\ngcloud ai models describe $MODEL_ID \\\n    --region=$LOCATION_ID \\\n    --project=$PROJECT_ID\n```\n\nTo target a specific version:\n\n```bash\ngcloud ai models describe ${MODEL_ID}@${VERSION_ID} \\\n    --region=$LOCATION_ID \\\n    --project=$PROJECT_ID\n```\n\n## 3. Uploading a Model (Tier M)\n\nRegister a new model or a new version of an existing model. This is a\nlong-running operation. **Action requires an inline confirmation card before\nproceeding.**\n\n### Example: Uploading a Custom Model\n\n```bash\ngcloud ai models upload \\\n    --region=$LOCATION_ID \\\n    --project=$PROJECT_ID \\\n    --display-name=\"<DISPLAY_NAME>\" \\\n    --container-image-uri=\"<CONTAINER_IMAGE_URI>\" \\\n    [--artifact-uri=\"<ARTIFACT_URI>\"]\n```\n\n> [!IMPORTANT]\n>\n> This is a Tier M operation \u2014 see [Safety & Confirmation Tiers] above.\n>\n> -   If the user specifies \"with no artifact URI\", omit `--artifact-uri`.\n> -   If registering a new version of an existing model, include\n>     `--parent-model=$PARENT_MODEL_ID`.\n> -   Substitute `<DISPLAY_NAME>` with the exact name requested by the user.\n\n## 4. Updating a Model (Tier M)\n\nUpdate metadata fields like display name or description. Note that `gcloud ai\nmodels` does NOT have an `update` subcommand. Instead, model metadata updates\nMUST be executed using the Vertex AI Python SDK\n(`google.cloud.aiplatform.Model`).\n\n**Action requires an inline confirmation card containing the exact script before\nproceeding.**\n\n```bash\npython3 -c \"\nfrom google.cloud import aiplatform\n\naiplatform.init(project='$PROJECT_ID', location='$LOCATION_ID')\nmodel = aiplatform.Model('$MODEL_ID')\nmodel.update(display_name='<NEW_DISPLAY_NAME>', description='<NEW_DESCRIPTION>')\nprint(f'Successfully updated model: {model.resource_name}')\n\"\n```\n\n> [!IMPORTANT]\n>\n> This is a Tier M operation \u2014 see [Safety & Confirmation Tiers] above.\n>\n> -   If only updating the display name, pass\n>     `model.update(display_name='<NEW_DISPLAY_NAME>')`.\n> -   If only updating the description, pass\n>     `model.update(description='<NEW_DESCRIPTION>')`.\n> -   The confirmation card MUST display the exact python command snippet above.\n>     NEVER execute in Turn 1; wait for explicit user approval.\n\n## 5. Deleting a Model (Tier D)\n\nPermanently delete a Model and all its versions. **Action requires explicit\ntyped confirmation before proceeding.**\n\n```bash\ngcloud ai models delete $MODEL_ID \\\n    --region=$LOCATION_ID \\\n    --project=$PROJECT_ID\n```\n\n> [!WARNING]\n>\n> This operation is irreversible. All model versions must be undeployed from all\n> Endpoints before deletion.\n\n## 6. Searching Publisher Models (Tier R)\n\nBefore generating interactive model details, you MUST verify the `model_id` by\nsearching Model Garden Publisher Models. No confirmation is required.\n\nUse the `gcloud ai` CLI to search for matching publisher models.\n\n```bash\ngcloud ai model-garden models list --model-filter=\"<model_name_or_query>\" --full-resource-name --format=json\n```\n\nThis will return a list of matching models. Extract the exact `name` field from\nthe result (e.g., `publishers\/google\/models\/gemma2` or\n`publishers\/qwen\/models\/qwen3-coder`) to use as the verified `model_id`.\n","use_cases":["List all models in a project to find the numeric ID of a specific model.","Describe a model to retrieve its full metadata, including versions and display name.","Upload a new model or update an existing model's metadata."],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/google\/skills\/blob\/e3c591afe426ea585e4c21799e5199d6d47cd1be\/skills\/cloud\/agent-platform-model-registry\/SKILL.md","source_commit":"e3c591afe426ea585e4c21799e5199d6d47cd1be","license":null,"version":null,"listing_approved_at":"2026-11-16","created_at":"2026-11-16T07:29:20.000000Z","updated_at":"2026-11-16T10:49:37.000000Z","seo_title":"Manage Agent Platform Models","seo_description":"Use commands to list, describe, upload, update, and delete machine learning models in the Agent Platform Model Registry.","seo_keywords":["manage agent platform models","list agent platform models","describe agent platform model","upload model to registry","update model metadata"]}}