Skip to main content

Create Fine-tuning Job

Parameters

Union[str, Literal['babbage-002', 'davinci-002', 'gpt-3.5-turbo', 'gpt-4o-mini']]
required
The name of the model to fine-tune. See supported models.
str
required
The ID of an uploaded file that contains training data.Requirements:
Hyperparameters
Deprecated: Use method parameter instead.
List[Integration]
List of integrations to enable. Currently supports Weights & Biases:
Dict[str, str]
Set of up to 16 key-value pairs for storing additional information.
  • Keys: max 64 characters
  • Values: max 512 characters
Method
The fine-tuning method configuration. Supports three types:Supervised Learning:
DPO (Direct Preference Optimization):
Reinforcement Learning:
int
Controls reproducibility. Using the same seed and parameters should produce similar results, but may differ in rare cases.
str
A string of up to 64 characters added to your fine-tuned model name.Example: suffix="custom-model-name" produces ft:gpt-4o-mini:openai:custom-model-name:7p4lURel
str
The ID of an uploaded validation file (JSONL format with purpose="fine-tune").Used to generate validation metrics during fine-tuning. Must not overlap with training data.

Response

Examples

Basic Fine-tuning Job

Fine-tuning with Custom Hyperparameters

Fine-tuning with Validation Data

Fine-tuning with Weights & Biases Integration

Fine-tuning with Metadata

Other Job Operations

Retrieve Job Status

List All Jobs

List Jobs with Metadata Filter

Cancel a Job

Pause and Resume Jobs

List Job Events

Async Usage

Training Data Format

Chat Format (GPT-4, GPT-3.5)

Completions Format (Babbage, Davinci)

Notes

  • Fine-tuning jobs are queued and processed asynchronously
  • Monitor job status with retrieve() or set up WandB integration
  • Use list_events() to track training progress
  • The trained_tokens field determines billing
  • Result files contain detailed metrics and can be downloaded via the Files API
  • See the Fine-tuning Guide for best practices