Skip to content

Commit 7e791c0

Browse files
Google APIscopybara-github
authored andcommitted
feat: add Model Garden deploy API
PiperOrigin-RevId: 729261558
1 parent 2a8bb82 commit 7e791c0

1 file changed

Lines changed: 168 additions & 0 deletions

File tree

‎google/cloud/aiplatform/v1beta1/model_garden_service.proto‎

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import "google/api/client.proto";
2121
import "google/api/field_behavior.proto";
2222
import "google/api/resource.proto";
2323
import "google/cloud/aiplatform/v1beta1/machine_resources.proto";
24+
import "google/cloud/aiplatform/v1beta1/model.proto";
2425
import "google/cloud/aiplatform/v1beta1/operation.proto";
2526
import "google/cloud/aiplatform/v1beta1/publisher_model.proto";
2627
import "google/longrunning/operations.proto";
@@ -56,6 +57,18 @@ service ModelGardenService {
5657
option (google.api.method_signature) = "parent";
5758
}
5859

60+
// Deploys a model to a new endpoint.
61+
rpc Deploy(DeployRequest) returns (google.longrunning.Operation) {
62+
option (google.api.http) = {
63+
post: "/v1beta1/{destination=projects/*/locations/*}:deploy"
64+
body: "*"
65+
};
66+
option (google.longrunning.operation_info) = {
67+
response_type: "DeployResponse"
68+
metadata_type: "DeployOperationMetadata"
69+
};
70+
}
71+
5972
// Deploys publisher models.
6073
rpc DeployPublisherModel(DeployPublisherModelRequest)
6174
returns (google.longrunning.Operation) {
@@ -162,6 +175,101 @@ message ListPublisherModelsResponse {
162175
string next_page_token = 2;
163176
}
164177

178+
// Request message for
179+
// [ModelGardenService.Deploy][google.cloud.aiplatform.v1beta1.ModelGardenService.Deploy].
180+
message DeployRequest {
181+
// The model config to use for the deployment.
182+
message ModelConfig {
183+
// Optional. Whether the user accepts the End User License Agreement (EULA)
184+
// for the model.
185+
bool accept_eula = 1 [(google.api.field_behavior) = OPTIONAL];
186+
187+
// Optional. The Hugging Face read access token used to access the model
188+
// artifacts of gated models.
189+
string hugging_face_access_token = 2
190+
[(google.api.field_behavior) = OPTIONAL];
191+
192+
// Optional. If true, the model will deploy with a cached version instead of
193+
// directly downloading the model artifacts from Hugging Face. This is
194+
// suitable for VPC-SC users with limited internet access.
195+
bool hugging_face_cache_enabled = 3
196+
[(google.api.field_behavior) = OPTIONAL];
197+
198+
// Optional. The user-specified display name of the uploaded model. If not
199+
// set, a default name will be used.
200+
string model_display_name = 4 [(google.api.field_behavior) = OPTIONAL];
201+
202+
// Optional. The specification of the container that is to be used when
203+
// deploying. If not set, the default container spec will be used.
204+
ModelContainerSpec container_spec = 5
205+
[(google.api.field_behavior) = OPTIONAL];
206+
}
207+
208+
// The endpoint config to use for the deployment.
209+
message EndpointConfig {
210+
// Optional. The user-specified display name of the endpoint. If not set, a
211+
// default name will be used.
212+
string endpoint_display_name = 1 [(google.api.field_behavior) = OPTIONAL];
213+
214+
// Optional. If true, the endpoint will be exposed through a dedicated
215+
// DNS [Endpoint.dedicated_endpoint_dns]. Your request to the dedicated DNS
216+
// will be isolated from other users' traffic and will have better
217+
// performance and reliability. Note: Once you enabled dedicated endpoint,
218+
// you won't be able to send request to the shared DNS
219+
// {region}-aiplatform.googleapis.com. The limitations will be removed soon.
220+
bool dedicated_endpoint_enabled = 2
221+
[(google.api.field_behavior) = OPTIONAL];
222+
}
223+
224+
// The deploy config to use for the deployment.
225+
message DeployConfig {
226+
// Optional. The dedicated resources to use for the endpoint. If not set,
227+
// the default resources will be used.
228+
DedicatedResources dedicated_resources = 1
229+
[(google.api.field_behavior) = OPTIONAL];
230+
231+
// Optional. If true, enable the QMT fast tryout feature for this model if
232+
// possible.
233+
bool fast_tryout_enabled = 2 [(google.api.field_behavior) = OPTIONAL];
234+
}
235+
236+
// The artifacts to deploy.
237+
oneof artifacts {
238+
// The Model Garden model to deploy.
239+
// Format:
240+
// `publishers/{publisher}/models/{publisher_model}@{version_id}`, or
241+
// `publishers/hf-{hugging-face-author}/models/{hugging-face-model-name}@001`.
242+
string publisher_model_name = 1 [(google.api.resource_reference) = {
243+
type: "aiplatform.googleapis.com/PublisherModel"
244+
}];
245+
246+
// The Hugging Face model to deploy.
247+
// Format: Hugging Face model ID like `google/gemma-2-2b-it`.
248+
string hugging_face_model_id = 2;
249+
}
250+
251+
// Required. The resource name of the Location to deploy the model in.
252+
// Format: `projects/{project}/locations/{location}`
253+
string destination = 4 [
254+
(google.api.field_behavior) = REQUIRED,
255+
(google.api.resource_reference) = {
256+
type: "locations.googleapis.com/Location"
257+
}
258+
];
259+
260+
// Optional. The model config to use for the deployment.
261+
// If not specified, the default model config will be used.
262+
ModelConfig model_config = 5 [(google.api.field_behavior) = OPTIONAL];
263+
264+
// Optional. The endpoint config to use for the deployment.
265+
// If not specified, the default endpoint config will be used.
266+
EndpointConfig endpoint_config = 6 [(google.api.field_behavior) = OPTIONAL];
267+
268+
// Optional. The deploy config to use for the deployment.
269+
// If not specified, the default deploy config will be used.
270+
DeployConfig deploy_config = 7 [(google.api.field_behavior) = OPTIONAL];
271+
}
272+
165273
// Request message for
166274
// [ModelGardenService.DeployPublisherModel][google.cloud.aiplatform.v1beta1.ModelGardenService.DeployPublisherModel].
167275
message DeployPublisherModelRequest {
@@ -203,6 +311,39 @@ message DeployPublisherModelRequest {
203311
bool accept_eula = 7 [(google.api.field_behavior) = OPTIONAL];
204312
}
205313

314+
// Response message for
315+
// [ModelGardenService.Deploy][google.cloud.aiplatform.v1beta1.ModelGardenService.Deploy].
316+
message DeployResponse {
317+
// Output only. The name of the PublisherModel resource.
318+
// Format:
319+
// `publishers/{publisher}/models/{publisher_model}@{version_id}`, or
320+
// `publishers/hf-{hugging-face-author}/models/{hugging-face-model-name}@001`
321+
string publisher_model = 1 [
322+
(google.api.field_behavior) = OUTPUT_ONLY,
323+
(google.api.resource_reference) = {
324+
type: "aiplatform.googleapis.com/PublisherModel"
325+
}
326+
];
327+
328+
// Output only. The name of the Endpoint created.
329+
// Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
330+
string endpoint = 2 [
331+
(google.api.field_behavior) = OUTPUT_ONLY,
332+
(google.api.resource_reference) = {
333+
type: "aiplatform.googleapis.com/Endpoint"
334+
}
335+
];
336+
337+
// Output only. The name of the Model created.
338+
// Format: `projects/{project}/locations/{location}/models/{model}`
339+
string model = 3 [
340+
(google.api.field_behavior) = OUTPUT_ONLY,
341+
(google.api.resource_reference) = {
342+
type: "aiplatform.googleapis.com/Model"
343+
}
344+
];
345+
}
346+
206347
// Response message for
207348
// [ModelGardenService.DeployPublisherModel][google.cloud.aiplatform.v1beta1.ModelGardenService.DeployPublisherModel].
208349
message DeployPublisherModelResponse {
@@ -236,6 +377,33 @@ message DeployPublisherModelResponse {
236377
];
237378
}
238379

380+
// Runtime operation information for
381+
// [ModelGardenService.Deploy][google.cloud.aiplatform.v1beta1.ModelGardenService.Deploy].
382+
message DeployOperationMetadata {
383+
// The operation generic information.
384+
GenericOperationMetadata generic_metadata = 1;
385+
386+
// Output only. The name of the model resource.
387+
string publisher_model = 2 [
388+
(google.api.field_behavior) = OUTPUT_ONLY,
389+
(google.api.resource_reference) = {
390+
type: "aiplatform.googleapis.com/PublisherModel"
391+
}
392+
];
393+
394+
// Output only. The resource name of the Location to deploy the model in.
395+
// Format: `projects/{project}/locations/{location}`
396+
string destination = 3 [
397+
(google.api.field_behavior) = OUTPUT_ONLY,
398+
(google.api.resource_reference) = {
399+
type: "locations.googleapis.com/Location"
400+
}
401+
];
402+
403+
// Output only. The project number where the deploy model request is sent.
404+
int64 project_number = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
405+
}
406+
239407
// Runtime operation information for
240408
// [ModelGardenService.DeployPublisherModel][google.cloud.aiplatform.v1beta1.ModelGardenService.DeployPublisherModel].
241409
message DeployPublisherModelOperationMetadata {

0 commit comments

Comments
 (0)