Method: locations.deploy

Full name: projects.locations.deploy

Deploys a model to a new endpoint.

Endpoint

posthttps://{service-endpoint}/v1/{destination}:deploy

Where{service-endpoint} is one of thesupported service endpoints.

Path parameters

destinationstring

Required. The resource name of the Location to deploy the model in. Format:projects/{project}/locations/{location}

Request body

The request body contains data with the following structure:

Fields
modelConfigobject (ModelConfig)

Optional. The model config to use for the deployment. If not specified, the default model config will be used.

endpointConfigobject (EndpointConfig)

Optional. The endpoint config to use for the deployment. If not specified, the default endpoint config will be used.

deployConfigobject (DeployConfig)

Optional. The deploy config to use for the deployment. If not specified, the default deploy config will be used.

artifactsUnion type
The artifacts to deploy.artifacts can be only one of the following:
publisherModelNamestring

The Model Garden model to deploy. Format:publishers/{publisher}/models/{publisherModel}@{versionId}, orpublishers/hf-{hugging-face-author}/models/{hugging-face-model-name}@001.

huggingFaceModelIdstring

The Hugging Face model to deploy. Format: Hugging Face model id likegoogle/gemma-2-2b-it.

Response body

If successful, the response body contains an instance ofOperation.

ModelConfig

The model config to use for the deployment.

Fields
acceptEulaboolean

Optional. Whether the user accepts the End user License Agreement (EULA) for the model.

huggingFaceAccessTokenstring

Optional. The Hugging Face read access token used to access the model artifacts of gated models.

huggingFaceCacheEnabledboolean

Optional. If true, the model will deploy with a cached version instead of directly downloading the model artifacts from Hugging Face. This is suitable for VPC-SC users with limited internet access.

modelDisplayNamestring

Optional. The user-specified display name of the uploaded model. If not set, a default name will be used.

containerSpecobject (ModelContainerSpec)

Optional. The specification of the container that is to be used when deploying. If not set, the default container spec will be used.

modelUserIdstring

Optional. The id to use for the uploaded Model, which will become the final component of the model resource name. When not provided, Vertex AI will generate a value for this id. When Model Registry model is provided, this field will be ignored.

This value may be up to 63 characters, and valid characters are[a-z0-9_-]. The first character cannot be a number or hyphen.

JSON representation
{"acceptEula":boolean,"huggingFaceAccessToken":string,"huggingFaceCacheEnabled":boolean,"modelDisplayName":string,"containerSpec":{object (ModelContainerSpec)},"modelUserId":string}

EndpointConfig

The endpoint config to use for the deployment.

Fields
endpointDisplayNamestring

Optional. The user-specified display name of the endpoint. If not set, a default name will be used.

Optional. Configuration for private service connect. If set, the endpoint will be exposed through private service connect.

labelsmap (key: string, value: string)

Optional. The labels with user-defined metadata to organize your endpoints.

label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed.

Seehttps://goo.gl/xmQnxf for more information and examples of labels.

endpointUserIdstring

Optional. Immutable. The id to use for endpoint, which will become the final component of the endpoint resource name. If not provided, Vertex AI will generate a value for this id.

If the first character is a letter, this value may be up to 63 characters, and valid characters are[a-z0-9-]. The last character must be a letter or number.

If the first character is a number, this value may be up to 9 characters, and valid characters are[0-9] with no leading zeros.

When using HTTP/JSON, this field is populated based on a query string argument, such as?endpointId=12345. This is the fallback for fields that are not included in either the URI or the body.

JSON representation
{"endpointDisplayName":string,"dedicatedEndpointEnabled":boolean,"dedicatedEndpointDisabled":boolean,"privateServiceConnectConfig":{object (PrivateServiceConnectConfig)},"labels":{string:string,...},"endpointUserId":string}

DeployConfig

The deploy config to use for the deployment.

Fields
dedicatedResourcesobject (DedicatedResources)

Optional. The dedicated resources to use for the endpoint. If not set, the default resources will be used.

fastTryoutEnabledboolean

Optional. If true, enable the QMT fast tryout feature for this model if possible.

systemLabelsmap (key: string, value: string)

Optional. System labels for Model Garden deployments. These labels are managed by Google and for tracking purposes only.

JSON representation
{"dedicatedResources":{object (DedicatedResources)},"fastTryoutEnabled":boolean,"systemLabels":{string:string,...}}

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-09-25 UTC.