Skip to content

Commit c08fbfa

Browse files
Google APIscopybara-github
authored andcommitted
feat: add a ExportPublisherModel API
PiperOrigin-RevId: 738854222
1 parent 9af2768 commit c08fbfa

2 files changed

Lines changed: 60 additions & 0 deletions

File tree

google/cloud/aiplatform/v1beta1/aiplatform_v1beta1.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ types:
9191
- name: google.cloud.aiplatform.v1beta1.ExportFeatureValuesResponse
9292
- name: google.cloud.aiplatform.v1beta1.ExportModelOperationMetadata
9393
- name: google.cloud.aiplatform.v1beta1.ExportModelResponse
94+
- name: google.cloud.aiplatform.v1beta1.ExportPublisherModelOperationMetadata
95+
- name: google.cloud.aiplatform.v1beta1.ExportPublisherModelResponse
9496
- name: google.cloud.aiplatform.v1beta1.Feature
9597
- name: google.cloud.aiplatform.v1beta1.FeatureGroup
9698
- name: google.cloud.aiplatform.v1beta1.FeatureOnlineStore

google/cloud/aiplatform/v1beta1/model_garden_service.proto

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import "google/api/annotations.proto";
2020
import "google/api/client.proto";
2121
import "google/api/field_behavior.proto";
2222
import "google/api/resource.proto";
23+
import "google/cloud/aiplatform/v1beta1/io.proto";
2324
import "google/cloud/aiplatform/v1beta1/machine_resources.proto";
2425
import "google/cloud/aiplatform/v1beta1/model.proto";
2526
import "google/cloud/aiplatform/v1beta1/operation.proto";
@@ -82,6 +83,19 @@ service ModelGardenService {
8283
metadata_type: "DeployPublisherModelOperationMetadata"
8384
};
8485
}
86+
87+
// Exports a publisher model to a user provided Google Cloud Storage bucket.
88+
rpc ExportPublisherModel(ExportPublisherModelRequest)
89+
returns (google.longrunning.Operation) {
90+
option (google.api.http) = {
91+
post: "/v1beta1/{parent=projects/*/locations/*}/{name=publishers/*/models/*}:export"
92+
body: "*"
93+
};
94+
option (google.longrunning.operation_info) = {
95+
response_type: "ExportPublisherModelResponse"
96+
metadata_type: "ExportPublisherModelOperationMetadata"
97+
};
98+
}
8599
}
86100

87101
// View enumeration of PublisherModel.
@@ -414,6 +428,9 @@ message DeployOperationMetadata {
414428

415429
// Output only. The project number where the deploy model request is sent.
416430
int64 project_number = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
431+
432+
// Output only. The model id to be used at query time.
433+
string model_id = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
417434
}
418435

419436
// Runtime operation information for
@@ -447,3 +464,44 @@ message DeployPublisherModelOperationMetadata {
447464
// Output only. The project number where the deploy model request is sent.
448465
int64 project_number = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
449466
}
467+
468+
// Response message for
469+
// [ModelGardenService.ExportPublisherModel][google.cloud.aiplatform.v1beta1.ModelGardenService.ExportPublisherModel].
470+
message ExportPublisherModelResponse {
471+
// The name of the PublisherModel resource.
472+
// Format:
473+
// `publishers/{publisher}/models/{publisher_model}@{version_id}`
474+
string publisher_model = 1;
475+
476+
// The destination uri of the model weights.
477+
string destination_uri = 2;
478+
}
479+
480+
// Runtime operation information for
481+
// [ModelGardenService.ExportPublisherModel][google.cloud.aiplatform.v1beta1.ModelGardenService.ExportPublisherModel].
482+
message ExportPublisherModelOperationMetadata {
483+
// The operation generic information.
484+
GenericOperationMetadata generic_metadata = 1;
485+
}
486+
487+
// Request message for
488+
// [ModelGardenService.ExportPublisherModel][google.cloud.aiplatform.v1beta1.ModelGardenService.ExportPublisherModel].
489+
message ExportPublisherModelRequest {
490+
// Required. The name of the PublisherModel resource.
491+
// Format:
492+
// `publishers/{publisher}/models/{publisher_model}@{version_id}`, or
493+
// `publishers/hf-{hugging-face-author}/models/{hugging-face-model-name}@001`
494+
string name = 1 [(google.api.field_behavior) = REQUIRED];
495+
496+
// Required. The target where we are exporting the model weights to
497+
GcsDestination destination = 2 [(google.api.field_behavior) = REQUIRED];
498+
499+
// Required. The Location to export the model weights from
500+
// Format: `projects/{project}/locations/{location}`
501+
string parent = 3 [
502+
(google.api.field_behavior) = REQUIRED,
503+
(google.api.resource_reference) = {
504+
type: "locations.googleapis.com/Location"
505+
}
506+
];
507+
}

0 commit comments

Comments
 (0)