Skip to main content
The SDK’s tuning implementation is experimental, and may change in future versions.

Method

Creates a tuning job and returns the TuningJob object. This method initiates a fine-tuning process for a specified base model using the provided training dataset.
string
required
The name of the model to tune. For Vertex AI, this can also be a pre-tuned model resource name starting with projects/.
TuningDataset
required
The training dataset to use for tuning. Can be one of:
  • gcs_uri: GCS bucket path (Vertex AI only)
  • vertex_dataset_resource: Vertex AI Dataset resource (Vertex AI only)
  • examples: Inline training examples (Gemini API only)
CreateTuningJobConfig
Configuration options for the tuning job:

Response

string
The resource name of the tuning job
JobState
Current state of the tuning job. One of:
  • JOB_STATE_QUEUED: Job is queued
  • JOB_STATE_PENDING: Job is pending
  • JOB_STATE_RUNNING: Job is running
  • JOB_STATE_SUCCEEDED: Job completed successfully
  • JOB_STATE_FAILED: Job failed
  • JOB_STATE_CANCELLED: Job was cancelled
string
Timestamp when the job was created
string
Timestamp when the job started running
string
Timestamp when the job completed
string
The base model being tuned
TunedModel
Information about the resulting tuned model

Usage

Basic Example

Polling for Completion

With Inline Examples (Gemini API)

See Also