Package com.google.genai.types
Class CreateTuningJobConfig
java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.CreateTuningJobConfig
Fine-tuning job creation request - optional fields.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for CreateTuningJobConfig. -
Field Summary
Fields inherited from class com.google.genai.JsonSerializable
MAX_READ_LENGTH_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Optional<AdapterSize>Adapter size for tuning.The base teacher model that is being distilled.The batch size hyperparameter for tuning.beta()Weight for KL Divergence regularization, Preference Optimization tuning only.builder()Instantiates a builder for CreateTuningJobConfig.How often at steps to save checkpoints during training.Composite reward function configuration for reinforcement tuning.Custom base model for tuning.The description of the TuningJobabstract Optional<EncryptionSpec>The encryption spec of the tuning job.Number of complete passes the model makes over the entire training dataset during training.How often at steps to evaluate the tuning job during training.abstract Optional<EvaluationConfig>Evaluation config for the tuning job.If set to true, disable intermediate checkpoints and only the last checkpoint will be exported.static CreateTuningJobConfigDeserializes a JSON string to a CreateTuningJobConfig object.abstract Optional<HttpOptions>Used to override HTTP request options.labels()Optional.The learning rate for tuning.Multiplier for adjusting the default learning rate.The maximum number of tokens to generate per prompt.abstract Optional<TuningMethod>method()The method to use for tuning (SUPERVISED_FINE_TUNING or PREFERENCE_TUNING or DISTILLATION or REINFORCEMENT_TUNING).The Google Cloud Storage location where the tuning job outputs are written.The optional checkpoint id of the pre-tuned model to use for tuning, if applicable.Reward function configuration for reinforcement tuning.Number of different responses to generate per prompt during tuning.Multiplier for adjusting the weight of the SFT loss.abstract Optional<ReinforcementTuningThinkingLevel>Indicates the maximum thinking depth.abstract CreateTuningJobConfig.BuilderCreates a builder with the same values as this instance.The display name of the tuned Model.The resource name of the Tuned teacher model.abstract Optional<TuningMode>Tuning mode for tuning.abstract Optional<TuningValidationDataset>Validation dataset for tuning.Cloud Storage path to file containing validation dataset for tuning.Methods inherited from class com.google.genai.JsonSerializable
fromJsonNode, fromJsonString, objectMapper, setMaxReadLength, stringToJsonNode, toJson, toJsonNode, toJsonString
-
Constructor Details
-
CreateTuningJobConfig
public CreateTuningJobConfig()
-
-
Method Details
-
httpOptions
Used to override HTTP request options. -
method
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. -
validationDataset
Validation dataset for tuning. The dataset must be formatted as a JSONL file. -
tunedModelDisplayName
The display name of the tuned Model. The name can be up to 128 characters long and can consist of any UTF-8 characters. -
description
The description of the TuningJob -
epochCount
Number of complete passes the model makes over the entire training dataset during training. -
learningRateMultiplier
Multiplier for adjusting the default learning rate. 1P models only. Mutually exclusive with learning_rate. -
exportLastCheckpointOnly
If set to true, disable intermediate checkpoints and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints. -
preTunedModelCheckpointId
The optional checkpoint id of the pre-tuned model to use for tuning, if applicable. -
adapterSize
Adapter size for tuning. -
tuningMode
Tuning mode for tuning. -
customBaseModel
Custom base model for tuning. This is only supported for OSS models in Gemini Enterprise Agent Platform. -
batchSize
The batch size hyperparameter for tuning. This is only supported for OSS models in Gemini Enterprise Agent Platform. -
learningRate
The learning rate for tuning. OSS models only. Mutually exclusive with learning_rate_multiplier. -
evaluationConfig
Evaluation config for the tuning job. -
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. -
beta
Weight for KL Divergence regularization, Preference Optimization tuning only. -
baseTeacherModel
The base teacher model that is being distilled. Distillation only. -
tunedTeacherModelSource
The resource name of the Tuned teacher model. Distillation only. -
sftLossWeightMultiplier
Multiplier for adjusting the weight of the SFT loss. Distillation only. -
outputUri
The Google Cloud Storage location where the tuning job outputs are written. -
encryptionSpec
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. -
rewardConfig
Reward function configuration for reinforcement tuning. Reinforcement tuning only. -
compositeRewardConfig
Composite reward function configuration for reinforcement tuning. Reinforcement tuning only. -
samplesPerPrompt
Number of different responses to generate per prompt during tuning. Reinforcement tuning only. -
evaluateInterval
How often at steps to evaluate the tuning job during training. Reinforcement tuning only. -
checkpointInterval
How often at steps to save checkpoints during training. Reinforcement tuning only. -
maxOutputTokens
The maximum number of tokens to generate per prompt. Reinforcement tuning only. -
thinkingLevel
Indicates the maximum thinking depth. Use with earlier models shall result in error. Reinforcement tuning only. -
validationDatasetUri
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. -
builder
Instantiates a builder for CreateTuningJobConfig. -
toBuilder
Creates a builder with the same values as this instance. -
fromJson
Deserializes a JSON string to a CreateTuningJobConfig object.
-