Skip to content

Commit

Permalink
feat: support for Model Garden -- A single place to search, discover,…
Browse files Browse the repository at this point in the history
… and interact with a wide variety of foundation models from Google and Google partners, available on Vertex AI

PiperOrigin-RevId: 536794833
  • Loading branch information
Google APIs authored and Copybara-Service committed May 31, 2023
1 parent 96995a2 commit df07060
Show file tree
Hide file tree
Showing 5 changed files with 344 additions and 0 deletions.
2 changes: 2 additions & 0 deletions google/cloud/aiplatform/v1/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,15 @@ proto_library(
"model_evaluation_slice.proto",
"model_monitoring.proto",
"model_service.proto",
"model_garden_service.proto",
"nas_job.proto",
"operation.proto",
"pipeline_failure_policy.proto",
"pipeline_job.proto",
"pipeline_service.proto",
"pipeline_state.proto",
"prediction_service.proto",
"publisher_model.proto",
"saved_query.proto",
"service_networking.proto",
"specialist_pool.proto",
Expand Down
7 changes: 7 additions & 0 deletions google/cloud/aiplatform/v1/aiplatform_v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ apis:
- name: google.cloud.aiplatform.v1.MatchService
- name: google.cloud.aiplatform.v1.MetadataService
- name: google.cloud.aiplatform.v1.MigrationService
- name: google.cloud.aiplatform.v1.ModelGardenService
- name: google.cloud.aiplatform.v1.ModelService
- name: google.cloud.aiplatform.v1.PipelineService
- name: google.cloud.aiplatform.v1.PredictionService
Expand Down Expand Up @@ -160,6 +161,8 @@ backend:
deadline: 60.0
- selector: google.cloud.aiplatform.v1.MigrationService.SearchMigratableResources
deadline: 60.0
- selector: google.cloud.aiplatform.v1.ModelGardenService.GetPublisherModel
deadline: 60.0
- selector: 'google.cloud.aiplatform.v1.ModelService.*'
deadline: 60.0
- selector: 'google.cloud.aiplatform.v1.PipelineService.*'
Expand Down Expand Up @@ -597,6 +600,10 @@ authentication:
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: google.cloud.aiplatform.v1.ModelGardenService.GetPublisherModel
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: 'google.cloud.aiplatform.v1.ModelService.*'
oauth:
canonical_scopes: |-
Expand Down
13 changes: 13 additions & 0 deletions google/cloud/aiplatform/v1/model.proto
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,11 @@ message Model {
}
];

// This field is populated if the model is produced by a pipeline job.
string pipeline_job = 47 [(google.api.resource_reference) = {
type: "aiplatform.googleapis.com/PipelineJob"
}];

// Input only. The specification of the container that is to be used when
// deploying this Model. The specification is ingested upon
// [ModelService.UploadModel][google.cloud.aiplatform.v1.ModelService.UploadModel],
Expand Down Expand Up @@ -406,6 +411,14 @@ message Model {
string metadata_artifact = 44 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Contains information about the Large Model.
message LargeModelReference {
// Required. The unique name of the large Foundation or pre-built model. Like
// "chat-bison", "text-bison". Or model name with version ID, like
// "chat-bison@001", "text-bison@005", etc.
string name = 1 [(google.api.field_behavior) = REQUIRED];
}

// Contains the schemata used in Model's predictions and explanations via
// [PredictionService.Predict][google.cloud.aiplatform.v1.PredictionService.Predict],
// [PredictionService.Explain][google.cloud.aiplatform.v1.PredictionService.Explain]
Expand Down
83 changes: 83 additions & 0 deletions google/cloud/aiplatform/v1/model_garden_service.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.cloud.aiplatform.v1;

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/v1/publisher_model.proto";

option csharp_namespace = "Google.Cloud.AIPlatform.V1";
option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb";
option java_multiple_files = true;
option java_outer_classname = "ModelGardenServiceProto";
option java_package = "com.google.cloud.aiplatform.v1";
option php_namespace = "Google\\Cloud\\AIPlatform\\V1";
option ruby_package = "Google::Cloud::AIPlatform::V1";

// The interface of Model Garden Service.
service ModelGardenService {
option (google.api.default_host) = "aiplatform.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform";

// Gets a Model Garden publisher model.
rpc GetPublisherModel(GetPublisherModelRequest) returns (PublisherModel) {
option (google.api.http) = {
get: "/v1/{name=publishers/*/models/*}"
};
option (google.api.method_signature) = "name";
}
}

// View enumeration of PublisherModel.
enum PublisherModelView {
// The default / unset value. The API will default to the BASIC view.
PUBLISHER_MODEL_VIEW_UNSPECIFIED = 0;

// Include basic metadata about the publisher model, but not the full
// contents.
PUBLISHER_MODEL_VIEW_BASIC = 1;

// Include everything.
PUBLISHER_MODEL_VIEW_FULL = 2;

// Include: VersionId, ModelVersionExternalName, and SupportedActions.
PUBLISHER_MODEL_VERSION_VIEW_BASIC = 3;
}

// Request message for
// [ModelGardenService.GetPublisherModel][google.cloud.aiplatform.v1.ModelGardenService.GetPublisherModel]
message GetPublisherModelRequest {
// Required. The name of the PublisherModel resource.
// Format:
// `publishers/{publisher}/models/{publisher_model}`
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "aiplatform.googleapis.com/PublisherModel"
}
];

// Optional. The IETF BCP-47 language code representing the language in which
// the publisher model's text information should be written in (see go/bcp47).
string language_code = 2 [(google.api.field_behavior) = OPTIONAL];

// Optional. PublisherModel view specifying which fields to read.
PublisherModelView view = 3 [(google.api.field_behavior) = OPTIONAL];
}
239 changes: 239 additions & 0 deletions google/cloud/aiplatform/v1/publisher_model.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,239 @@
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.cloud.aiplatform.v1;

import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/aiplatform/v1/machine_resources.proto";
import "google/cloud/aiplatform/v1/model.proto";

option csharp_namespace = "Google.Cloud.AIPlatform.V1";
option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb";
option java_multiple_files = true;
option java_outer_classname = "PublisherModelProto";
option java_package = "com.google.cloud.aiplatform.v1";
option php_namespace = "Google\\Cloud\\AIPlatform\\V1";
option ruby_package = "Google::Cloud::AIPlatform::V1";

// A Model Garden Publisher Model.
message PublisherModel {
option (google.api.resource) = {
type: "aiplatform.googleapis.com/PublisherModel"
pattern: "publishers/{publisher}/models/{model}"
};

// Reference to a resource.
message ResourceReference {
oneof reference {
// The URI of the resource.
string uri = 1;

// The resource name of the Google Cloud resource.
string resource_name = 2;
}
}

// A named piece of documentation.
message Documentation {
// Required. E.g., OVERVIEW, USE CASES, DOCUMENTATION, SDK & SAMPLES, JAVA,
// NODE.JS, etc..
string title = 1 [(google.api.field_behavior) = REQUIRED];

// Required. Content of this piece of document (in Markdown format).
string content = 2 [(google.api.field_behavior) = REQUIRED];
}

// Actions could take on this Publisher Model.
message CallToAction {
// The regional resource name or the URI. Key is region, e.g.,
// us-central1, europe-west2, global, etc..
message RegionalResourceReferences {
// Required.
map<string, ResourceReference> references = 1
[(google.api.field_behavior) = REQUIRED];

// Required. The title of the regional resource reference.
string title = 2 [(google.api.field_behavior) = REQUIRED];
}

// Rest API docs.
message ViewRestApi {
// Required.
repeated Documentation documentations = 1
[(google.api.field_behavior) = REQUIRED];

// Required. The title of the view rest API.
string title = 2 [(google.api.field_behavior) = REQUIRED];
}

// Model metadata that is needed for UploadModel or
// DeployModel/CreateEndpoint requests.
message Deploy {
// The prediction (for example, the machine) resources that the
// DeployedModel uses.
oneof prediction_resources {
// A description of resources that are dedicated to the DeployedModel,
// and that need a higher degree of manual configuration.
DedicatedResources dedicated_resources = 5;

// A description of resources that to large degree are decided by Vertex
// AI, and require only a modest additional configuration.
AutomaticResources automatic_resources = 6;

// The resource name of the shared DeploymentResourcePool to deploy on.
// Format:
// `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}`
string shared_resources = 7;
}

// Optional. Default model display name.
string model_display_name = 1 [(google.api.field_behavior) = OPTIONAL];

// Optional. Large model reference. When this is set, model_artifact_spec
// is not needed.
LargeModelReference large_model_reference = 2
[(google.api.field_behavior) = OPTIONAL];

// Optional. The specification of the container that is to be used when
// deploying this Model in Vertex AI. Not present for Large Models.
ModelContainerSpec container_spec = 3
[(google.api.field_behavior) = OPTIONAL];

// Optional. The path to the directory containing the Model artifact and
// any of its supporting files.
string artifact_uri = 4 [(google.api.field_behavior) = OPTIONAL];

// Required. The title of the regional resource reference.
string title = 8 [(google.api.field_behavior) = REQUIRED];
}

// Optional. To view Rest API docs.
ViewRestApi view_rest_api = 1 [(google.api.field_behavior) = OPTIONAL];

// Optional. Open notebook of the PublisherModel.
RegionalResourceReferences open_notebook = 2
[(google.api.field_behavior) = OPTIONAL];

// Optional. Create application using the PublisherModel.
RegionalResourceReferences create_application = 3
[(google.api.field_behavior) = OPTIONAL];

// Optional. Open fine-tuning pipeline of the PublisherModel.
RegionalResourceReferences open_fine_tuning_pipeline = 4
[(google.api.field_behavior) = OPTIONAL];

// Optional. Open prompt-tuning pipeline of the PublisherModel.
RegionalResourceReferences open_prompt_tuning_pipeline = 5
[(google.api.field_behavior) = OPTIONAL];

// Optional. Open Genie / Playground.
RegionalResourceReferences open_genie = 6
[(google.api.field_behavior) = OPTIONAL];

// Optional. Deploy the PublisherModel to Vertex Endpoint.
Deploy deploy = 7 [(google.api.field_behavior) = OPTIONAL];

// Optional. Open in Generation AI Studio.
RegionalResourceReferences open_generation_ai_studio = 8
[(google.api.field_behavior) = OPTIONAL];

// Optional. Request for access.
RegionalResourceReferences request_access = 9
[(google.api.field_behavior) = OPTIONAL];
}

// An enum representing the open source category of a PublisherModel.
enum OpenSourceCategory {
// The open source category is unspecified, which should not be used.
OPEN_SOURCE_CATEGORY_UNSPECIFIED = 0;

// Used to indicate the PublisherModel is not open sourced.
PROPRIETARY = 1;

// Used to indicate the PublisherModel is a Google-owned open source model
// w/ Google checkpoint.
GOOGLE_OWNED_OSS_WITH_GOOGLE_CHECKPOINT = 2;

// Used to indicate the PublisherModel is a 3p-owned open source model w/
// Google checkpoint.
THIRD_PARTY_OWNED_OSS_WITH_GOOGLE_CHECKPOINT = 3;

// Used to indicate the PublisherModel is a Google-owned pure open source
// model.
GOOGLE_OWNED_OSS = 4;

// Used to indicate the PublisherModel is a 3p-owned pure open source model.
THIRD_PARTY_OWNED_OSS = 5;
}

// An enum representing the launch stage of a PublisherModel.
enum LaunchStage {
// The model launch stage is unspecified.
LAUNCH_STAGE_UNSPECIFIED = 0;

// Used to indicate the PublisherModel is at Experimental launch stage.
EXPERIMENTAL = 1;

// Used to indicate the PublisherModel is at Private Preview launch stage.
PRIVATE_PREVIEW = 2;

// Used to indicate the PublisherModel is at Public Preview launch stage.
PUBLIC_PREVIEW = 3;

// Used to indicate the PublisherModel is at GA launch stage.
GA = 4;
}

// Output only. The resource name of the PublisherModel.
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output 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.
string version_id = 2 [
(google.api.field_behavior) = IMMUTABLE,
(google.api.field_behavior) = OUTPUT_ONLY
];

// Required. Indicates the open source category of the publisher model.
OpenSourceCategory open_source_category = 7
[(google.api.field_behavior) = REQUIRED];

// Optional. Supported call-to-action options.
CallToAction supported_actions = 19 [(google.api.field_behavior) = OPTIONAL];

// Optional. Additional information about the model's Frameworks.
repeated string frameworks = 23 [(google.api.field_behavior) = OPTIONAL];

// Optional. Indicates the launch stage of the model.
LaunchStage launch_stage = 29 [(google.api.field_behavior) = OPTIONAL];

// Optional. Output only. Immutable. Used to indicate this model has a
// publisher model and provide the template of the publisher model resource
// name.
string publisher_model_template = 30 [
(google.api.field_behavior) = IMMUTABLE,
(google.api.field_behavior) = OUTPUT_ONLY
];

// Optional. The schemata that describes formats of the PublisherModel's
// predictions and explanations as given and returned via
// [PredictionService.Predict][google.cloud.aiplatform.v1.PredictionService.Predict].
PredictSchemata predict_schemata = 31
[(google.api.field_behavior) = OPTIONAL];
}

0 comments on commit df07060

Please sign in to comment.