tuning_jobs
Creates, updates, deletes, gets or lists a tuning_jobs
resource.
Overview
Name | tuning_jobs |
Type | Resource |
Id | google.aiplatform.tuning_jobs |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output only. Identifier. Resource name of a TuningJob. Format: projects/{project}/locations/{location}/tuningJobs/{tuning_job} |
baseModel | string | The base model that is being tuned. See Supported models. |
createTime | string (google-datetime) | Output only. Time when the TuningJob was created. |
description | string | Optional. The description of the TuningJob. |
encryptionSpec | object | Customer-managed encryption key options for a TuningJob. If this is set, then all resources created by the TuningJob will be encrypted with the provided encryption key. (id: GoogleCloudAiplatformV1EncryptionSpec) |
endTime | string (google-datetime) | Output only. Time when the TuningJob entered any of the following JobStates: JOB_STATE_SUCCEEDED , JOB_STATE_FAILED , JOB_STATE_CANCELLED , JOB_STATE_EXPIRED . |
error | object | Output only. Only populated when job's state is JOB_STATE_FAILED or JOB_STATE_CANCELLED . (id: GoogleRpcStatus) |
experiment | string | Output only. The Experiment associated with this TuningJob. |
labels | object | Optional. The labels with user-defined metadata to organize TuningJob and generated resources such as Model and Endpoint. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels. |
serviceAccount | string | The service account that the tuningJob workload runs as. If not specified, the Vertex AI Secure Fine-Tuned Service Agent in the project will be used. See https://cloud.google.com/iam/docs/service-agents#vertex-ai-secure-fine-tuning-service-agent Users starting the pipeline must have the iam.serviceAccounts.actAs permission on this service account. |
startTime | string (google-datetime) | Output only. Time when the TuningJob for the first time entered the JOB_STATE_RUNNING state. |
state | string | Output only. The detailed state of the job. |
supervisedTuningSpec | object | Tuning Spec for Supervised Fine Tuning. (id: GoogleCloudAiplatformV1SupervisedTuningSpec) |
tunedModel | object | Output only. The tuned model resources associated with this TuningJob. (id: GoogleCloudAiplatformV1TunedModel) |
tunedModelDisplayName | string | Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters. |
tuningDataStats | object | Output only. The tuning data statistics associated with this TuningJob. (id: GoogleCloudAiplatformV1TuningDataStats) |
updateTime | string (google-datetime) | Output only. Time when the TuningJob was most recently updated. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output only. Identifier. Resource name of a TuningJob. Format: projects/{project}/locations/{location}/tuningJobs/{tuning_job} |
baseModel | string | The base model that is being tuned. See Supported models. |
createTime | string (google-datetime) | Output only. Time when the TuningJob was created. |
description | string | Optional. The description of the TuningJob. |
encryptionSpec | object | Customer-managed encryption key options for a TuningJob. If this is set, then all resources created by the TuningJob will be encrypted with the provided encryption key. (id: GoogleCloudAiplatformV1EncryptionSpec) |
endTime | string (google-datetime) | Output only. Time when the TuningJob entered any of the following JobStates: JOB_STATE_SUCCEEDED , JOB_STATE_FAILED , JOB_STATE_CANCELLED , JOB_STATE_EXPIRED . |
error | object | Output only. Only populated when job's state is JOB_STATE_FAILED or JOB_STATE_CANCELLED . (id: GoogleRpcStatus) |
experiment | string | Output only. The Experiment associated with this TuningJob. |
labels | object | Optional. The labels with user-defined metadata to organize TuningJob and generated resources such as Model and Endpoint. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels. |
serviceAccount | string | The service account that the tuningJob workload runs as. If not specified, the Vertex AI Secure Fine-Tuned Service Agent in the project will be used. See https://cloud.google.com/iam/docs/service-agents#vertex-ai-secure-fine-tuning-service-agent Users starting the pipeline must have the iam.serviceAccounts.actAs permission on this service account. |
startTime | string (google-datetime) | Output only. Time when the TuningJob for the first time entered the JOB_STATE_RUNNING state. |
state | string | Output only. The detailed state of the job. |
supervisedTuningSpec | object | Tuning Spec for Supervised Fine Tuning. (id: GoogleCloudAiplatformV1SupervisedTuningSpec) |
tunedModel | object | Output only. The tuned model resources associated with this TuningJob. (id: GoogleCloudAiplatformV1TunedModel) |
tunedModelDisplayName | string | Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters. |
tuningDataStats | object | Output only. The tuning data statistics associated with this TuningJob. (id: GoogleCloudAiplatformV1TuningDataStats) |
updateTime | string (google-datetime) | Output only. Time when the TuningJob was most recently updated. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | projectsId , locationsId , tuningJobsId | Gets a TuningJob. | |
list | select | projectsId , locationsId | filter , pageSize , pageToken | Lists TuningJobs in a Location. |
create | insert | projectsId , locationsId | Creates a TuningJob. A created TuningJob right away will be attempted to be run. | |
cancel | exec | projectsId , locationsId , tuningJobsId | Cancels a TuningJob. Starts asynchronous cancellation on the TuningJob. The server makes a best effort to cancel the job, but success is not guaranteed. Clients can use GenAiTuningService.GetTuningJob or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On successful cancellation, the TuningJob is not deleted; instead it becomes a job with a TuningJob.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED , and TuningJob.state is set to CANCELLED . | |
rebase_tuned_model | exec | projectsId , locationsId | Rebase a TunedModel. |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
locationsId | string | |
projectsId | string | |
tuningJobsId | string | |
filter | string | |
pageSize | integer (int32) | |
pageToken | string |
SELECT
examples
- get
- list
Gets a TuningJob.
SELECT
name,
baseModel,
createTime,
description,
encryptionSpec,
endTime,
error,
experiment,
labels,
serviceAccount,
startTime,
state,
supervisedTuningSpec,
tunedModel,
tunedModelDisplayName,
tuningDataStats,
updateTime
FROM google.aiplatform.tuning_jobs
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND tuningJobsId = '{{ tuningJobsId }}' -- required;
Lists TuningJobs in a Location.
SELECT
name,
baseModel,
createTime,
description,
encryptionSpec,
endTime,
error,
experiment,
labels,
serviceAccount,
startTime,
state,
supervisedTuningSpec,
tunedModel,
tunedModelDisplayName,
tuningDataStats,
updateTime
FROM google.aiplatform.tuning_jobs
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND filter = '{{ filter }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';
INSERT
examples
- create
- Manifest
Creates a TuningJob. A created TuningJob right away will be attempted to be run.
INSERT INTO google.aiplatform.tuning_jobs (
data__baseModel,
data__supervisedTuningSpec,
data__tunedModelDisplayName,
data__description,
data__labels,
data__encryptionSpec,
data__serviceAccount,
projectsId,
locationsId
)
SELECT
'{{ baseModel }}',
'{{ supervisedTuningSpec }}',
'{{ tunedModelDisplayName }}',
'{{ description }}',
'{{ labels }}',
'{{ encryptionSpec }}',
'{{ serviceAccount }}',
'{{ projectsId }}',
'{{ locationsId }}'
RETURNING
name,
baseModel,
createTime,
description,
encryptionSpec,
endTime,
error,
experiment,
labels,
serviceAccount,
startTime,
state,
supervisedTuningSpec,
tunedModel,
tunedModelDisplayName,
tuningDataStats,
updateTime
;
# Description fields are for documentation purposes
- name: tuning_jobs
props:
- name: projectsId
value: string
description: Required parameter for the tuning_jobs resource.
- name: locationsId
value: string
description: Required parameter for the tuning_jobs resource.
- name: baseModel
value: string
description: >
The base model that is being tuned. See [Supported models](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/tuning#supported_models).
- name: supervisedTuningSpec
value: object
description: >
Tuning Spec for Supervised Fine Tuning.
- name: tunedModelDisplayName
value: string
description: >
Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters.
- name: description
value: string
description: >
Optional. The description of the TuningJob.
- name: labels
value: object
description: >
Optional. The labels with user-defined metadata to organize TuningJob and generated resources such as Model and Endpoint. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.
- name: encryptionSpec
value: object
description: >
Customer-managed encryption key options for a TuningJob. If this is set, then all resources created by the TuningJob will be encrypted with the provided encryption key.
- name: serviceAccount
value: string
description: >
The service account that the tuningJob workload runs as. If not specified, the Vertex AI Secure Fine-Tuned Service Agent in the project will be used. See https://cloud.google.com/iam/docs/service-agents#vertex-ai-secure-fine-tuning-service-agent Users starting the pipeline must have the `iam.serviceAccounts.actAs` permission on this service account.
Lifecycle Methods
- cancel
- rebase_tuned_model
Cancels a TuningJob. Starts asynchronous cancellation on the TuningJob. The server makes a best effort to cancel the job, but success is not guaranteed. Clients can use GenAiTuningService.GetTuningJob or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On successful cancellation, the TuningJob is not deleted; instead it becomes a job with a TuningJob.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED
, and TuningJob.state is set to CANCELLED
.
EXEC google.aiplatform.tuning_jobs.cancel
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@tuningJobsId='{{ tuningJobsId }}' --required;
Rebase a TunedModel.
EXEC google.aiplatform.tuning_jobs.rebase_tuned_model
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required
@@json=
'{
"tunedModelRef": "{{ tunedModelRef }}",
"tuningJob": "{{ tuningJob }}",
"artifactDestination": "{{ artifactDestination }}",
"deployToSameEndpoint": {{ deployToSameEndpoint }}
}';