Table of Contents

Class CreateTuningJobConfig

Namespace
GenerativeAI.Types
Assembly
GenerativeAI.dll

Optional configuration for TuneAsync(string, TuningDataset, CreateTuningJobConfig?, CancellationToken), mirroring CreateTuningJobConfig of the google-genai SDK.

public class CreateTuningJobConfig
Inheritance
CreateTuningJobConfig
Inherited Members
Extension Methods

Remarks

Most options are Vertex AI only. On the Gemini API only TunedModelDisplayName, EpochCount, LearningRateMultiplier, BatchSize and LearningRate are supported; setting any other option throws NotSupportedException.

Properties

AdapterSize

Adapter size for tuning.

public AdapterSize? AdapterSize { get; set; }

Property Value

AdapterSize?

BaseTeacherModel

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

public string? BaseTeacherModel { get; set; }

Property Value

string

BatchSize

The batch size hyperparameter.

public int? BatchSize { get; set; }

Property Value

int?

Beta

Weight for KL Divergence regularization. Preference tuning only.

public double? Beta { get; set; }

Property Value

double?

CheckpointInterval

How often, in steps, to save checkpoints. Reinforcement tuning only.

public int? CheckpointInterval { get; set; }

Property Value

int?

CompositeRewardConfig

Composite reward function configuration. Reinforcement tuning only.

public CompositeReinforcementTuningRewardConfig? CompositeRewardConfig { get; set; }

Property Value

CompositeReinforcementTuningRewardConfig

CustomBaseModel

Custom base model weights (Cloud Storage path). Open source models only.

public string? CustomBaseModel { get; set; }

Property Value

string

Description

The description of the tuning job.

public string? Description { get; set; }

Property Value

string

EncryptionSpec

Customer-managed encryption key options for the tuning job.

public EncryptionSpec? EncryptionSpec { get; set; }

Property Value

EncryptionSpec

EpochCount

Number of complete passes over the training dataset.

public int? EpochCount { get; set; }

Property Value

int?

EvaluateInterval

How often, in steps, to evaluate during training. Reinforcement tuning only.

public int? EvaluateInterval { get; set; }

Property Value

int?

EvaluationConfig

Evaluation config for the tuning job. Requires at least one metric and an output config.

public EvaluationConfig? EvaluationConfig { get; set; }

Property Value

EvaluationConfig

ExportLastCheckpointOnly

If true, disable intermediate checkpoints and only export the last checkpoint.

public bool? ExportLastCheckpointOnly { get; set; }

Property Value

bool?

Labels

User-defined labels for the tuning job and the resources it creates.

public Dictionary<string, string>? Labels { get; set; }

Property Value

Dictionary<string, string>

LearningRate

The learning rate. Mutually exclusive with LearningRateMultiplier.

public double? LearningRate { get; set; }

Property Value

double?

LearningRateMultiplier

Multiplier for adjusting the default learning rate. Mutually exclusive with LearningRate.

public double? LearningRateMultiplier { get; set; }

Property Value

double?

MaxOutputTokens

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

public int? MaxOutputTokens { get; set; }

Property Value

int?

Method

The tuning method. Defaults to SUPERVISED_FINE_TUNING.

public TuningMethod? Method { get; set; }

Property Value

TuningMethod?

OutputUri

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

public string? OutputUri { get; set; }

Property Value

string

PreTunedModelCheckpointId

The checkpoint id of the pre-tuned model to continue tuning from (when the base model is a tuned model).

public string? PreTunedModelCheckpointId { get; set; }

Property Value

string

RewardConfig

Single reward function configuration. Reinforcement tuning only.

public SingleReinforcementTuningRewardConfig? RewardConfig { get; set; }

Property Value

SingleReinforcementTuningRewardConfig

SamplesPerPrompt

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

public int? SamplesPerPrompt { get; set; }

Property Value

int?

SftLossWeightMultiplier

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

public double? SftLossWeightMultiplier { get; set; }

Property Value

double?

ThinkingLevel

The maximum thinking depth. Reinforcement tuning only.

public ReinforcementTuningThinkingLevel? ThinkingLevel { get; set; }

Property Value

ReinforcementTuningThinkingLevel?

TunedModelDisplayName

The display name of the tuned model (up to 128 UTF-8 characters).

public string? TunedModelDisplayName { get; set; }

Property Value

string

TunedTeacherModelSource

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

public string? TunedTeacherModelSource { get; set; }

Property Value

string

TuningMode

Tuning mode (supervised fine tuning and distillation only).

public TuningMode? TuningMode { get; set; }

Property Value

TuningMode?

ValidationDataset

Validation dataset for tuning (JSONL).

public TuningValidationDataset? ValidationDataset { get; set; }

Property Value

TuningValidationDataset

ValidationDatasetUri

Cloud Storage path of the JSONL validation dataset. Reinforcement tuning only.

public string? ValidationDatasetUri { get; set; }

Property Value

string