Skip to main content

models

Creates, updates, deletes, gets or lists a models resource.

Overview

Namemodels
TypeResource
Idgoogle.aiplatform.models

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. The resource name of the PublisherModel.
frameworksarrayOptional. Additional information about the model's Frameworks.
launchStagestringOptional. Indicates the launch stage of the model.
openSourceCategorystringRequired. Indicates the open source category of the publisher model.
predictSchemataobjectOptional. The schemata that describes formats of the PublisherModel's predictions and explanations as given and returned via PredictionService.Predict. (id: GoogleCloudAiplatformV1PredictSchemata)
publisherModelTemplatestringOptional. Output only. Immutable. Used to indicate this model has a publisher model and provide the template of the publisher model resource name.
supportedActionsobjectOptional. Supported call-to-action options. (id: GoogleCloudAiplatformV1PublisherModelCallToAction)
versionIdstringOutput only. Immutable. The version ID of the PublisherModel. A new version is committed when a new model version is uploaded under an existing model id. It is an auto-incrementing decimal number in string representation.
versionStatestringOptional. Indicates the state of the model version.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectpublishersId, modelsIdlanguageCode, view, isHuggingFaceModel, huggingFaceTokenGets a Model Garden publisher model.
listselectprojectsId, locationsIdfilter, pageSize, pageToken, readMask, orderByLists Models in a Location.
patchupdateprojectsId, locationsId, modelsIdupdateMaskUpdates a Model.
deletedeleteprojectsId, locationsId, modelsIdDeletes a Model. A model cannot be deleted if any Endpoint resource has a DeployedModel based on the model in its deployed_models field.
uploadexecprojectsId, locationsIdUploads a Model artifact into Vertex AI.
update_explanation_datasetexecprojectsId, locationsId, modelsIdIncrementally update the dataset used for an examples model.
merge_version_aliasesexecprojectsId, locationsId, modelsIdMerges a set of aliases for a Model version.
exportexecprojectsId, locationsId, modelsIdExports a trained, exportable Model to a location specified by the user. A Model is considered to be exportable if it has at least one supported export format.
copyexecprojectsId, locationsIdCopies an already existing Vertex AI Model into the specified Location. The source Model must exist in the same Project. When copying custom Models, the users themselves are responsible for Model.metadata content to be region-agnostic, as well as making sure that any resources (e.g. files) it depends on remain accessible.
predictexecpublishersId, modelsIdPerform an online prediction.
raw_predictexecprojectsId, locationsId, publishersId, modelsIdPerform an online prediction with an arbitrary HTTP payload. The response includes the following HTTP headers: * X-Vertex-AI-Endpoint-Id: ID of the Endpoint that served this prediction. * X-Vertex-AI-Deployed-Model-Id: ID of the Endpoint's DeployedModel that served this prediction.
stream_raw_predictexecprojectsId, locationsId, publishersId, modelsIdPerform a streaming online prediction with an arbitrary HTTP payload.
server_streaming_predictexecprojectsId, locationsId, publishersId, modelsIdPerform a server-side streaming online prediction request for Vertex LLM streaming.
predict_long_runningexecpublishersId, modelsId
generate_contentexecpublishersId, modelsIdGenerate content with multimodal inputs.
stream_generate_contentexecpublishersId, modelsIdGenerate content with multimodal inputs with streaming support.
count_tokensexecpublishersId, modelsIdPerform a token counting.
compute_tokensexecpublishersId, modelsIdReturn a list of tokens based on the input text.
fetch_predict_operationexecpublishersId, modelsIdFetch an asynchronous online prediction operation.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
locationsIdstring
modelsIdstring
projectsIdstring
publishersIdstring
filterstring
huggingFaceTokenstring
isHuggingFaceModelboolean
languageCodestring
orderBystring
pageSizeinteger (int32)
pageTokenstring
readMaskstring (google-fieldmask)
updateMaskstring (google-fieldmask)
viewstring

SELECT examples

Gets a Model Garden publisher model.

SELECT
name,
frameworks,
launchStage,
openSourceCategory,
predictSchemata,
publisherModelTemplate,
supportedActions,
versionId,
versionState
FROM google.aiplatform.models
WHERE publishersId = '{{ publishersId }}' -- required
AND modelsId = '{{ modelsId }}' -- required
AND languageCode = '{{ languageCode }}'
AND view = '{{ view }}'
AND isHuggingFaceModel = '{{ isHuggingFaceModel }}'
AND huggingFaceToken = '{{ huggingFaceToken }}';

UPDATE examples

Updates a Model.

UPDATE google.aiplatform.models
SET
data__name = '{{ name }}',
data__versionAliases = '{{ versionAliases }}',
data__displayName = '{{ displayName }}',
data__description = '{{ description }}',
data__versionDescription = '{{ versionDescription }}',
data__defaultCheckpointId = '{{ defaultCheckpointId }}',
data__predictSchemata = '{{ predictSchemata }}',
data__metadataSchemaUri = '{{ metadataSchemaUri }}',
data__metadata = '{{ metadata }}',
data__pipelineJob = '{{ pipelineJob }}',
data__containerSpec = '{{ containerSpec }}',
data__artifactUri = '{{ artifactUri }}',
data__explanationSpec = '{{ explanationSpec }}',
data__etag = '{{ etag }}',
data__labels = '{{ labels }}',
data__dataStats = '{{ dataStats }}',
data__encryptionSpec = '{{ encryptionSpec }}',
data__baseModelSource = '{{ baseModelSource }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND modelsId = '{{ modelsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
artifactUri,
baseModelSource,
checkpoints,
containerSpec,
createTime,
dataStats,
defaultCheckpointId,
deployedModels,
description,
displayName,
encryptionSpec,
etag,
explanationSpec,
labels,
metadata,
metadataArtifact,
metadataSchemaUri,
modelSourceInfo,
originalModelInfo,
pipelineJob,
predictSchemata,
satisfiesPzi,
satisfiesPzs,
supportedDeploymentResourcesTypes,
supportedExportFormats,
supportedInputStorageFormats,
supportedOutputStorageFormats,
trainingPipeline,
updateTime,
versionAliases,
versionCreateTime,
versionDescription,
versionId,
versionUpdateTime;

DELETE examples

Deletes a Model. A model cannot be deleted if any Endpoint resource has a DeployedModel based on the model in its deployed_models field.

DELETE FROM google.aiplatform.models
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND modelsId = '{{ modelsId }}' --required;

Lifecycle Methods

Uploads a Model artifact into Vertex AI.

EXEC google.aiplatform.models.upload 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required
@@json=
'{
"parentModel": "{{ parentModel }}",
"modelId": "{{ modelId }}",
"model": "{{ model }}",
"serviceAccount": "{{ serviceAccount }}"
}';