How to Manage Models in Agent Platform Using Model Registry Skills: The Complete Guide

Models in Agent Platform are managed as Skills through a unified Model Registry that supports create, list, retrieve, update, and delete operations via REST-based API calls.

Below is a hands-on guide to how to manage models in Agent Platform using model registry skills, drawn directly from the google/skills source code. The approach treats every trained model as a Skill, leveraging the same Skill Registry Service used for other agent-platform artifacts. This eliminates separate storage handling and lets downstream inference components reference models by skill_id alone.

Core Architecture of the Model Registry

The registry stores each model as a zipped filesystem bundle with attached metadata (display name, description, version, tags). The key components include:

Prerequisites: Authentication and Permissions

All operations require a Google Cloud IAM token with aiplatform.models permissions. The helper scripts obtain this automatically via google.auth.default().

Ensure your environment has:

gcloud auth application-default login

CRUD Operations: Managing Models as Skills

Upload a New Model

Use the skill_registry_ops CLI to register a model directory:

python -m skills.cloud.agent-platform-skill-registry.scripts.skill_registry_ops \
  upload \
  --project my-gcp-project \
  --location us-central1 \
  --skill-id my_model_v1 \
  --display-name "My Model v1" \
  --description "First version of my model" \
  --folder ./my_model/

What happens internally:

  1. get_access_token() obtains an OAuth token.
  2. zip_folder() builds a ZIP of ./my_model/ and base-64-encodes it.
  3. A POST request is sent to https://us-central1-aiplatform.googleapis.com/v1beta1/projects/.../skills?skillId=my_model_v1.

Python wrapper alternative:

import subprocess
import shlex

cmd = """
python -m skills.cloud.agent-platform-skill-registry.scripts.skill_registry_ops \
  upload \
  --project my-gcp-project \
  --location us-central1 \
  --skill-id my_model_v1 \
  --display-name "My Model v1" \
  --description "First version of my model" \
  --folder ./my_model/
"""
subprocess.run(shlex.split(cmd), check=True)

List All Registered Models

python -m skills.cloud.agent-platform-skill-registry.scripts.skill_registry_ops \
  list_skills \
  --project my-gcp-project \
  --location us-central1

Filter output by naming convention (e.g., *_model_*) to isolate model entries from other Skill types.

Retrieve a Specific Model

python -m skills.cloud.agent-platform-skill-registry.scripts.skill_registry_ops \
  get_skill \
  --project my-gcp-project \
  --location us-central1 \
  --skill-id my_model_v1

The response includes zippedFilesystem (base-64 string) and metadata. Decode the payload to restore model files locally.

Update an Existing Model

python -m skills.cloud.agent-platform-skill-registry.scripts.skill_registry_ops \
  update_skill \
  --project my-gcp-project \
  --location us-central1 \
  --skill-id my_model_v1 \
  --folder ./my_model_v2/ \
  --description "Updated to v2 with better accuracy"

The script constructs an updateMask automatically—only passed fields are patched.

Delete a Model

python -m skills.cloud.agent-platform-skill-registry.scripts.skill_registry_ops \
  delete_skill \
  --project my-gcp-project \
  --location us-central1 \
  --skill-id my_model_v1

Deletion is permanent. The Skill Registry removes both metadata and stored artifact.

Consuming Registered Models in Inference Pipelines

Once a model is registered, inference SDKs fetch it by skill_id without manual storage handling.

Vertex AI Inference

from skills.cloud.agent_platform_inference.scripts.openmaas_vertexai_sdk import VertexAIModel

model = VertexAIModel(
    project="my-gcp-project",
    location="us-central1",
    skill_id="my_model_v1"
)

prediction = model.predict(input_data)
print(prediction)

The VertexAIModel class internally calls get_skill, unpacks the model, and forwards requests to Vertex AI's prediction service.

Other Inference Backends

SDK File Path Use Case
OpenAI-compatible openmaas_openai_sdk.py OpenAI API-compatible endpoints
Gemini-specific gemini_vertexai_sdk.py Google's Gemini model serving

Integration with Training Pipelines

The tune_open_model.py script demonstrates the full lifecycle: training a model, packaging it, and pushing to the registry. Key pattern from the source:


# After training completes

# 1. Save model to local directory

# 2. Call skill_registry_ops upload with generated skill_id

# 3. Log resulting skill_id for downstream pipelines

This ensures reproducibility—every trained model receives a versioned, discoverable identifier.

Summary

  • Models are Skills — The Model Registry reuses the Skill Registry Service, giving models the same CRUD, versioning, and security features as other agent-platform artifacts.
  • Unified CLIskill_registry_ops.py provides upload, list_skills, get_skill, update_skill, and delete_skill commands.
  • Automatic packaging — Model directories are zipped and base-64-encoded; metadata is stored alongside.
  • Seamless inference — SDKs like VertexAIModel fetch and serve registered models by skill_id alone.
  • Integrated training — Tuning scripts push results directly to the registry, closing the MLOps loop.

Frequently Asked Questions

What model formats does the registry support?

The Skill Registry treats the model as opaque bytes—any format works. Common patterns in google/skills include TensorFlow SavedModel directories, PyTorch .pt files, and custom ZIP archives. The inference SDK consuming the model must know how to interpret the format.

How does versioning work for model skills?

Each skill_id is unique. For versioning, use descriptive IDs like my_model_v1, my_model_v2, or append timestamps. The update_skill command patches existing entries, but many workflows prefer immutable versions with new skill_ids for reproducibility.

Can I use the registry outside Google Cloud?

The registry itself is a regional Google Cloud service (aiplatform.googleapis.com). However, once fetched, models can run anywhere—the inference SDKs download the artifact locally before prediction. For multi-cloud deployments, fetch via get_skill and extract the zippedFilesystem payload.

What permissions are required for model registry operations?

Your IAM principal needs aiplatform.models permissions. The scripts handle token acquisition via google.auth.default(), but the underlying identity must have appropriate roles (e.g., roles/aiplatform.user or custom roles with aiplatform.models.* access).

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →