steampipe plugin install gcp

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';

Schema for gcp_vertex_ai_model

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
artifact_uritextThe path to the directory containing the Model artifact and its supporting files.
container_specjsonbThe specification of the container that is to be used when deploying this model.
create_timetimestamp with time zoneTimestamp when this Model was uploaded into Vertex AI.
deployed_modelsjsonbThe pointers to DeployedModels created from this Model.
descriptiontextThe description of the Model.
display_nametextThe display name of the Model.
encryption_specjsonbCustomer-managed encryption key spec for a Model.
etagtextUsed to perform consistent read-modify-write updates.
explanation_specjsonbThe default explanation specification for this Model.
labelsjsonbThe labels with user-defined metadata to organize your Models.
locationtextThe GCP multi-region, region, or zone in which the resource is located.
metadatajsonbAn additional information about the model; the schema of the metadata can be found in metadata_schema_uri, immutable.
metadata_artifacttextThe resource name of the Artifact that was created in MetadataStore when creating the model.
metadata_schema_uritextPoints to a YAML file stored on Google Cloud Storage describing additional information about the model.
model_source_infojsonbSource of a model.
nametext=The resource name of the Model.
original_model_infojsonbIf this model is a copy of another model, this contains info about the original.
pipeline_jobtextPopulated if the model is produced by a pipeline job.
predict_schematajsonbThe schemata that describe formats of the model's predictions and explanations.
projecttext=, !=, ~~, ~~*, !~~, !~~*The GCP Project in which the resource is located.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
supported_deployment_resources_typesjsonbThe configuration types this model supports for deployment.
supported_export_formatsjsonbThe formats in which this model may be exported. If empty, this model is not available for export.
supported_input_storage_formatsjsonbThe formats this Model supports in BatchPredictionJob.input_config.
supported_output_storage_formatsjsonbThe formats this Model supports in BatchPredictionJob.output_config.
tagsjsonbA map of tags for the resource.
titletextTitle of the resource.
training_pipelinetextThe resource name of the TrainingPipeline that uploaded this model, if any.
update_timetimestamp with time zoneTimestamp when this Model was most recently updated.
version_aliasesjsonbUser provided version aliases so that a model version can be referenced via alias.
version_create_timetimestamp with time zoneTimestamp when this version was created.
version_descriptiontextThe description of this version.
version_idtextThe version ID of the model.
version_update_timetimestamp with time zoneTimestamp when this version was most recently updated.

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- gcp

You can pass the configuration to the command with the --config argument:

steampipe_export_gcp --config '<your_config>' gcp_vertex_ai_model