diff --git a/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto b/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto index cc44a829f9..124db6e52e 100644 --- a/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto +++ b/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto @@ -20,7 +20,10 @@ import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/io.proto"; +import "google/cloud/aiplatform/v1beta1/operation.proto"; import "google/cloud/aiplatform/v1beta1/tuning_job.proto"; +import "google/longrunning/operations.proto"; import "google/protobuf/empty.proto"; option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; @@ -82,6 +85,22 @@ service GenAiTuningService { }; option (google.api.method_signature) = "name"; } + + // Rebase a TunedModel. + // Creates a LongRunningOperation that takes a legacy Tuned GenAI model + // Reference and creates a TuningJob based on newly available model. + rpc RebaseTunedModel(RebaseTunedModelRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/tuningJobs:rebaseTunedModel" + body: "*" + }; + option (google.api.method_signature) = "parent,tuned_model_ref"; + option (google.longrunning.operation_info) = { + response_type: "TuningJob" + metadata_type: "RebaseTunedModelOperationMetadata" + }; + } } // Request message for @@ -162,3 +181,39 @@ message CancelTuningJobRequest { } ]; } + +// Request message for +// [GenAiTuningService.RebaseTunedModel][google.cloud.aiplatform.v1beta1.GenAiTuningService.RebaseTunedModel]. +message RebaseTunedModelRequest { + // Required. The resource name of the Location into which to rebase the Model. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. TunedModel reference to retrieve the legacy model information. + TunedModelRef tuned_model_ref = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The TuningJob to be updated. Users can use this TuningJob field + // to overwrite tuning configs. + TuningJob tuning_job = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Google Cloud Storage location to write the artifacts. + GcsDestination artifact_destination = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. By default, bison to gemini migration will always create new + // model/endpoint, but for gemini-1.0 to gemini-1.5 migration, we default + // deploy to the same endpoint. See details in this Section. + bool deploy_to_same_endpoint = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Runtime operation information for +// [GenAiTuningService.RebaseTunedModel][google.cloud.aiplatform.v1beta1.GenAiTuningService.RebaseTunedModel]. +message RebaseTunedModelOperationMetadata { + // The common part of the operation generic information. + GenericOperationMetadata generic_metadata = 1; +} diff --git a/google/cloud/aiplatform/v1beta1/tuning_job.proto b/google/cloud/aiplatform/v1beta1/tuning_job.proto index 308b2bc964..0693914641 100644 --- a/google/cloud/aiplatform/v1beta1/tuning_job.proto +++ b/google/cloud/aiplatform/v1beta1/tuning_job.proto @@ -384,7 +384,7 @@ message SupervisedHyperParameters { AdapterSize adapter_size = 3 [(google.api.field_behavior) = OPTIONAL]; } -// Tuning Spec for Supervised Tuning. +// Tuning Spec for Supervised Tuning for first party models. message SupervisedTuningSpec { // Required. Cloud Storage path to file containing training dataset for // tuning. The dataset must be formatted as a JSONL file. @@ -450,3 +450,26 @@ message DistillationHyperParameters { SupervisedHyperParameters.AdapterSize adapter_size = 3 [(google.api.field_behavior) = OPTIONAL]; } + +// TunedModel Reference for legacy model migration. +message TunedModelRef { + // The Tuned Model Reference for the model. + oneof tuned_model_ref { + // Support migration from model registry. + string tuned_model = 1 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + }]; + + // Support migration from tuning job list page, from gemini-1.0-pro-002 + // to 1.5 and above. + string tuning_job = 2 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TuningJob" + }]; + + // Support migration from tuning job list page, from bison model to gemini + // model. + string pipeline_job = 3 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/PipelineJob" + }]; + } +}