Class CreateTuningJobConfig

java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.CreateTuningJobConfig

public abstract class CreateTuningJobConfig extends JsonSerializable
Fine-tuning job creation request - optional fields.
  • Constructor Details

    • CreateTuningJobConfig

      public CreateTuningJobConfig()
  • Method Details

    • httpOptions

      public abstract Optional<HttpOptions> httpOptions()
      Used to override HTTP request options.
    • method

      public abstract Optional<TuningMethod> 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

      public abstract Optional<TuningValidationDataset> validationDataset()
      Validation dataset for tuning. The dataset must be formatted as a JSONL file.
    • tunedModelDisplayName

      public abstract Optional<String> 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

      public abstract Optional<String> description()
      The description of the TuningJob
    • epochCount

      public abstract Optional<Integer> epochCount()
      Number of complete passes the model makes over the entire training dataset during training.
    • learningRateMultiplier

      public abstract Optional<Float> learningRateMultiplier()
      Multiplier for adjusting the default learning rate. 1P models only. Mutually exclusive with learning_rate.
    • exportLastCheckpointOnly

      public abstract Optional<Boolean> exportLastCheckpointOnly()
      If set to true, disable intermediate checkpoints and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints.
    • preTunedModelCheckpointId

      public abstract Optional<String> preTunedModelCheckpointId()
      The optional checkpoint id of the pre-tuned model to use for tuning, if applicable.
    • adapterSize

      public abstract Optional<AdapterSize> adapterSize()
      Adapter size for tuning.
    • tuningMode

      public abstract Optional<TuningMode> tuningMode()
      Tuning mode for tuning.
    • customBaseModel

      public abstract Optional<String> customBaseModel()
      Custom base model for tuning. This is only supported for OSS models in Gemini Enterprise Agent Platform.
    • batchSize

      public abstract Optional<Integer> batchSize()
      The batch size hyperparameter for tuning. This is only supported for OSS models in Gemini Enterprise Agent Platform.
    • learningRate

      public abstract Optional<Float> learningRate()
      The learning rate for tuning. OSS models only. Mutually exclusive with learning_rate_multiplier.
    • evaluationConfig

      public abstract Optional<EvaluationConfig> evaluationConfig()
      Evaluation config for the tuning job.
    • labels

      public abstract Optional<Map<String,String>> 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

      public abstract Optional<Float> beta()
      Weight for KL Divergence regularization, Preference Optimization tuning only.
    • baseTeacherModel

      public abstract Optional<String> baseTeacherModel()
      The base teacher model that is being distilled. Distillation only.
    • tunedTeacherModelSource

      public abstract Optional<String> tunedTeacherModelSource()
      The resource name of the Tuned teacher model. Distillation only.
    • sftLossWeightMultiplier

      public abstract Optional<Float> sftLossWeightMultiplier()
      Multiplier for adjusting the weight of the SFT loss. Distillation only.
    • outputUri

      public abstract Optional<String> outputUri()
      The Google Cloud Storage location where the tuning job outputs are written.
    • encryptionSpec

      public abstract Optional<EncryptionSpec> 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

      public abstract Optional<SingleReinforcementTuningRewardConfig> rewardConfig()
      Reward function configuration for reinforcement tuning. Reinforcement tuning only.
    • compositeRewardConfig

      public abstract Optional<CompositeReinforcementTuningRewardConfig> compositeRewardConfig()
      Composite reward function configuration for reinforcement tuning. Reinforcement tuning only.
    • samplesPerPrompt

      public abstract Optional<Integer> samplesPerPrompt()
      Number of different responses to generate per prompt during tuning. Reinforcement tuning only.
    • evaluateInterval

      public abstract Optional<Integer> evaluateInterval()
      How often at steps to evaluate the tuning job during training. Reinforcement tuning only.
    • checkpointInterval

      public abstract Optional<Integer> checkpointInterval()
      How often at steps to save checkpoints during training. Reinforcement tuning only.
    • maxOutputTokens

      public abstract Optional<Integer> maxOutputTokens()
      The maximum number of tokens to generate per prompt. Reinforcement tuning only.
    • thinkingLevel

      public abstract Optional<ReinforcementTuningThinkingLevel> thinkingLevel()
      Indicates the maximum thinking depth. Use with earlier models shall result in error. Reinforcement tuning only.
    • validationDatasetUri

      public abstract Optional<String> 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

      public static CreateTuningJobConfig.Builder builder()
      Instantiates a builder for CreateTuningJobConfig.
    • toBuilder

      public abstract CreateTuningJobConfig.Builder toBuilder()
      Creates a builder with the same values as this instance.
    • fromJson

      public static CreateTuningJobConfig fromJson(String jsonString)
      Deserializes a JSON string to a CreateTuningJobConfig object.