The SDK’s tuning implementation is experimental, and may change in future versions.
Method
TuningJob object. This method initiates a fine-tuning process for a specified base model using the provided training dataset.
The name of the model to tune. For Vertex AI, this can also be a pre-tuned model resource name starting with
projects/.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)
Configuration options for the tuning job:
Response
The resource name of the tuning job
Current state of the tuning job. One of:
JOB_STATE_QUEUED: Job is queuedJOB_STATE_PENDING: Job is pendingJOB_STATE_RUNNING: Job is runningJOB_STATE_SUCCEEDED: Job completed successfullyJOB_STATE_FAILED: Job failedJOB_STATE_CANCELLED: Job was cancelled
Timestamp when the job was created
Timestamp when the job started running
Timestamp when the job completed
The base model being tuned
Information about the resulting tuned model
Usage
Basic Example
Polling for Completion
With Inline Examples (Gemini API)
See Also
- tunings.get - Retrieve tuning job status
- tunings.list - List all tuning jobs
- tunings.cancel - Cancel a running tuning job