Skip to content

Latest commit

 

History

History
157 lines (132 loc) · 4.8 KB

gcp_vertex_ai_model.md

File metadata and controls

157 lines (132 loc) · 4.8 KB
title description
Steampipe Table: gcp_vertex_ai_model - Query GCP Vertex AI Models using SQL
Allows users to query GCP Vertex AI Models, specifically the detailed information about each model in the Google Cloud project.

Table: gcp_vertex_ai_model - Query GCP Vertex AI Models using SQL

Google Cloud's Vertex AI is a unified ML platform for building, deploying, and scaling AI applications. It offers a suite of tools and services for data scientists and ML engineers, which includes the ability to manage models. A model in Vertex AI is a resource that represents a machine learning solution, which can be trained and deployed to serve predictions.

Table Usage Guide

The gcp_vertex_ai_model table provides insights into Vertex AI models within Google Cloud Platform. As a data scientist or ML engineer, explore model-specific details through this table, including model type, training details, and associated metadata. Utilize it to manage and monitor your AI models, such as those serving high traffic, the training data used, and the status of each model.

Examples

Basic info

Explore which AI models are active within your Google Cloud Platform, gaining insights into their creation time and associated networks. This can be particularly useful for managing and auditing your AI resources.

select
  name,
  display_name,
  create_time,
  version_id,
  container_spec,
  deployed_models
from
  gcp_vertex_ai_model;
select
  name,
  display_name,
  create_time,
  version_id,
  container_spec,
  deployed_models
from
  gcp_vertex_ai_model;

List models created in the last 30 days

Determine the areas in which new models have been established within the past month. This can be useful for tracking recent changes and developments in your AI models.

select
  name,
  display_name,
  create_time
from
  gcp_vertex_ai_model
where
  create_time >= current_date - interval '30 days';
select
  name,
  display_name,
  create_time
from
  gcp_vertex_ai_model
where
  create_time >= date('now', '-30 days');

Get the model source for the models

Determine the source of the model, whether it was imported from a TensorFlow model or a custom model, to understand the origin of the model and its compatibility with other tools and services.

select
  name,
  display_name,
  case
    when model_source_info ->> 'source_type' = '1' then 'Model Generated by AutoML'
    when model_source_info ->> 'source_type' = '2' then 'Model Imported from Custom'
    when model_source_info ->> 'source_type' = '3' then 'Model Imported from BigQuery ML'
    when model_source_info ->> 'source_type' = '4' then 'Model Saved from Model Garden'
    when model_source_info ->> 'source_type' = '5' then 'Model Saved from Genie'
    end as model_source
from
  gcp_vertex_ai_model;
select
  name,
  display_name,
  case
    when model_source_info ->> 'source_type' = '1' then 'Model Generated by AutoML'
    when model_source_info ->> 'source_type' = '2' then 'Model Imported from Custom'
    when model_source_info ->> 'source_type' = '3' then 'Model Imported from BigQuery ML'
    when model_source_info ->> 'source_type' = '4' then 'Model Saved from Model Garden'
    when model_source_info ->> 'source_type' = '5' then 'Model Saved from Genie'
  end as model_source
from
  gcp_vertex_ai_model;

List the model that is deployed to a specific endpoint

Explore models that have been deployed to a specific endpoint, gaining insights into the models serving predictions for a particular application or service.

select
  name,
  display_name,
  d ->> 'endpoint' as endpoint,
  d ->> 'deployed_model_id' as deployed_model_id
from
  gcp_vertex_ai_model,
  jsonb_array_elements(deployed_models) as d
where
  d ->> 'endpoint' = 'projects/123456789/endpoints/123456789';
select
  name,
  display_name,
  json_extract(deployed_models, '$[*].endpoint') as endpoint,
  json_extract(deployed_models, '$[*].deployed_model_id') as deployed_model_id
from
  gcp_vertex_ai_model
where
  json_extract(deployed_models, '$[*].endpoint') = 'projects/123456789/endpoints/123456789';

List models that support 'csv' format for input storage

Explore models that support 'csv' format for input storage, gaining insights into the models that can process data in this format. This can be useful for managing and optimizing your data processing pipelines.

select
  name,
  display_name,
  supported_input_storage_formats
from
  gcp_vertex_ai_model
where
  supported_input_storage_formats ? 'csv';
select
  name,
  display_name,
  json_extract(supported_input_storage_formats, '$.csv') as supported_input_storage_formats
from
  gcp_vertex_ai_model
where
  json_type(supported_input_storage_formats, '$.csv') = 'string';