xref: /aosp_15_r20/external/googleapis/google/cloud/aiplatform/v1beta1/model.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.cloud.aiplatform.v1beta1;
18
19import "google/api/field_behavior.proto";
20import "google/api/resource.proto";
21import "google/cloud/aiplatform/v1beta1/deployed_model_ref.proto";
22import "google/cloud/aiplatform/v1beta1/encryption_spec.proto";
23import "google/cloud/aiplatform/v1beta1/env_var.proto";
24import "google/cloud/aiplatform/v1beta1/explanation.proto";
25import "google/protobuf/duration.proto";
26import "google/protobuf/struct.proto";
27import "google/protobuf/timestamp.proto";
28
29option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1";
30option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb";
31option java_multiple_files = true;
32option java_outer_classname = "ModelProto";
33option java_package = "com.google.cloud.aiplatform.v1beta1";
34option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1";
35option ruby_package = "Google::Cloud::AIPlatform::V1beta1";
36
37// A trained machine learning Model.
38message Model {
39  option (google.api.resource) = {
40    type: "aiplatform.googleapis.com/Model"
41    pattern: "projects/{project}/locations/{location}/models/{model}"
42  };
43
44  // Represents export format supported by the Model.
45  // All formats export to Google Cloud Storage.
46  message ExportFormat {
47    // The Model content that can be exported.
48    enum ExportableContent {
49      // Should not be used.
50      EXPORTABLE_CONTENT_UNSPECIFIED = 0;
51
52      // Model artifact and any of its supported files. Will be exported to the
53      // location specified by the `artifactDestination` field of the
54      // [ExportModelRequest.output_config][google.cloud.aiplatform.v1beta1.ExportModelRequest.output_config]
55      // object.
56      ARTIFACT = 1;
57
58      // The container image that is to be used when deploying this Model. Will
59      // be exported to the location specified by the `imageDestination` field
60      // of the
61      // [ExportModelRequest.output_config][google.cloud.aiplatform.v1beta1.ExportModelRequest.output_config]
62      // object.
63      IMAGE = 2;
64    }
65
66    // Output only. The ID of the export format.
67    // The possible format IDs are:
68    //
69    // * `tflite`
70    // Used for Android mobile devices.
71    //
72    // * `edgetpu-tflite`
73    // Used for [Edge TPU](https://cloud.google.com/edge-tpu/) devices.
74    //
75    // * `tf-saved-model`
76    // A tensorflow model in SavedModel format.
77    //
78    // * `tf-js`
79    // A [TensorFlow.js](https://www.tensorflow.org/js) model that can be used
80    // in the browser and in Node.js using JavaScript.
81    //
82    // * `core-ml`
83    // Used for iOS mobile devices.
84    //
85    // * `custom-trained`
86    // A Model that was uploaded or trained by custom code.
87    string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
88
89    // Output only. The content of this Model that may be exported.
90    repeated ExportableContent exportable_contents = 2
91        [(google.api.field_behavior) = OUTPUT_ONLY];
92  }
93
94  // Contains information about the original Model if this Model is a copy.
95  message OriginalModelInfo {
96    // Output only. The resource name of the Model this Model is a copy of,
97    // including the revision. Format:
98    // `projects/{project}/locations/{location}/models/{model_id}@{version_id}`
99    string model = 1 [
100      (google.api.field_behavior) = OUTPUT_ONLY,
101      (google.api.resource_reference) = {
102        type: "aiplatform.googleapis.com/Model"
103      }
104    ];
105  }
106
107  // User input field to specify the base model source. Currently it only
108  // supports specifing the Model Garden models and Genie models.
109  message BaseModelSource {
110    oneof source {
111      // Source information of Model Garden models.
112      ModelGardenSource model_garden_source = 1;
113
114      // Information about the base model of Genie models.
115      GenieSource genie_source = 2;
116    }
117  }
118
119  // Identifies a type of Model's prediction resources.
120  enum DeploymentResourcesType {
121    // Should not be used.
122    DEPLOYMENT_RESOURCES_TYPE_UNSPECIFIED = 0;
123
124    // Resources that are dedicated to the
125    // [DeployedModel][google.cloud.aiplatform.v1beta1.DeployedModel], and that
126    // need a higher degree of manual configuration.
127    DEDICATED_RESOURCES = 1;
128
129    // Resources that to large degree are decided by Vertex AI, and require
130    // only a modest additional configuration.
131    AUTOMATIC_RESOURCES = 2;
132
133    // Resources that can be shared by multiple
134    // [DeployedModels][google.cloud.aiplatform.v1beta1.DeployedModel]. A
135    // pre-configured
136    // [DeploymentResourcePool][google.cloud.aiplatform.v1beta1.DeploymentResourcePool]
137    // is required.
138    SHARED_RESOURCES = 3;
139  }
140
141  // The resource name of the Model.
142  string name = 1;
143
144  // Output only. Immutable. The version ID of the model.
145  // A new version is committed when a new model version is uploaded or
146  // trained under an existing model id. It is an auto-incrementing decimal
147  // number in string representation.
148  string version_id = 28 [
149    (google.api.field_behavior) = IMMUTABLE,
150    (google.api.field_behavior) = OUTPUT_ONLY
151  ];
152
153  // User provided version aliases so that a model version can be referenced via
154  // alias (i.e.
155  // `projects/{project}/locations/{location}/models/{model_id}@{version_alias}`
156  // instead of auto-generated version id (i.e.
157  // `projects/{project}/locations/{location}/models/{model_id}@{version_id})`.
158  // The format is [a-z][a-zA-Z0-9-]{0,126}[a-z0-9] to distinguish from
159  // version_id. A default version alias will be created for the first version
160  // of the model, and there must be exactly one default version alias for a
161  // model.
162  repeated string version_aliases = 29;
163
164  // Output only. Timestamp when this version was created.
165  google.protobuf.Timestamp version_create_time = 31
166      [(google.api.field_behavior) = OUTPUT_ONLY];
167
168  // Output only. Timestamp when this version was most recently updated.
169  google.protobuf.Timestamp version_update_time = 32
170      [(google.api.field_behavior) = OUTPUT_ONLY];
171
172  // Required. The display name of the Model.
173  // The name can be up to 128 characters long and can consist of any UTF-8
174  // characters.
175  string display_name = 2 [(google.api.field_behavior) = REQUIRED];
176
177  // The description of the Model.
178  string description = 3;
179
180  // The description of this version.
181  string version_description = 30;
182
183  // The schemata that describe formats of the Model's predictions and
184  // explanations as given and returned via
185  // [PredictionService.Predict][google.cloud.aiplatform.v1beta1.PredictionService.Predict]
186  // and
187  // [PredictionService.Explain][google.cloud.aiplatform.v1beta1.PredictionService.Explain].
188  PredictSchemata predict_schemata = 4;
189
190  // Immutable. Points to a YAML file stored on Google Cloud Storage describing
191  // additional information about the Model, that is specific to it. Unset if
192  // the Model does not have any additional information. The schema is defined
193  // as an OpenAPI 3.0.2 [Schema
194  // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject).
195  // AutoML Models always have this field populated by Vertex AI, if no
196  // additional metadata is needed, this field is set to an empty string.
197  // Note: The URI given on output will be immutable and probably different,
198  // including the URI scheme, than the one given on input. The output URI will
199  // point to a location where the user only has a read access.
200  string metadata_schema_uri = 5 [(google.api.field_behavior) = IMMUTABLE];
201
202  // Immutable. An additional information about the Model; the schema of the
203  // metadata can be found in
204  // [metadata_schema][google.cloud.aiplatform.v1beta1.Model.metadata_schema_uri].
205  // Unset if the Model does not have any additional information.
206  google.protobuf.Value metadata = 6 [(google.api.field_behavior) = IMMUTABLE];
207
208  // Output only. The formats in which this Model may be exported. If empty,
209  // this Model is not available for export.
210  repeated ExportFormat supported_export_formats = 20
211      [(google.api.field_behavior) = OUTPUT_ONLY];
212
213  // Output only. The resource name of the TrainingPipeline that uploaded this
214  // Model, if any.
215  string training_pipeline = 7 [
216    (google.api.field_behavior) = OUTPUT_ONLY,
217    (google.api.resource_reference) = {
218      type: "aiplatform.googleapis.com/TrainingPipeline"
219    }
220  ];
221
222  // Input only. The specification of the container that is to be used when
223  // deploying this Model. The specification is ingested upon
224  // [ModelService.UploadModel][google.cloud.aiplatform.v1beta1.ModelService.UploadModel],
225  // and all binaries it contains are copied and stored internally by Vertex AI.
226  // Not required for AutoML Models.
227  ModelContainerSpec container_spec = 9
228      [(google.api.field_behavior) = INPUT_ONLY];
229
230  // Immutable. The path to the directory containing the Model artifact and any
231  // of its supporting files. Not required for AutoML Models.
232  string artifact_uri = 26 [(google.api.field_behavior) = IMMUTABLE];
233
234  // Output only. When this Model is deployed, its prediction resources are
235  // described by the `prediction_resources` field of the
236  // [Endpoint.deployed_models][google.cloud.aiplatform.v1beta1.Endpoint.deployed_models]
237  // object. Because not all Models support all resource configuration types,
238  // the configuration types this Model supports are listed here. If no
239  // configuration types are listed, the Model cannot be deployed to an
240  // [Endpoint][google.cloud.aiplatform.v1beta1.Endpoint] and does not support
241  // online predictions
242  // ([PredictionService.Predict][google.cloud.aiplatform.v1beta1.PredictionService.Predict]
243  // or
244  // [PredictionService.Explain][google.cloud.aiplatform.v1beta1.PredictionService.Explain]).
245  // Such a Model can serve predictions by using a
246  // [BatchPredictionJob][google.cloud.aiplatform.v1beta1.BatchPredictionJob],
247  // if it has at least one entry each in
248  // [supported_input_storage_formats][google.cloud.aiplatform.v1beta1.Model.supported_input_storage_formats]
249  // and
250  // [supported_output_storage_formats][google.cloud.aiplatform.v1beta1.Model.supported_output_storage_formats].
251  repeated DeploymentResourcesType supported_deployment_resources_types = 10
252      [(google.api.field_behavior) = OUTPUT_ONLY];
253
254  // Output only. The formats this Model supports in
255  // [BatchPredictionJob.input_config][google.cloud.aiplatform.v1beta1.BatchPredictionJob.input_config].
256  // If
257  // [PredictSchemata.instance_schema_uri][google.cloud.aiplatform.v1beta1.PredictSchemata.instance_schema_uri]
258  // exists, the instances should be given as per that schema.
259  //
260  // The possible formats are:
261  //
262  // * `jsonl`
263  // The JSON Lines format, where each instance is a single line. Uses
264  // [GcsSource][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InputConfig.gcs_source].
265  //
266  // * `csv`
267  // The CSV format, where each instance is a single comma-separated line.
268  // The first line in the file is the header, containing comma-separated field
269  // names. Uses
270  // [GcsSource][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InputConfig.gcs_source].
271  //
272  // * `tf-record`
273  // The TFRecord format, where each instance is a single record in tfrecord
274  // syntax. Uses
275  // [GcsSource][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InputConfig.gcs_source].
276  //
277  // * `tf-record-gzip`
278  // Similar to `tf-record`, but the file is gzipped. Uses
279  // [GcsSource][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InputConfig.gcs_source].
280  //
281  // * `bigquery`
282  // Each instance is a single row in BigQuery. Uses
283  // [BigQuerySource][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InputConfig.bigquery_source].
284  //
285  // * `file-list`
286  // Each line of the file is the location of an instance to process, uses
287  // `gcs_source` field of the
288  // [InputConfig][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InputConfig]
289  // object.
290  //
291  //
292  // If this Model doesn't support any of these formats it means it cannot be
293  // used with a
294  // [BatchPredictionJob][google.cloud.aiplatform.v1beta1.BatchPredictionJob].
295  // However, if it has
296  // [supported_deployment_resources_types][google.cloud.aiplatform.v1beta1.Model.supported_deployment_resources_types],
297  // it could serve online predictions by using
298  // [PredictionService.Predict][google.cloud.aiplatform.v1beta1.PredictionService.Predict]
299  // or
300  // [PredictionService.Explain][google.cloud.aiplatform.v1beta1.PredictionService.Explain].
301  repeated string supported_input_storage_formats = 11
302      [(google.api.field_behavior) = OUTPUT_ONLY];
303
304  // Output only. The formats this Model supports in
305  // [BatchPredictionJob.output_config][google.cloud.aiplatform.v1beta1.BatchPredictionJob.output_config].
306  // If both
307  // [PredictSchemata.instance_schema_uri][google.cloud.aiplatform.v1beta1.PredictSchemata.instance_schema_uri]
308  // and
309  // [PredictSchemata.prediction_schema_uri][google.cloud.aiplatform.v1beta1.PredictSchemata.prediction_schema_uri]
310  // exist, the predictions are returned together with their instances. In other
311  // words, the prediction has the original instance data first, followed by the
312  // actual prediction content (as per the schema).
313  //
314  // The possible formats are:
315  //
316  // * `jsonl`
317  // The JSON Lines format, where each prediction is a single line. Uses
318  // [GcsDestination][google.cloud.aiplatform.v1beta1.BatchPredictionJob.OutputConfig.gcs_destination].
319  //
320  // * `csv`
321  // The CSV format, where each prediction is a single comma-separated line.
322  // The first line in the file is the header, containing comma-separated field
323  // names. Uses
324  // [GcsDestination][google.cloud.aiplatform.v1beta1.BatchPredictionJob.OutputConfig.gcs_destination].
325  //
326  // * `bigquery`
327  // Each prediction is a single row in a BigQuery table, uses
328  // [BigQueryDestination][google.cloud.aiplatform.v1beta1.BatchPredictionJob.OutputConfig.bigquery_destination]
329  // .
330  //
331  //
332  // If this Model doesn't support any of these formats it means it cannot be
333  // used with a
334  // [BatchPredictionJob][google.cloud.aiplatform.v1beta1.BatchPredictionJob].
335  // However, if it has
336  // [supported_deployment_resources_types][google.cloud.aiplatform.v1beta1.Model.supported_deployment_resources_types],
337  // it could serve online predictions by using
338  // [PredictionService.Predict][google.cloud.aiplatform.v1beta1.PredictionService.Predict]
339  // or
340  // [PredictionService.Explain][google.cloud.aiplatform.v1beta1.PredictionService.Explain].
341  repeated string supported_output_storage_formats = 12
342      [(google.api.field_behavior) = OUTPUT_ONLY];
343
344  // Output only. Timestamp when this Model was uploaded into Vertex AI.
345  google.protobuf.Timestamp create_time = 13
346      [(google.api.field_behavior) = OUTPUT_ONLY];
347
348  // Output only. Timestamp when this Model was most recently updated.
349  google.protobuf.Timestamp update_time = 14
350      [(google.api.field_behavior) = OUTPUT_ONLY];
351
352  // Output only. The pointers to DeployedModels created from this Model. Note
353  // that Model could have been deployed to Endpoints in different Locations.
354  repeated DeployedModelRef deployed_models = 15
355      [(google.api.field_behavior) = OUTPUT_ONLY];
356
357  // The default explanation specification for this Model.
358  //
359  // The Model can be used for
360  // [requesting
361  // explanation][google.cloud.aiplatform.v1beta1.PredictionService.Explain]
362  // after being
363  // [deployed][google.cloud.aiplatform.v1beta1.EndpointService.DeployModel] if
364  // it is populated. The Model can be used for [batch
365  // explanation][google.cloud.aiplatform.v1beta1.BatchPredictionJob.generate_explanation]
366  // if it is populated.
367  //
368  // All fields of the explanation_spec can be overridden by
369  // [explanation_spec][google.cloud.aiplatform.v1beta1.DeployedModel.explanation_spec]
370  // of
371  // [DeployModelRequest.deployed_model][google.cloud.aiplatform.v1beta1.DeployModelRequest.deployed_model],
372  // or
373  // [explanation_spec][google.cloud.aiplatform.v1beta1.BatchPredictionJob.explanation_spec]
374  // of
375  // [BatchPredictionJob][google.cloud.aiplatform.v1beta1.BatchPredictionJob].
376  //
377  // If the default explanation specification is not set for this Model, this
378  // Model can still be used for
379  // [requesting
380  // explanation][google.cloud.aiplatform.v1beta1.PredictionService.Explain] by
381  // setting
382  // [explanation_spec][google.cloud.aiplatform.v1beta1.DeployedModel.explanation_spec]
383  // of
384  // [DeployModelRequest.deployed_model][google.cloud.aiplatform.v1beta1.DeployModelRequest.deployed_model]
385  // and for [batch
386  // explanation][google.cloud.aiplatform.v1beta1.BatchPredictionJob.generate_explanation]
387  // by setting
388  // [explanation_spec][google.cloud.aiplatform.v1beta1.BatchPredictionJob.explanation_spec]
389  // of
390  // [BatchPredictionJob][google.cloud.aiplatform.v1beta1.BatchPredictionJob].
391  ExplanationSpec explanation_spec = 23;
392
393  // Used to perform consistent read-modify-write updates. If not set, a blind
394  // "overwrite" update happens.
395  string etag = 16;
396
397  // The labels with user-defined metadata to organize your Models.
398  //
399  // Label keys and values can be no longer than 64 characters
400  // (Unicode codepoints), can only contain lowercase letters, numeric
401  // characters, underscores and dashes. International characters are allowed.
402  //
403  // See https://goo.gl/xmQnxf for more information and examples of labels.
404  map<string, string> labels = 17;
405
406  // Customer-managed encryption key spec for a Model. If set, this
407  // Model and all sub-resources of this Model will be secured by this key.
408  EncryptionSpec encryption_spec = 24;
409
410  // Output only. Source of a model. It can either be automl training pipeline,
411  // custom training pipeline, BigQuery ML, or saved and tuned from Genie or
412  // Model Garden.
413  ModelSourceInfo model_source_info = 38
414      [(google.api.field_behavior) = OUTPUT_ONLY];
415
416  // Output only. If this Model is a copy of another Model, this contains info
417  // about the original.
418  OriginalModelInfo original_model_info = 34
419      [(google.api.field_behavior) = OUTPUT_ONLY];
420
421  // Output only. The resource name of the Artifact that was created in
422  // MetadataStore when creating the Model. The Artifact resource name pattern
423  // is
424  // `projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}`.
425  string metadata_artifact = 44 [(google.api.field_behavior) = OUTPUT_ONLY];
426
427  // Optional. User input field to specify the base model source. Currently it
428  // only supports specifing the Model Garden models and Genie models.
429  BaseModelSource base_model_source = 50
430      [(google.api.field_behavior) = OPTIONAL];
431}
432
433// Contains information about the Large Model.
434message LargeModelReference {
435  // Required. The unique name of the large Foundation or pre-built model. Like
436  // "chat-bison", "text-bison". Or model name with version ID, like
437  // "chat-bison@001", "text-bison@005", etc.
438  string name = 1 [(google.api.field_behavior) = REQUIRED];
439}
440
441// Contains information about the source of the models generated from Model
442// Garden.
443message ModelGardenSource {
444  // Required. The model garden source model resource name.
445  string public_model_name = 1 [(google.api.field_behavior) = REQUIRED];
446}
447
448// Contains information about the source of the models generated from Generative
449// AI Studio.
450message GenieSource {
451  // Required. The public base model URI.
452  string base_model_uri = 1 [(google.api.field_behavior) = REQUIRED];
453}
454
455// Contains the schemata used in Model's predictions and explanations via
456// [PredictionService.Predict][google.cloud.aiplatform.v1beta1.PredictionService.Predict],
457// [PredictionService.Explain][google.cloud.aiplatform.v1beta1.PredictionService.Explain]
458// and [BatchPredictionJob][google.cloud.aiplatform.v1beta1.BatchPredictionJob].
459message PredictSchemata {
460  // Immutable. Points to a YAML file stored on Google Cloud Storage describing
461  // the format of a single instance, which are used in
462  // [PredictRequest.instances][google.cloud.aiplatform.v1beta1.PredictRequest.instances],
463  // [ExplainRequest.instances][google.cloud.aiplatform.v1beta1.ExplainRequest.instances]
464  // and
465  // [BatchPredictionJob.input_config][google.cloud.aiplatform.v1beta1.BatchPredictionJob.input_config].
466  // The schema is defined as an OpenAPI 3.0.2 [Schema
467  // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject).
468  // AutoML Models always have this field populated by Vertex AI.
469  // Note: The URI given on output will be immutable and probably different,
470  // including the URI scheme, than the one given on input. The output URI will
471  // point to a location where the user only has a read access.
472  string instance_schema_uri = 1 [(google.api.field_behavior) = IMMUTABLE];
473
474  // Immutable. Points to a YAML file stored on Google Cloud Storage describing
475  // the parameters of prediction and explanation via
476  // [PredictRequest.parameters][google.cloud.aiplatform.v1beta1.PredictRequest.parameters],
477  // [ExplainRequest.parameters][google.cloud.aiplatform.v1beta1.ExplainRequest.parameters]
478  // and
479  // [BatchPredictionJob.model_parameters][google.cloud.aiplatform.v1beta1.BatchPredictionJob.model_parameters].
480  // The schema is defined as an OpenAPI 3.0.2 [Schema
481  // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject).
482  // AutoML Models always have this field populated by Vertex AI, if no
483  // parameters are supported, then it is set to an empty string.
484  // Note: The URI given on output will be immutable and probably different,
485  // including the URI scheme, than the one given on input. The output URI will
486  // point to a location where the user only has a read access.
487  string parameters_schema_uri = 2 [(google.api.field_behavior) = IMMUTABLE];
488
489  // Immutable. Points to a YAML file stored on Google Cloud Storage describing
490  // the format of a single prediction produced by this Model, which are
491  // returned via
492  // [PredictResponse.predictions][google.cloud.aiplatform.v1beta1.PredictResponse.predictions],
493  // [ExplainResponse.explanations][google.cloud.aiplatform.v1beta1.ExplainResponse.explanations],
494  // and
495  // [BatchPredictionJob.output_config][google.cloud.aiplatform.v1beta1.BatchPredictionJob.output_config].
496  // The schema is defined as an OpenAPI 3.0.2 [Schema
497  // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject).
498  // AutoML Models always have this field populated by Vertex AI.
499  // Note: The URI given on output will be immutable and probably different,
500  // including the URI scheme, than the one given on input. The output URI will
501  // point to a location where the user only has a read access.
502  string prediction_schema_uri = 3 [(google.api.field_behavior) = IMMUTABLE];
503}
504
505// Specification of a container for serving predictions. Some fields in this
506// message correspond to fields in the [Kubernetes Container v1 core
507// specification](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core).
508message ModelContainerSpec {
509  // Required. Immutable. URI of the Docker image to be used as the custom
510  // container for serving predictions. This URI must identify an image in
511  // Artifact Registry or Container Registry. Learn more about the [container
512  // publishing
513  // requirements](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#publishing),
514  // including permissions requirements for the Vertex AI Service Agent.
515  //
516  // The container image is ingested upon
517  // [ModelService.UploadModel][google.cloud.aiplatform.v1beta1.ModelService.UploadModel],
518  // stored internally, and this original path is afterwards not used.
519  //
520  // To learn about the requirements for the Docker image itself, see
521  // [Custom container
522  // requirements](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#).
523  //
524  // You can use the URI to one of Vertex AI's [pre-built container images for
525  // prediction](https://cloud.google.com/vertex-ai/docs/predictions/pre-built-containers)
526  // in this field.
527  string image_uri = 1 [
528    (google.api.field_behavior) = REQUIRED,
529    (google.api.field_behavior) = IMMUTABLE
530  ];
531
532  // Immutable. Specifies the command that runs when the container starts. This
533  // overrides the container's
534  // [ENTRYPOINT](https://docs.docker.com/engine/reference/builder/#entrypoint).
535  // Specify this field as an array of executable and arguments, similar to a
536  // Docker `ENTRYPOINT`'s "exec" form, not its "shell" form.
537  //
538  // If you do not specify this field, then the container's `ENTRYPOINT` runs,
539  // in conjunction with the
540  // [args][google.cloud.aiplatform.v1beta1.ModelContainerSpec.args] field or
541  // the container's
542  // [`CMD`](https://docs.docker.com/engine/reference/builder/#cmd), if either
543  // exists. If this field is not specified and the container does not have an
544  // `ENTRYPOINT`, then refer to the Docker documentation about [how `CMD` and
545  // `ENTRYPOINT`
546  // interact](https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact).
547  //
548  // If you specify this field, then you can also specify the `args` field to
549  // provide additional arguments for this command. However, if you specify this
550  // field, then the container's `CMD` is ignored. See the
551  // [Kubernetes documentation about how the
552  // `command` and `args` fields interact with a container's `ENTRYPOINT` and
553  // `CMD`](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes).
554  //
555  // In this field, you can reference [environment variables set by Vertex
556  // AI](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables)
557  // and environment variables set in the
558  // [env][google.cloud.aiplatform.v1beta1.ModelContainerSpec.env] field. You
559  // cannot reference environment variables set in the Docker image. In order
560  // for environment variables to be expanded, reference them by using the
561  // following syntax:
562  // <code>$(<var>VARIABLE_NAME</var>)</code>
563  // Note that this differs from Bash variable expansion, which does not use
564  // parentheses. If a variable cannot be resolved, the reference in the input
565  // string is used unchanged. To avoid variable expansion, you can escape this
566  // syntax with `$$`; for example:
567  // <code>$$(<var>VARIABLE_NAME</var>)</code>
568  // This field corresponds to the `command` field of the Kubernetes Containers
569  // [v1 core
570  // API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core).
571  repeated string command = 2 [(google.api.field_behavior) = IMMUTABLE];
572
573  // Immutable. Specifies arguments for the command that runs when the container
574  // starts. This overrides the container's
575  // [`CMD`](https://docs.docker.com/engine/reference/builder/#cmd). Specify
576  // this field as an array of executable and arguments, similar to a Docker
577  // `CMD`'s "default parameters" form.
578  //
579  // If you don't specify this field but do specify the
580  // [command][google.cloud.aiplatform.v1beta1.ModelContainerSpec.command]
581  // field, then the command from the `command` field runs without any
582  // additional arguments. See the [Kubernetes documentation about how the
583  // `command` and `args` fields interact with a container's `ENTRYPOINT` and
584  // `CMD`](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes).
585  //
586  // If you don't specify this field and don't specify the `command` field,
587  // then the container's
588  // [`ENTRYPOINT`](https://docs.docker.com/engine/reference/builder/#cmd) and
589  // `CMD` determine what runs based on their default behavior. See the Docker
590  // documentation about [how `CMD` and `ENTRYPOINT`
591  // interact](https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact).
592  //
593  // In this field, you can reference [environment variables
594  // set by Vertex
595  // AI](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables)
596  // and environment variables set in the
597  // [env][google.cloud.aiplatform.v1beta1.ModelContainerSpec.env] field. You
598  // cannot reference environment variables set in the Docker image. In order
599  // for environment variables to be expanded, reference them by using the
600  // following syntax:
601  // <code>$(<var>VARIABLE_NAME</var>)</code>
602  // Note that this differs from Bash variable expansion, which does not use
603  // parentheses. If a variable cannot be resolved, the reference in the input
604  // string is used unchanged. To avoid variable expansion, you can escape this
605  // syntax with `$$`; for example:
606  // <code>$$(<var>VARIABLE_NAME</var>)</code>
607  // This field corresponds to the `args` field of the Kubernetes Containers
608  // [v1 core
609  // API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core).
610  repeated string args = 3 [(google.api.field_behavior) = IMMUTABLE];
611
612  // Immutable. List of environment variables to set in the container. After the
613  // container starts running, code running in the container can read these
614  // environment variables.
615  //
616  // Additionally, the
617  // [command][google.cloud.aiplatform.v1beta1.ModelContainerSpec.command] and
618  // [args][google.cloud.aiplatform.v1beta1.ModelContainerSpec.args] fields can
619  // reference these variables. Later entries in this list can also reference
620  // earlier entries. For example, the following example sets the variable
621  // `VAR_2` to have the value `foo bar`:
622  //
623  // ```json
624  // [
625  //   {
626  //     "name": "VAR_1",
627  //     "value": "foo"
628  //   },
629  //   {
630  //     "name": "VAR_2",
631  //     "value": "$(VAR_1) bar"
632  //   }
633  // ]
634  // ```
635  //
636  // If you switch the order of the variables in the example, then the expansion
637  // does not occur.
638  //
639  // This field corresponds to the `env` field of the Kubernetes Containers
640  // [v1 core
641  // API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core).
642  repeated EnvVar env = 4 [(google.api.field_behavior) = IMMUTABLE];
643
644  // Immutable. List of ports to expose from the container. Vertex AI sends any
645  // prediction requests that it receives to the first port on this list. Vertex
646  // AI also sends
647  // [liveness and health
648  // checks](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#liveness)
649  // to this port.
650  //
651  // If you do not specify this field, it defaults to following value:
652  //
653  // ```json
654  // [
655  //   {
656  //     "containerPort": 8080
657  //   }
658  // ]
659  // ```
660  //
661  // Vertex AI does not use ports other than the first one listed. This field
662  // corresponds to the `ports` field of the Kubernetes Containers
663  // [v1 core
664  // API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core).
665  repeated Port ports = 5 [(google.api.field_behavior) = IMMUTABLE];
666
667  // Immutable. HTTP path on the container to send prediction requests to.
668  // Vertex AI forwards requests sent using
669  // [projects.locations.endpoints.predict][google.cloud.aiplatform.v1beta1.PredictionService.Predict]
670  // to this path on the container's IP address and port. Vertex AI then returns
671  // the container's response in the API response.
672  //
673  // For example, if you set this field to `/foo`, then when Vertex AI
674  // receives a prediction request, it forwards the request body in a POST
675  // request to the `/foo` path on the port of your container specified by the
676  // first value of this `ModelContainerSpec`'s
677  // [ports][google.cloud.aiplatform.v1beta1.ModelContainerSpec.ports] field.
678  //
679  // If you don't specify this field, it defaults to the following value when
680  // you [deploy this Model to an
681  // Endpoint][google.cloud.aiplatform.v1beta1.EndpointService.DeployModel]:
682  // <code>/v1/endpoints/<var>ENDPOINT</var>/deployedModels/<var>DEPLOYED_MODEL</var>:predict</code>
683  // The placeholders in this value are replaced as follows:
684  //
685  // * <var>ENDPOINT</var>: The last segment (following `endpoints/`)of the
686  //   Endpoint.name][] field of the Endpoint where this Model has been
687  //   deployed. (Vertex AI makes this value available to your container code
688  //   as the [`AIP_ENDPOINT_ID` environment
689  //  variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).)
690  //
691  // * <var>DEPLOYED_MODEL</var>:
692  // [DeployedModel.id][google.cloud.aiplatform.v1beta1.DeployedModel.id] of the
693  // `DeployedModel`.
694  //   (Vertex AI makes this value available to your container code
695  //   as the [`AIP_DEPLOYED_MODEL_ID` environment
696  //   variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).)
697  string predict_route = 6 [(google.api.field_behavior) = IMMUTABLE];
698
699  // Immutable. HTTP path on the container to send health checks to. Vertex AI
700  // intermittently sends GET requests to this path on the container's IP
701  // address and port to check that the container is healthy. Read more about
702  // [health
703  // checks](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#health).
704  //
705  // For example, if you set this field to `/bar`, then Vertex AI
706  // intermittently sends a GET request to the `/bar` path on the port of your
707  // container specified by the first value of this `ModelContainerSpec`'s
708  // [ports][google.cloud.aiplatform.v1beta1.ModelContainerSpec.ports] field.
709  //
710  // If you don't specify this field, it defaults to the following value when
711  // you [deploy this Model to an
712  // Endpoint][google.cloud.aiplatform.v1beta1.EndpointService.DeployModel]:
713  // <code>/v1/endpoints/<var>ENDPOINT</var>/deployedModels/<var>DEPLOYED_MODEL</var>:predict</code>
714  // The placeholders in this value are replaced as follows:
715  //
716  // * <var>ENDPOINT</var>: The last segment (following `endpoints/`)of the
717  //   Endpoint.name][] field of the Endpoint where this Model has been
718  //   deployed. (Vertex AI makes this value available to your container code
719  //   as the [`AIP_ENDPOINT_ID` environment
720  //   variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).)
721  //
722  // * <var>DEPLOYED_MODEL</var>:
723  // [DeployedModel.id][google.cloud.aiplatform.v1beta1.DeployedModel.id] of the
724  // `DeployedModel`.
725  //   (Vertex AI makes this value available to your container code as the
726  //   [`AIP_DEPLOYED_MODEL_ID` environment
727  //   variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).)
728  string health_route = 7 [(google.api.field_behavior) = IMMUTABLE];
729
730  // Immutable. List of ports to expose from the container. Vertex AI sends gRPC
731  // prediction requests that it receives to the first port on this list. Vertex
732  // AI also sends liveness and health checks to this port.
733  //
734  // If you do not specify this field, gRPC requests to the container will be
735  // disabled.
736  //
737  // Vertex AI does not use ports other than the first one listed. This field
738  // corresponds to the `ports` field of the Kubernetes Containers v1 core API.
739  repeated Port grpc_ports = 9 [(google.api.field_behavior) = IMMUTABLE];
740
741  // Immutable. Deployment timeout.
742  // Limit for deployment timeout is 2 hours.
743  google.protobuf.Duration deployment_timeout = 10
744      [(google.api.field_behavior) = IMMUTABLE];
745
746  // Immutable. The amount of the VM memory to reserve as the shared memory for
747  // the model in megabytes.
748  int64 shared_memory_size_mb = 11 [(google.api.field_behavior) = IMMUTABLE];
749
750  // Immutable. Specification for Kubernetes startup probe.
751  Probe startup_probe = 12 [(google.api.field_behavior) = IMMUTABLE];
752
753  // Immutable. Specification for Kubernetes readiness probe.
754  Probe health_probe = 13 [(google.api.field_behavior) = IMMUTABLE];
755}
756
757// Represents a network port in a container.
758message Port {
759  // The number of the port to expose on the pod's IP address.
760  // Must be a valid port number, between 1 and 65535 inclusive.
761  int32 container_port = 3;
762}
763
764// Detail description of the source information of the model.
765message ModelSourceInfo {
766  // Source of the model.
767  // Different from `objective` field, this `ModelSourceType` enum
768  // indicates the source from which the model was accessed or obtained,
769  // whereas the `objective` indicates the overall aim or function of this
770  // model.
771  enum ModelSourceType {
772    // Should not be used.
773    MODEL_SOURCE_TYPE_UNSPECIFIED = 0;
774
775    // The Model is uploaded by automl training pipeline.
776    AUTOML = 1;
777
778    // The Model is uploaded by user or custom training pipeline.
779    CUSTOM = 2;
780
781    // The Model is registered and sync'ed from BigQuery ML.
782    BQML = 3;
783
784    // The Model is saved or tuned from Model Garden.
785    MODEL_GARDEN = 4;
786
787    // The Model is saved or tuned from Genie.
788    GENIE = 5;
789
790    // The Model is uploaded by text embedding finetuning pipeline.
791    CUSTOM_TEXT_EMBEDDING = 6;
792
793    // The Model is saved or tuned from Marketplace.
794    MARKETPLACE = 7;
795  }
796
797  // Type of the model source.
798  ModelSourceType source_type = 1;
799
800  // If this Model is copy of another Model. If true then
801  // [source_type][google.cloud.aiplatform.v1beta1.ModelSourceInfo.source_type]
802  // pertains to the original.
803  bool copy = 2;
804}
805
806// Probe describes a health check to be performed against a container to
807// determine whether it is alive or ready to receive traffic.
808message Probe {
809  // ExecAction specifies a command to execute.
810  message ExecAction {
811    // Command is the command line to execute inside the container, the working
812    // directory for the command is root ('/') in the container's filesystem.
813    // The command is simply exec'd, it is not run inside a shell, so
814    // traditional shell instructions ('|', etc) won't work. To use a shell, you
815    // need to explicitly call out to that shell. Exit status of 0 is treated as
816    // live/healthy and non-zero is unhealthy.
817    repeated string command = 1;
818  }
819
820  oneof probe_type {
821    // Exec specifies the action to take.
822    ExecAction exec = 1;
823  }
824
825  // How often (in seconds) to perform the probe. Default to 10 seconds.
826  // Minimum value is 1. Must be less than timeout_seconds.
827  //
828  // Maps to Kubernetes probe argument 'periodSeconds'.
829  int32 period_seconds = 2;
830
831  // Number of seconds after which the probe times out. Defaults to 1 second.
832  // Minimum value is 1. Must be greater or equal to period_seconds.
833  //
834  // Maps to Kubernetes probe argument 'timeoutSeconds'.
835  int32 timeout_seconds = 3;
836}
837