Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Obtén información sobre cómo borrar un modelo que ya no necesitas de Vertex AI Model Registry.
Si deseas borrar un AA de BigQuery de Vertex AI Model Registry, primero debes borrarlo de BigQuery ML. Para obtener más información, consulta BigQuery ML y Vertex AI Model Registry.
Si deseas borrar un modelo que está implementado en un extremo, primero debes anular su implementación. De lo contrario, no podrás borrar el modelo.
Borra un modelo
Console
Ve a la página Model Registry desde la sección Vertex AI en la Google Cloud consola.
Borra un modelo con el SDK de Vertex AI para Python.
Python
fromgoogle.cloudimportaiplatformdefdelete_model_sample(model_id:str,project:str,location:str):""" Delete a Model resource. Args: model_id: The ID of the model to delete. Parent resource name of the model is also accepted. project: The project. location: The region name. Returns None. """# Initialize the client.aiplatform.init(project=project,location=location)# Get the model with the ID 'model_id'. The parent_name of Model resource can be also# 'projects/<your-project-id>/locations/<your-region>/models/<your-model-id>'model=aiplatform.Model(model_name=model_id)# Delete the model.model.delete()
Borra una versión del modelo
Console
Ve a la página Model Registry desde la sección Vertex AI en la Google Cloud consola.
fromgoogle.cloudimportaiplatformdefdelete_model_version_sample(model_id:str,version_id:str,project:str,location:str):""" Delete a Model version. Args: model_id: The ID of the model to delete. Parent resource name of the model is also accepted. version_id: The version ID or version alias of the model to delete. project: The project ID. location: The region name. Returns None. """# Initialize the client.aiplatform.init(project=project,location=location)# Initialize the Model Registry resource with the ID 'model_id'.The parent_name of Model resource can be also# 'projects/<your-project-id>/locations/<your-region>/models/<your-model-id>'model_registry=aiplatform.models.ModelRegistry(model=model_id)# Delete the model version with the version 'version'.model_registry.delete_version(version=version_id)
Borra una versión de modelo con el alias predeterminado
Console
En Model Registry, selecciona el nombre del modelo para ver sus versiones.
Selecciona la versión que desees y, en el botón Acciones, haz clic en el botón more_vertBorrar.
Se abrirá una advertencia, ya que intentas borrar la versión predeterminada del alias. Primero debes establecer otra versión como predeterminada.
En el menú desplegable, selecciona qué versión quieres establecer como predeterminada para el modelo.
En la pantalla de confirmación, haz clic en Establecer y borrar.
API
Python
fromtypingimportListfromgoogle.cloudimportaiplatformdefdelete_aliases_model_version_sample(model_id:str,version_aliases:List[str],version_id:str,project:str,location:str,):""" Delete aliases to a model version. Args: model_id: The ID of the model. version_aliases: The version aliases to assign. version_id: The version ID of the model to assign the aliases to. project: The project ID. location: The region name. Returns None. """# Initialize the client.aiplatform.init(project=project,location=location)# Initialize the Model Registry resource with the ID 'model_id'.The parent_name of Model resource can be also# 'projects/<your-project-id>/locations/<your-region>/models/<your-model-id>'model_registry=aiplatform.models.ModelRegistry(model=model_id)# Remove the version aliases to the model version with the version 'version'.model_registry.remove_version_aliases(target_aliases=version_aliases,version=version_id)
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-04 (UTC)"],[],[],null,["# Delete a model from Vertex AI Model Registry\n\nLearn how to delete a model you no longer need from the Vertex AI Model Registry.\n\nIf you want to delete a BigQuery ML from Vertex AI Model Registry,\nyou must first delete it from BigQuery ML. To learn more,\nsee [BigQuery ML and Vertex AI Model Registry](/bigquery-ml/docs/managing-models-vertex).\n\nIf you want to delete a model that is deployed to an endpoint, you\nneed to undeploy it first. Otherwise, you are unable to delete the model.\n\nDelete a model\n--------------\n\n### Console\n\n1. Go to the **Model Registry** page from the Vertex AI section\n in the Google Cloud console.\n\n [Go to the Model Registry page](https://console.cloud.google.com/vertex-ai/models)\n2. Select **More actions** from the model you want to delete.\n more_vert\n\n3. Select **Delete model**.\n When you delete the model, all associated model versions and evaluations are\n deleted from your Google Cloud project.\n\n4. Click **Delete** on the confirmation screen.\n\n### gcloud\n\n\nBefore using any of the command data below,\nmake the following replacements:\n\n- \u003cvar translate=\"no\"\u003eMODEL_ID\u003c/var\u003e: The ID of your model.\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your Google Cloud [project ID](/resource-manager/docs/creating-managing-projects#identifiers).\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: Your project's region. For example, `us-central1`.\n\n\nExecute the\n\nfollowing\n\ncommand:\n\n#### Linux, macOS, or Cloud Shell\n\n**Note:** Ensure you have initialized the Google Cloud CLI with authentication and a project by running either [gcloud init](/sdk/gcloud/reference/init); or [gcloud auth login](/sdk/gcloud/reference/auth/login) and [gcloud config set project](/sdk/gcloud/reference/config/set). \n\n```bash\ngcloud ai models delete MODEL_ID \\\n --project=PROJECT_ID \\\n --region=LOCATION\n```\n\n#### Windows (PowerShell)\n\n**Note:** Ensure you have initialized the Google Cloud CLI with authentication and a project by running either [gcloud init](/sdk/gcloud/reference/init); or [gcloud auth login](/sdk/gcloud/reference/auth/login) and [gcloud config set project](/sdk/gcloud/reference/config/set). \n\n```bash\ngcloud ai models delete MODEL_ID `\n --project=PROJECT_ID `\n --region=LOCATION\n```\n\n#### Windows (cmd.exe)\n\n**Note:** Ensure you have initialized the Google Cloud CLI with authentication and a project by running either [gcloud init](/sdk/gcloud/reference/init); or [gcloud auth login](/sdk/gcloud/reference/auth/login) and [gcloud config set project](/sdk/gcloud/reference/config/set). \n\n```bash\ngcloud ai models delete MODEL_ID ^\n --project=PROJECT_ID ^\n --region=LOCATION\n```\n\n\u003cbr /\u003e\n\n### API\n\n\nDelete a model using the Vertex AI SDK for Python.\n\n### Python\n\n\n from google.cloud import aiplatform\n\n\n def delete_model_sample(model_id: str, project: str, location: str):\n \"\"\"\n Delete a Model resource.\n Args:\n model_id: The ID of the model to delete. Parent resource name of the model is also accepted.\n project: The project.\n location: The region name.\n Returns\n None.\n \"\"\"\n # Initialize the client.\n aiplatform.init(project=project, location=location)\n\n # Get the model with the ID 'model_id'. The parent_name of Model resource can be also\n # 'projects/\u003cyour-project-id\u003e/locations/\u003cyour-region\u003e/models/\u003cyour-model-id\u003e'\n model = aiplatform.Model(model_name=model_id)\n\n # Delete the model.\n model.delete()\n\nDelete a model version\n----------------------\n\n### Console\n\n1. Go to the **Model Registry** page from the Vertex AI section\n in the Google Cloud console.\n\n [Go to the Model Registry page](https://console.cloud.google.com/vertex-ai/models)\n2. Expand the model to view its model versions. Select the version that you want to delete.\n\n3. Select the **More actions** from the model version.\n menu more_vert.\n\n4. Select **Delete version**. All associated model evaluations are deleted when you delete your version.\n\n### gcloud\n\n\nBefore using any of the command data below,\nmake the following replacements:\n\n- \u003cvar translate=\"no\"\u003eMODEL_VERSION_ID\u003c/var\u003e: The ID of the model version to delete.\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your Google Cloud [project ID](/resource-manager/docs/creating-managing-projects#identifiers).\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: Your project's region. For example, `us-central1`.\n\n\nExecute the\n\nfollowing\n\ncommand:\n\n#### Linux, macOS, or Cloud Shell\n\n**Note:** Ensure you have initialized the Google Cloud CLI with authentication and a project by running either [gcloud init](/sdk/gcloud/reference/init); or [gcloud auth login](/sdk/gcloud/reference/auth/login) and [gcloud config set project](/sdk/gcloud/reference/config/set). \n\n```bash\ngcloud ai models delete-version MODEL_VERSION_ID \\\n --project=PROJECT_ID \\\n --region=LOCATION\n```\n\n#### Windows (PowerShell)\n\n**Note:** Ensure you have initialized the Google Cloud CLI with authentication and a project by running either [gcloud init](/sdk/gcloud/reference/init); or [gcloud auth login](/sdk/gcloud/reference/auth/login) and [gcloud config set project](/sdk/gcloud/reference/config/set). \n\n```bash\ngcloud ai models delete-version MODEL_VERSION_ID `\n --project=PROJECT_ID `\n --region=LOCATION\n```\n\n#### Windows (cmd.exe)\n\n**Note:** Ensure you have initialized the Google Cloud CLI with authentication and a project by running either [gcloud init](/sdk/gcloud/reference/init); or [gcloud auth login](/sdk/gcloud/reference/auth/login) and [gcloud config set project](/sdk/gcloud/reference/config/set). \n\n```bash\ngcloud ai models delete-version MODEL_VERSION_ID ^\n --project=PROJECT_ID ^\n --region=LOCATION\n```\n\n\u003cbr /\u003e\n\n### API\n\n### Python\n\n\n from google.cloud import aiplatform\n\n\n def delete_model_version_sample(\n model_id: str, version_id: str, project: str, location: str\n ):\n \"\"\"\n Delete a Model version.\n Args:\n model_id: The ID of the model to delete. Parent resource name of the model is also accepted.\n version_id: The version ID or version alias of the model to delete.\n project: The project ID.\n location: The region name.\n Returns\n None.\n \"\"\"\n # Initialize the client.\n aiplatform.init(project=project, location=location)\n\n # Initialize the Model Registry resource with the ID 'model_id'.The parent_name of Model resource can be also\n # 'projects/\u003cyour-project-id\u003e/locations/\u003cyour-region\u003e/models/\u003cyour-model-id\u003e'\n model_registry = aiplatform.models.ModelRegistry(model=model_id)\n\n # Delete the model version with the version 'version'.\n model_registry.delete_version(version=version_id)\n\nDelete a model version with the default alias\n---------------------------------------------\n\n### Console\n\n1. From the Model Registry, select the model name to view its model versions.\n2. Select the version that you want, and from the **Actions** button more_vert click **Delete**. A warning opens since you're attempting to delete the default alias version. Set another version as default first.\n3. Select what version you want to make default for the model from the drop-down.\n4. On the confirmation screen, click **Set and delete.**\n\n### API\n\n### Python\n\n\n from typing import List\n\n from google.cloud import aiplatform\n\n\n def delete_aliases_model_version_sample(\n model_id: str,\n version_aliases: List[str],\n version_id: str,\n project: str,\n location: str,\n ):\n \"\"\"\n Delete aliases to a model version.\n Args:\n model_id: The ID of the model.\n version_aliases: The version aliases to assign.\n version_id: The version ID of the model to assign the aliases to.\n project: The project ID.\n location: The region name.\n Returns\n None.\n \"\"\"\n # Initialize the client.\n aiplatform.init(project=project, location=location)\n\n # Initialize the Model Registry resource with the ID 'model_id'.The parent_name of Model resource can be also\n # 'projects/\u003cyour-project-id\u003e/locations/\u003cyour-region\u003e/models/\u003cyour-model-id\u003e'\n model_registry = aiplatform.models.ModelRegistry(model=model_id)\n\n # Remove the version aliases to the model version with the version 'version'.\n model_registry.remove_version_aliases(\n target_aliases=version_aliases, version=version_id\n )"]]