CreateTuningJobConfig

@Serializable
data class CreateTuningJobConfig(val httpOptions: HttpOptions? = null, val method: TuningMethod? = null, val validationDataset: TuningValidationDataset? = null, val tunedModelDisplayName: String? = null, val description: String? = null, val epochCount: Int? = null, val learningRateMultiplier: Double? = null, val exportLastCheckpointOnly: Boolean? = null, val preTunedModelCheckpointId: String? = null, val adapterSize: AdapterSize? = null, val tuningMode: TuningMode? = null, val customBaseModel: String? = null, val batchSize: Int? = null, val learningRate: Double? = null, val labels: Map<String, String>? = null, val beta: Double? = null, val baseTeacherModel: String? = null, val tunedTeacherModelSource: String? = null, val sftLossWeightMultiplier: Double? = null, val outputUri: String? = null, val encryptionSpec: EncryptionSpec? = null, val rewardConfig: SingleReinforcementTuningRewardConfig? = null, val compositeRewardConfig: CompositeReinforcementTuningRewardConfig? = null, val samplesPerPrompt: Int? = null, val evaluateInterval: Int? = null, val checkpointInterval: Int? = null, val maxOutputTokens: Int? = null, val thinkingLevel: ReinforcementTuningThinkingLevel? = null, val validationDatasetUri: String? = null)

Fine-tuning job creation request - optional fields.

Constructors

Link copied to clipboard
constructor(httpOptions: HttpOptions? = null, method: TuningMethod? = null, validationDataset: TuningValidationDataset? = null, tunedModelDisplayName: String? = null, description: String? = null, epochCount: Int? = null, learningRateMultiplier: Double? = null, exportLastCheckpointOnly: Boolean? = null, preTunedModelCheckpointId: String? = null, adapterSize: AdapterSize? = null, tuningMode: TuningMode? = null, customBaseModel: String? = null, batchSize: Int? = null, learningRate: Double? = null, labels: Map<String, String>? = null, beta: Double? = null, baseTeacherModel: String? = null, tunedTeacherModelSource: String? = null, sftLossWeightMultiplier: Double? = null, outputUri: String? = null, encryptionSpec: EncryptionSpec? = null, rewardConfig: SingleReinforcementTuningRewardConfig? = null, compositeRewardConfig: CompositeReinforcementTuningRewardConfig? = null, samplesPerPrompt: Int? = null, evaluateInterval: Int? = null, checkpointInterval: Int? = null, maxOutputTokens: Int? = null, thinkingLevel: ReinforcementTuningThinkingLevel? = null, validationDatasetUri: String? = null)

Properties

Link copied to clipboard

Adapter size for tuning.

Link copied to clipboard

The base teacher model that is being distilled. Distillation only.

Link copied to clipboard
val batchSize: Int? = null

The batch size hyperparameter for tuning. This is only supported for OSS models in Gemini Enterprise Agent Platform.

Link copied to clipboard
val beta: Double? = null

Weight for KL Divergence regularization, Preference Optimization tuning only.

Link copied to clipboard
val checkpointInterval: Int? = null

How often at steps to save checkpoints during training. Reinforcement tuning only.

Link copied to clipboard

Composite reward function configuration for reinforcement tuning. Reinforcement tuning only.

Link copied to clipboard
val customBaseModel: String? = null

Custom base model for tuning. This is only supported for OSS models in Gemini Enterprise Agent Platform.

Link copied to clipboard
val description: String? = null

The description of the TuningJob

Link copied to clipboard

The encryption spec of the tuning job. Customer-managed encryption key options for a TuningJob. If this is set, then all resources created by the TuningJob will be encrypted with provided encryption key.

Link copied to clipboard
val epochCount: Int? = null

Number of complete passes the model makes over the entire training dataset during training.

Link copied to clipboard
val evaluateInterval: Int? = null

How often at steps to evaluate the tuning job during training. Reinforcement tuning only.

Link copied to clipboard

If set to true, disable intermediate checkpoints and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints.

Link copied to clipboard

Used to override HTTP request options.

Link copied to clipboard
val labels: Map<String, String>? = null

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.

Link copied to clipboard
val learningRate: Double? = null

The learning rate for tuning. OSS models only. Mutually exclusive with learning_rate_multiplier.

Link copied to clipboard

Multiplier for adjusting the default learning rate. 1P models only. Mutually exclusive with learning_rate.

Link copied to clipboard
val maxOutputTokens: Int? = null

The maximum number of tokens to generate per prompt. Reinforcement tuning only.

Link copied to clipboard
val method: TuningMethod? = null

The method to use for tuning (SUPERVISED_FINE_TUNING or PREFERENCE_TUNING or DISTILLATION or REINFORCEMENT_TUNING). If not set, the default method (SFT) will be used.

Link copied to clipboard
val outputUri: String? = null

The Google Cloud Storage location where the tuning job outputs are written.

Link copied to clipboard

The optional checkpoint id of the pre-tuned model to use for tuning, if applicable.

Link copied to clipboard

Reward function configuration for reinforcement tuning. Reinforcement tuning only.

Link copied to clipboard
val samplesPerPrompt: Int? = null

Number of different responses to generate per prompt during tuning. Reinforcement tuning only.

Link copied to clipboard

Multiplier for adjusting the weight of the SFT loss. Distillation only.

Link copied to clipboard

Indicates the maximum thinking depth. Use with earlier models shall result in error. Reinforcement tuning only.

Link copied to clipboard

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

Link copied to clipboard

The resource name of the Tuned teacher model. Distillation only.

Link copied to clipboard
val tuningMode: TuningMode? = null

Tuning mode for tuning.

Link copied to clipboard

Validation dataset for tuning. The dataset must be formatted as a JSONL file.

Link copied to clipboard

Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file. If no validation dataset is provided, by default the API splits 25% of the training dataset or 50 examples, whichever is larger, as the validation dataset. Reinforcement tuning only.