Table of Contents

Class TuningJob

Namespace
GenerativeAI.Types
Assembly
GenerativeAI.dll

Represents a model tuning job. A tuning job is used to fine-tune a base model with custom training data to create a specialized model tailored to specific tasks or domains.

public class TuningJob
Inheritance
TuningJob
Inherited Members
Extension Methods

Properties

BaseModel

The base model that is being tuned. See Supported models.

[JsonPropertyName("baseModel")]
public string? BaseModel { get; set; }

Property Value

string

CreateTime

Output only. Time when the TuningJob was created.

[JsonPropertyName("createTime")]
public Timestamp? CreateTime { get; set; }

Property Value

Timestamp

CustomBaseModel

Optional. The user-provided path to custom model weights. Set this field to tune a custom model. The path must be a Cloud Storage directory that contains the model weights in .safetensors format along with associated model metadata files. If this field is set, the base_model field must still be set to indicate which base model the custom model is derived from. This feature is only available for open source models.

[JsonPropertyName("customBaseModel")]
public string? CustomBaseModel { get; set; }

Property Value

string

Description

Optional. The description of the TuningJob.

[JsonPropertyName("description")]
public string? Description { get; set; }

Property Value

string

DistillationSamplingSpec

Spec for the teacher model sampling of a distillation job.

[JsonPropertyName("distillationSamplingSpec")]
public DistillationSamplingSpec? DistillationSamplingSpec { get; set; }

Property Value

DistillationSamplingSpec

DistillationSpec

Tuning Spec for Distillation.

[JsonPropertyName("distillationSpec")]
public DistillationSpec? DistillationSpec { get; set; }

Property Value

DistillationSpec

EncryptionSpec

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.

[JsonPropertyName("encryptionSpec")]
public EncryptionSpec? EncryptionSpec { get; set; }

Property Value

EncryptionSpec

EndTime

Output only. Time when the TuningJob entered any of the following JobStates: JOB_STATE_SUCCEEDED, JOB_STATE_FAILED, JOB_STATE_CANCELLED, JOB_STATE_EXPIRED.

[JsonPropertyName("endTime")]
public Timestamp? EndTime { get; set; }

Property Value

Timestamp

Error

Output only. Only populated when job's state is JOB_STATE_FAILED or JOB_STATE_CANCELLED.

[JsonPropertyName("error")]
public GoogleRpcStatus? Error { get; set; }

Property Value

GoogleRpcStatus

EvaluateDatasetRuns

Output only. Evaluation runs for the tuning job.

[JsonPropertyName("evaluateDatasetRuns")]
public List<EvaluateDatasetRun>? EvaluateDatasetRuns { get; set; }

Property Value

List<EvaluateDatasetRun>

EvaluationConfig

Optional. Configuration for model evaluation during tuning.

[JsonPropertyName("evaluationConfig")]
public EvaluationConfig? EvaluationConfig { get; set; }

Property Value

EvaluationConfig

Experiment

Output only. The Experiment associated with this TuningJob.

[JsonPropertyName("experiment")]
public string? Experiment { get; set; }

Property Value

string

FullFineTuningSpec

Tuning Spec for Full Fine Tuning.

[JsonPropertyName("fullFineTuningSpec")]
public FullFineTuningSpec? FullFineTuningSpec { get; set; }

Property Value

FullFineTuningSpec

GcsMetricsUri

Output only. The Cloud Storage metrics URI associated with this tuning job.

[JsonPropertyName("gcsMetricsUri")]
public string? GcsMetricsUri { get; set; }

Property Value

string

IsCompleted

Returns true when the job reached a terminal state (succeeded, partially succeeded, failed, cancelled or expired).

[JsonIgnore]
public bool IsCompleted { get; }

Property Value

bool

Labels

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.

[JsonPropertyName("labels")]
public Dictionary<string, string>? Labels { get; set; }

Property Value

Dictionary<string, string>

Name

Output only. Identifier. Resource name of a TuningJob. Format: projects/{project}/locations/{location}/tuningJobs/{tuning_job}

[JsonPropertyName("name")]
public string? Name { get; set; }

Property Value

string

OutputUri

Optional. Cloud Storage path to the directory where tuning job outputs are written to. This field is only available and required for open source models.

[JsonPropertyName("outputUri")]
public string? OutputUri { get; set; }

Property Value

string

PartnerModelTuningSpec

Tuning Spec for open sourced and third party Partner models.

[JsonPropertyName("partnerModelTuningSpec")]
public PartnerModelTuningSpec? PartnerModelTuningSpec { get; set; }

Property Value

PartnerModelTuningSpec

PipelineJob

Output only. The resource name of the PipelineJob associated with the TuningJob. Format: projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}.

[JsonPropertyName("pipelineJob")]
public string? PipelineJob { get; set; }

Property Value

string

PreTunedModel

The pre-tuned model for continuous tuning.

[JsonPropertyName("preTunedModel")]
public PreTunedModel? PreTunedModel { get; set; }

Property Value

PreTunedModel

PreferenceOptimizationSpec

Tuning Spec for Preference Optimization.

[JsonPropertyName("preferenceOptimizationSpec")]
public PreferenceOptimizationSpec? PreferenceOptimizationSpec { get; set; }

Property Value

PreferenceOptimizationSpec

ReinforcementTuningSpec

Tuning Spec for Reinforcement Tuning.

[JsonPropertyName("reinforcementTuningSpec")]
public ReinforcementTuningSpec? ReinforcementTuningSpec { get; set; }

Property Value

ReinforcementTuningSpec

ServiceAccount

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.

[JsonPropertyName("serviceAccount")]
public string? ServiceAccount { get; set; }

Property Value

string

StartTime

Output only. Time when the TuningJob for the first time entered the JOB_STATE_RUNNING state.

[JsonPropertyName("startTime")]
public Timestamp? StartTime { get; set; }

Property Value

Timestamp

State

Output only. The detailed state of the job.

[JsonPropertyName("state")]
public JobState? State { get; set; }

Property Value

JobState?

SupervisedTuningSpec

Tuning Spec for Supervised Fine Tuning.

[JsonPropertyName("supervisedTuningSpec")]
public SupervisedTuningSpec? SupervisedTuningSpec { get; set; }

Property Value

SupervisedTuningSpec

TunedModel

Output only. The tuned model resources associated with this TuningJob.

[JsonPropertyName("tunedModel")]
public TunedModel? TunedModel { get; set; }

Property Value

TunedModel

TunedModelDisplayName

Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters.

[JsonPropertyName("tunedModelDisplayName")]
public string? TunedModelDisplayName { get; set; }

Property Value

string

TuningDataStats

Output only. The tuning data statistics associated with this TuningJob.

[JsonPropertyName("tuningDataStats")]
public TuningDataStats? TuningDataStats { get; set; }

Property Value

TuningDataStats

TuningJobMetadata

Output only. Tuning job metadata.

[JsonPropertyName("tuningJobMetadata")]
public TuningJobMetadata? TuningJobMetadata { get; set; }

Property Value

TuningJobMetadata

TuningJobState

Output only. The detail state of the tuning job (while the overall State is running).

[JsonPropertyName("tuningJobState")]
public TuningJobState? TuningJobState { get; set; }

Property Value

TuningJobState?

UpdateTime

Output only. Time when the TuningJob was most recently updated.

[JsonPropertyName("updateTime")]
public Timestamp? UpdateTime { get; set; }

Property Value

Timestamp

VeoLoraTuningSpec

Tuning Spec for Veo LoRA Tuning.

[JsonPropertyName("veoLoraTuningSpec")]
public VeoLoraTuningSpec? VeoLoraTuningSpec { get; set; }

Property Value

VeoLoraTuningSpec

VeoTuningSpec

Tuning Spec for Veo Tuning.

[JsonPropertyName("veoTuningSpec")]
public VeoTuningSpec? VeoTuningSpec { get; set; }

Property Value

VeoTuningSpec