Pause fine-tuning
Pause a fine-tune job.
ReturnsExpand Collapse
class FineTuningJob: …The fine_tuning.job object represents a fine-tuning job that has been created through the API.
The fine_tuning.job object represents a fine-tuning job that has been created through the API.
error: Optional[Error]For fine-tuning jobs that have failed, this will contain more information on the cause of the failure.
For fine-tuning jobs that have failed, this will contain more information on the cause of the failure.
The name of the fine-tuned model that is being created. The value will be null if the fine-tuning job is still running.
The Unix timestamp (in seconds) for when the fine-tuning job was finished. The value will be null if the fine-tuning job is still running.
hyperparameters: HyperparametersThe hyperparameters used for the fine-tuning job. This value will only be returned when running supervised jobs.
The hyperparameters used for the fine-tuning job. This value will only be returned when running supervised jobs.
batch_size: Optional[Union[Literal["auto"], int, null]]Number of examples in each batch. A larger batch size means that model parameters
are updated less frequently, but with lower variance.
Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the Files API.
status: Literal["validating_files", "queued", "running", 3 more]The current status of the fine-tuning job, which can be either validating_files, queued, running, succeeded, failed, or cancelled.
The current status of the fine-tuning job, which can be either validating_files, queued, running, succeeded, failed, or cancelled.
The total number of billable tokens processed by this fine-tuning job. The value will be null if the fine-tuning job is still running.
The file ID used for training. You can retrieve the training data with the Files API.
The file ID used for validation. You can retrieve the validation results with the Files API.
The Unix timestamp (in seconds) for when the fine-tuning job is estimated to finish. The value will be null if the fine-tuning job is not running.
A list of integrations to enable for this fine-tuning job.
A list of integrations to enable for this fine-tuning job.
The settings for your integration with Weights and Biases. This payload specifies the project that
metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags
to your run, and set a default entity (team, username, etc) to be associated with your run.
The settings for your integration with Weights and Biases. This payload specifies the project that metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags to your run, and set a default entity (team, username, etc) to be associated with your run.
The entity to use for the run. This allows you to set the team or username of the WandB user that you would like associated with the run. If not set, the default entity for the registered WandB API key is used.
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
method: Optional[Method]The method used for fine-tuning.
The method used for fine-tuning.
type: Literal["supervised", "dpo", "reinforcement"]The type of method. Is either supervised, dpo, or reinforcement.
The type of method. Is either supervised, dpo, or reinforcement.
dpo: Optional[DpoMethod]Configuration for the DPO fine-tuning method.
Configuration for the DPO fine-tuning method.
hyperparameters: Optional[DpoHyperparameters]The hyperparameters used for the DPO fine-tuning job.
The hyperparameters used for the DPO fine-tuning job.
batch_size: Optional[Union[Literal["auto"], int, null]]Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
beta: Optional[Union[Literal["auto"], float, null]]The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model.
The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model.
reinforcement: Optional[ReinforcementMethod]Configuration for the reinforcement fine-tuning method.
Configuration for the reinforcement fine-tuning method.
grader: GraderThe grader used for the fine-tuning job.
The grader used for the fine-tuning job.
class StringCheckGrader: …A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
class TextSimilarityGrader: …A TextSimilarityGrader object which grades text based on similarity metrics.
A TextSimilarityGrader object which grades text based on similarity metrics.
class ScoreModelGrader: …A ScoreModelGrader object that uses a model to assign a score to the input.
A ScoreModelGrader object that uses a model to assign a score to the input.
input: List[Input]The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.
The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.
content: InputContentInputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.
Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.
List[GraderInputItem]
sampling_params: Optional[SamplingParams]The sampling parameters for the model.
The sampling parameters for the model.
The maximum number of tokens the grader model may generate in its response.
reasoning_effort: Optional[ReasoningEffort]Constrains effort on reasoning for
reasoning models.
Currently supported values are none, minimal, low, medium, high, and xhigh. Reducing
reasoning effort can result in faster responses and fewer tokens used
on reasoning in a response.
gpt-5.1 defaults to none, which does not perform reasoning. The supported reasoning values for gpt-5.1 are none, low, medium, and high. Tool calls are supported for all reasoning values in gpt-5.1.
- All models before
gpt-5.1 default to medium reasoning effort, and do not support none.
- The
gpt-5-pro model defaults to (and only supports) high reasoning effort.
xhigh is supported for all models after gpt-5.1-codex-max.
Constrains effort on reasoning for
reasoning models.
Currently supported values are none, minimal, low, medium, high, and xhigh. Reducing
reasoning effort can result in faster responses and fewer tokens used
on reasoning in a response.
gpt-5.1defaults tonone, which does not perform reasoning. The supported reasoning values forgpt-5.1arenone,low,medium, andhigh. Tool calls are supported for all reasoning values in gpt-5.1.- All models before
gpt-5.1default tomediumreasoning effort, and do not supportnone. - The
gpt-5-promodel defaults to (and only supports)highreasoning effort. xhighis supported for all models aftergpt-5.1-codex-max.
class MultiGrader: …A MultiGrader object combines the output of multiple graders to produce a single score.
A MultiGrader object combines the output of multiple graders to produce a single score.
graders: GradersA StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
class StringCheckGrader: …A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
class TextSimilarityGrader: …A TextSimilarityGrader object which grades text based on similarity metrics.
A TextSimilarityGrader object which grades text based on similarity metrics.
class ScoreModelGrader: …A ScoreModelGrader object that uses a model to assign a score to the input.
A ScoreModelGrader object that uses a model to assign a score to the input.
input: List[Input]The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.
The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.
content: InputContentInputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.
Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.
List[GraderInputItem]
sampling_params: Optional[SamplingParams]The sampling parameters for the model.
The sampling parameters for the model.
The maximum number of tokens the grader model may generate in its response.
reasoning_effort: Optional[ReasoningEffort]Constrains effort on reasoning for
reasoning models.
Currently supported values are none, minimal, low, medium, high, and xhigh. Reducing
reasoning effort can result in faster responses and fewer tokens used
on reasoning in a response.
gpt-5.1 defaults to none, which does not perform reasoning. The supported reasoning values for gpt-5.1 are none, low, medium, and high. Tool calls are supported for all reasoning values in gpt-5.1.
- All models before
gpt-5.1 default to medium reasoning effort, and do not support none.
- The
gpt-5-pro model defaults to (and only supports) high reasoning effort.
xhigh is supported for all models after gpt-5.1-codex-max.
Constrains effort on reasoning for
reasoning models.
Currently supported values are none, minimal, low, medium, high, and xhigh. Reducing
reasoning effort can result in faster responses and fewer tokens used
on reasoning in a response.
gpt-5.1defaults tonone, which does not perform reasoning. The supported reasoning values forgpt-5.1arenone,low,medium, andhigh. Tool calls are supported for all reasoning values in gpt-5.1.- All models before
gpt-5.1default tomediumreasoning effort, and do not supportnone. - The
gpt-5-promodel defaults to (and only supports)highreasoning effort. xhighis supported for all models aftergpt-5.1-codex-max.
class LabelModelGrader: …A LabelModelGrader object which uses a model to assign labels to each item
in the evaluation.
A LabelModelGrader object which uses a model to assign labels to each item in the evaluation.
input: List[Input]
content: InputContentInputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.
Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.
List[GraderInputItem]
hyperparameters: Optional[ReinforcementHyperparameters]The hyperparameters used for the reinforcement fine-tuning job.
The hyperparameters used for the reinforcement fine-tuning job.
batch_size: Optional[Union[Literal["auto"], int, null]]Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
compute_multiplier: Optional[Union[Literal["auto"], float, null]]Multiplier on amount of compute used for exploring search space during training.
Multiplier on amount of compute used for exploring search space during training.
eval_interval: Optional[Union[Literal["auto"], int, null]]The number of training steps between evaluation runs.
The number of training steps between evaluation runs.
eval_samples: Optional[Union[Literal["auto"], int, null]]Number of evaluation samples to generate per training step.
Number of evaluation samples to generate per training step.
learning_rate_multiplier: Optional[Union[Literal["auto"], float, null]]Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
supervised: Optional[SupervisedMethod]Configuration for the supervised fine-tuning method.
Configuration for the supervised fine-tuning method.
hyperparameters: Optional[SupervisedHyperparameters]The hyperparameters used for the fine-tuning job.
The hyperparameters used for the fine-tuning job.
batch_size: Optional[Union[Literal["auto"], int, null]]Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
Pause fine-tuning
from openai import OpenAI
client = OpenAI()
client.fine_tuning.jobs.pause("ftjob-abc123")
{
"object": "fine_tuning.job",
"id": "ftjob-abc123",
"model": "gpt-4o-mini-2024-07-18",
"created_at": 1721764800,
"fine_tuned_model": null,
"organization_id": "org-123",
"result_files": [],
"status": "paused",
"validation_file": "file-abc123",
"training_file": "file-abc123"
}
Returns Examples
{
"object": "fine_tuning.job",
"id": "ftjob-abc123",
"model": "gpt-4o-mini-2024-07-18",
"created_at": 1721764800,
"fine_tuned_model": null,
"organization_id": "org-123",
"result_files": [],
"status": "paused",
"validation_file": "file-abc123",
"training_file": "file-abc123"
}