Skip to content
Primary navigation

Fine Tuning

Fine TuningJobs

Manage fine-tuning jobs to tailor a model to your specific training data.

resource openai_fine_tuning_job

required Expand Collapse
model: String

The name of the model to fine-tune. You can select one of the supported models.

training_file: String

The ID of an uploaded file that contains training data.

See upload file for how to upload a file.

Your dataset must be formatted as a JSONL file. Additionally, you must upload your file with the purpose fine-tune.

The contents of the file should differ depending on if the model uses the chat, completions format, or if the fine-tuning method uses the preference format.

See the fine-tuning guide for more details.

optional Expand Collapse
seed?: Int64

The seed controls the reproducibility of the job. Passing in the same seed and job parameters should produce the same results, but may differ in rare cases. If a seed is not specified, one will be generated for you.

suffix?: String

A string of up to 64 characters that will be added to your fine-tuned model name.

For example, a suffix of “custom-model-name” would produce a model name like ft:gpt-4o-mini:openai:custom-model-name:7p4lURel.

validation_file?: String

The ID of an uploaded file that contains validation data.

If you provide this file, the data is used to generate validation metrics periodically during fine-tuning. These metrics can be viewed in the fine-tuning results file. The same data should not be present in both train and validation files.

Your dataset must be formatted as a JSONL file. You must upload your file with the purpose fine-tune.

See the fine-tuning guide for more details.

metadata?: Map[String]

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.

integrations?: List[Attributes]

A list of integrations to enable for your fine-tuning job.

type: String

The type of integration to enable. Currently, only “wandb” (Weights and Biases) is supported.

wandb: Attributes

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.

project: String

The name of the project that the new run will be created under.

entity?: String

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.

name?: String

A display name to set for the run. If not set, we will use the Job ID as the name.

tags?: List[String]

A list of tags to be attached to the newly created run. These tags are passed through directly to WandB. Some default tags are generated by OpenAI: “openai/finetune”, “openai/{base-model}”, “openai/{ftjob-abcdef}”.

Deprecatedhyperparameters?: Attributes

The hyperparameters used for the fine-tuning job. This value is now deprecated in favor of method, and should be passed in under the method parameter.

batch_size?: Dynamic String | Int64

Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.

learning_rate_multiplier?: Dynamic String | Float64

Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.

n_epochs?: Dynamic String | Int64

The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.

method?: Attributes

The method used for fine-tuning.

type: String

The type of method. Is either supervised, dpo, or reinforcement.

dpo?: Attributes

Configuration for the DPO fine-tuning method.

hyperparameters?: Attributes

The hyperparameters used for the DPO fine-tuning job.

batch_size?: Dynamic String | Int64

Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.

beta?: Dynamic String | Float64

The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model.

learning_rate_multiplier?: Dynamic String | Float64

Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.

n_epochs?: Dynamic String | Int64

The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.

reinforcement?: Attributes

Configuration for the reinforcement fine-tuning method.

grader: Attributes

The grader used for the fine-tuning job.

input?: String

The input text. This may include template strings.

name: String

The name of the grader.

operation?: String

The string check operation to perform. One of eq, ne, like, or ilike.

reference?: String

The reference text. This may include template strings.

type?: String

The object type, which is always string_check.

evaluation_metric?: String

The evaluation metric to use. One of cosine, fuzzy_match, bleu, gleu, meteor, rouge_1, rouge_2, rouge_3, rouge_4, rouge_5, or rouge_l.

source?: String

The source code of the python script.

image_tag?: String

The image tag to use for the python script.

model?: String

The model to use for the evaluation.

range?: List[Float64]

The range of the score. Defaults to [0, 1].

sampling_params?: Attributes

The sampling parameters for the model.

max_completions_tokens?: Int64

The maximum number of tokens the grader model may generate in its response.

reasoning_effort?: String

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.
seed?: Int64

A seed value to initialize the randomness, during sampling.

temperature?: Float64

A higher temperature increases randomness in the outputs.

top_p?: Float64

An alternative to temperature for nucleus sampling; 1.0 includes all tokens.

calculate_output?: String

A formula to calculate the output based on grader results.

graders?: Attributes

A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.

input?: String

The input text. This may include template strings.

name: String

The name of the grader.

operation?: String

The string check operation to perform. One of eq, ne, like, or ilike.

reference?: String

The reference text. This may include template strings.

type?: String

The object type, which is always string_check.

evaluation_metric?: String

The evaluation metric to use. One of cosine, fuzzy_match, bleu, gleu, meteor, rouge_1, rouge_2, rouge_3, rouge_4, rouge_5, or rouge_l.

source?: String

The source code of the python script.

image_tag?: String

The image tag to use for the python script.

model?: String

The model to use for the evaluation.

range?: List[Float64]

The range of the score. Defaults to [0, 1].

sampling_params?: Attributes

The sampling parameters for the model.

max_completions_tokens?: Int64

The maximum number of tokens the grader model may generate in its response.

reasoning_effort?: String

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.
seed?: Int64

A seed value to initialize the randomness, during sampling.

temperature?: Float64

A higher temperature increases randomness in the outputs.

top_p?: Float64

An alternative to temperature for nucleus sampling; 1.0 includes all tokens.

labels?: List[String]

The labels to assign to each item in the evaluation.

passing_labels?: List[String]

The labels that indicate a passing result. Must be a subset of labels.

hyperparameters?: Attributes

The hyperparameters used for the reinforcement fine-tuning job.

batch_size?: Dynamic String | Int64

Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.

compute_multiplier?: Dynamic String | Float64

Multiplier on amount of compute used for exploring search space during training.

eval_interval?: Dynamic String | Int64

The number of training steps between evaluation runs.

eval_samples?: Dynamic String | Int64

Number of evaluation samples to generate per training step.

learning_rate_multiplier?: Dynamic String | Float64

Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.

n_epochs?: Dynamic String | Int64

The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.

reasoning_effort?: String

Level of reasoning effort.

supervised?: Attributes

Configuration for the supervised fine-tuning method.

hyperparameters?: Attributes

The hyperparameters used for the fine-tuning job.

batch_size?: Dynamic String | Int64

Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.

learning_rate_multiplier?: Dynamic String | Float64

Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.

n_epochs?: Dynamic String | Int64

The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.

computed Expand Collapse
id: String

The object identifier, which can be referenced in the API endpoints.

created_at: Int64

The Unix timestamp (in seconds) for when the fine-tuning job was created.

estimated_finish: Int64

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.

fine_tuned_model: String

The name of the fine-tuned model that is being created. The value will be null if the fine-tuning job is still running.

finished_at: Int64

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.

object: String

The object type, which is always “fine_tuning.job”.

organization_id: String

The organization that owns the fine-tuning job.

status: String

The current status of the fine-tuning job, which can be either validating_files, queued, running, succeeded, failed, or cancelled.

trained_tokens: Int64

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.

result_files: List[String]

The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the Files API.

error: Attributes

For fine-tuning jobs that have failed, this will contain more information on the cause of the failure.

code: String

A machine-readable error code.

message: String

A human-readable error message.

param: String

The parameter that was invalid, usually training_file or validation_file. This field will be null if the failure was not parameter-specific.

openai_fine_tuning_job

resource "openai_fine_tuning_job" "example_fine_tuning_job" {
  model = "gpt-4o-mini"
  training_file = "file-abc123"
  hyperparameters = {
    batch_size = "auto"
    learning_rate_multiplier = "auto"
    n_epochs = "auto"
  }
  integrations = [{
    type = "wandb"
    wandb = {
      project = "my-wandb-project"
      entity = "entity"
      name = "name"
      tags = ["custom-tag"]
    }
  }]
  metadata = {
    foo = "string"
  }
  method = {
    type = "supervised"
    dpo = {
      hyperparameters = {
        batch_size = "auto"
        beta = "auto"
        learning_rate_multiplier = "auto"
        n_epochs = "auto"
      }
    }
    reinforcement = {
      grader = {
        input = "input"
        name = "name"
        operation = "eq"
        reference = "reference"
        type = "string_check"
      }
      hyperparameters = {
        batch_size = "auto"
        compute_multiplier = "auto"
        eval_interval = "auto"
        eval_samples = "auto"
        learning_rate_multiplier = "auto"
        n_epochs = "auto"
        reasoning_effort = "default"
      }
    }
    supervised = {
      hyperparameters = {
        batch_size = "auto"
        learning_rate_multiplier = "auto"
        n_epochs = "auto"
      }
    }
  }
  seed = 42
  suffix = "x"
  validation_file = "file-abc123"
}

data openai_fine_tuning_job

optional Expand Collapse
fine_tuning_job_id?: String
find_one_by?: Attributes
metadata?: Map[String]

Optional metadata filter. To filter, use the syntax metadata[k]=v. Alternatively, set metadata=null to indicate no metadata.

computed Expand Collapse
id: String
created_at: Int64

The Unix timestamp (in seconds) for when the fine-tuning job was created.

estimated_finish: Int64

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.

fine_tuned_model: String

The name of the fine-tuned model that is being created. The value will be null if the fine-tuning job is still running.

finished_at: Int64

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.

model: String

The base model that is being fine-tuned.

object: String

The object type, which is always “fine_tuning.job”.

organization_id: String

The organization that owns the fine-tuning job.

seed: Int64

The seed used for the fine-tuning job.

status: String

The current status of the fine-tuning job, which can be either validating_files, queued, running, succeeded, failed, or cancelled.

trained_tokens: Int64

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.

training_file: String

The file ID used for training. You can retrieve the training data with the Files API.

validation_file: String

The file ID used for validation. You can retrieve the validation results with the Files API.

metadata: Map[String]

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.

result_files: List[String]

The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the Files API.

error: Attributes

For fine-tuning jobs that have failed, this will contain more information on the cause of the failure.

code: String

A machine-readable error code.

message: String

A human-readable error message.

param: String

The parameter that was invalid, usually training_file or validation_file. This field will be null if the failure was not parameter-specific.

hyperparameters: Attributes

The hyperparameters used for the fine-tuning job. This value will only be returned when running supervised jobs.

batch_size: Dynamic String | Int64

Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.

learning_rate_multiplier: Dynamic String | Float64

Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.

n_epochs: Dynamic String | Int64

The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.

integrations: List[Attributes]

A list of integrations to enable for this fine-tuning job.

type: String

The type of the integration being enabled for the fine-tuning job

wandb: Attributes

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.

project: String

The name of the project that the new run will be created under.

entity: String

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.

name: String

A display name to set for the run. If not set, we will use the Job ID as the name.

tags: List[String]

A list of tags to be attached to the newly created run. These tags are passed through directly to WandB. Some default tags are generated by OpenAI: “openai/finetune”, “openai/{base-model}”, “openai/{ftjob-abcdef}”.

method: Attributes

The method used for fine-tuning.

type: String

The type of method. Is either supervised, dpo, or reinforcement.

dpo: Attributes

Configuration for the DPO fine-tuning method.

hyperparameters: Attributes

The hyperparameters used for the DPO fine-tuning job.

batch_size: Dynamic String | Int64

Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.

beta: Dynamic String | Float64

The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model.

learning_rate_multiplier: Dynamic String | Float64

Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.

n_epochs: Dynamic String | Int64

The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.

reinforcement: Attributes

Configuration for the reinforcement fine-tuning method.

grader: Attributes

The grader used for the fine-tuning job.

input: String

The input text. This may include template strings.

name: String

The name of the grader.

operation: String

The string check operation to perform. One of eq, ne, like, or ilike.

reference: String

The reference text. This may include template strings.

type: String

The object type, which is always string_check.

evaluation_metric: String

The evaluation metric to use. One of cosine, fuzzy_match, bleu, gleu, meteor, rouge_1, rouge_2, rouge_3, rouge_4, rouge_5, or rouge_l.

source: String

The source code of the python script.

image_tag: String

The image tag to use for the python script.

model: String

The model to use for the evaluation.

range: List[Float64]

The range of the score. Defaults to [0, 1].

sampling_params: Attributes

The sampling parameters for the model.

max_completions_tokens: Int64

The maximum number of tokens the grader model may generate in its response.

reasoning_effort: String

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.
seed: Int64

A seed value to initialize the randomness, during sampling.

temperature: Float64

A higher temperature increases randomness in the outputs.

top_p: Float64

An alternative to temperature for nucleus sampling; 1.0 includes all tokens.

calculate_output: String

A formula to calculate the output based on grader results.

graders: Attributes

A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.

input: String

The input text. This may include template strings.

name: String

The name of the grader.

operation: String

The string check operation to perform. One of eq, ne, like, or ilike.

reference: String

The reference text. This may include template strings.

type: String

The object type, which is always string_check.

evaluation_metric: String

The evaluation metric to use. One of cosine, fuzzy_match, bleu, gleu, meteor, rouge_1, rouge_2, rouge_3, rouge_4, rouge_5, or rouge_l.

source: String

The source code of the python script.

image_tag: String

The image tag to use for the python script.

model: String

The model to use for the evaluation.

range: List[Float64]

The range of the score. Defaults to [0, 1].

sampling_params: Attributes

The sampling parameters for the model.

max_completions_tokens: Int64

The maximum number of tokens the grader model may generate in its response.

reasoning_effort: String

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.
seed: Int64

A seed value to initialize the randomness, during sampling.

temperature: Float64

A higher temperature increases randomness in the outputs.

top_p: Float64

An alternative to temperature for nucleus sampling; 1.0 includes all tokens.

labels: List[String]

The labels to assign to each item in the evaluation.

passing_labels: List[String]

The labels that indicate a passing result. Must be a subset of labels.

hyperparameters: Attributes

The hyperparameters used for the reinforcement fine-tuning job.

batch_size: Dynamic String | Int64

Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.

compute_multiplier: Dynamic String | Float64

Multiplier on amount of compute used for exploring search space during training.

eval_interval: Dynamic String | Int64

The number of training steps between evaluation runs.

eval_samples: Dynamic String | Int64

Number of evaluation samples to generate per training step.

learning_rate_multiplier: Dynamic String | Float64

Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.

n_epochs: Dynamic String | Int64

The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.

reasoning_effort: String

Level of reasoning effort.

supervised: Attributes

Configuration for the supervised fine-tuning method.

hyperparameters: Attributes

The hyperparameters used for the fine-tuning job.

batch_size: Dynamic String | Int64

Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.

learning_rate_multiplier: Dynamic String | Float64

Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.

n_epochs: Dynamic String | Int64

The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.

openai_fine_tuning_job

data "openai_fine_tuning_job" "example_fine_tuning_job" {
  fine_tuning_job_id = "ft-AF1WoRqd3aJAHsqc9NY7iL8F"
}

data openai_fine_tuning_jobs

optional Expand Collapse
metadata?: Map[String]

Optional metadata filter. To filter, use the syntax metadata[k]=v. Alternatively, set metadata=null to indicate no metadata.

max_items?: Int64

Max items to fetch, default: 1000

computed Expand Collapse
items: List[Attributes]

The items returned by the data source

id: String

The object identifier, which can be referenced in the API endpoints.

created_at: Int64

The Unix timestamp (in seconds) for when the fine-tuning job was created.

error: Attributes

For fine-tuning jobs that have failed, this will contain more information on the cause of the failure.

code: String

A machine-readable error code.

message: String

A human-readable error message.

param: String

The parameter that was invalid, usually training_file or validation_file. This field will be null if the failure was not parameter-specific.

fine_tuned_model: String

The name of the fine-tuned model that is being created. The value will be null if the fine-tuning job is still running.

finished_at: Int64

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: Attributes

The hyperparameters used for the fine-tuning job. This value will only be returned when running supervised jobs.

batch_size: Dynamic String | Int64

Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.

learning_rate_multiplier: Dynamic String | Float64

Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.

n_epochs: Dynamic String | Int64

The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.

model: String

The base model that is being fine-tuned.

object: String

The object type, which is always “fine_tuning.job”.

organization_id: String

The organization that owns the fine-tuning job.

result_files: List[String]

The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the Files API.

seed: Int64

The seed used for the fine-tuning job.

status: String

The current status of the fine-tuning job, which can be either validating_files, queued, running, succeeded, failed, or cancelled.

trained_tokens: Int64

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.

training_file: String

The file ID used for training. You can retrieve the training data with the Files API.

validation_file: String

The file ID used for validation. You can retrieve the validation results with the Files API.

estimated_finish: Int64

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.

integrations: List[Attributes]

A list of integrations to enable for this fine-tuning job.

type: String

The type of the integration being enabled for the fine-tuning job

wandb: Attributes

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.

project: String

The name of the project that the new run will be created under.

entity: String

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.

name: String

A display name to set for the run. If not set, we will use the Job ID as the name.

tags: List[String]

A list of tags to be attached to the newly created run. These tags are passed through directly to WandB. Some default tags are generated by OpenAI: “openai/finetune”, “openai/{base-model}”, “openai/{ftjob-abcdef}”.

metadata: Map[String]

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: Attributes

The method used for fine-tuning.

type: String

The type of method. Is either supervised, dpo, or reinforcement.

dpo: Attributes

Configuration for the DPO fine-tuning method.

hyperparameters: Attributes

The hyperparameters used for the DPO fine-tuning job.

batch_size: Dynamic String | Int64

Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.

beta: Dynamic String | Float64

The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model.

learning_rate_multiplier: Dynamic String | Float64

Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.

n_epochs: Dynamic String | Int64

The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.

reinforcement: Attributes

Configuration for the reinforcement fine-tuning method.

grader: Attributes

The grader used for the fine-tuning job.

input: String

The input text. This may include template strings.

name: String

The name of the grader.

operation: String

The string check operation to perform. One of eq, ne, like, or ilike.

reference: String

The reference text. This may include template strings.

type: String

The object type, which is always string_check.

evaluation_metric: String

The evaluation metric to use. One of cosine, fuzzy_match, bleu, gleu, meteor, rouge_1, rouge_2, rouge_3, rouge_4, rouge_5, or rouge_l.

source: String

The source code of the python script.

image_tag: String

The image tag to use for the python script.

model: String

The model to use for the evaluation.

range: List[Float64]

The range of the score. Defaults to [0, 1].

sampling_params: Attributes

The sampling parameters for the model.

max_completions_tokens: Int64

The maximum number of tokens the grader model may generate in its response.

reasoning_effort: String

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.
seed: Int64

A seed value to initialize the randomness, during sampling.

temperature: Float64

A higher temperature increases randomness in the outputs.

top_p: Float64

An alternative to temperature for nucleus sampling; 1.0 includes all tokens.

calculate_output: String

A formula to calculate the output based on grader results.

graders: Attributes

A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.

input: String

The input text. This may include template strings.

name: String

The name of the grader.

operation: String

The string check operation to perform. One of eq, ne, like, or ilike.

reference: String

The reference text. This may include template strings.

type: String

The object type, which is always string_check.

evaluation_metric: String

The evaluation metric to use. One of cosine, fuzzy_match, bleu, gleu, meteor, rouge_1, rouge_2, rouge_3, rouge_4, rouge_5, or rouge_l.

source: String

The source code of the python script.

image_tag: String

The image tag to use for the python script.

model: String

The model to use for the evaluation.

range: List[Float64]

The range of the score. Defaults to [0, 1].

sampling_params: Attributes

The sampling parameters for the model.

max_completions_tokens: Int64

The maximum number of tokens the grader model may generate in its response.

reasoning_effort: String

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.
seed: Int64

A seed value to initialize the randomness, during sampling.

temperature: Float64

A higher temperature increases randomness in the outputs.

top_p: Float64

An alternative to temperature for nucleus sampling; 1.0 includes all tokens.

labels: List[String]

The labels to assign to each item in the evaluation.

passing_labels: List[String]

The labels that indicate a passing result. Must be a subset of labels.

hyperparameters: Attributes

The hyperparameters used for the reinforcement fine-tuning job.

batch_size: Dynamic String | Int64

Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.

compute_multiplier: Dynamic String | Float64

Multiplier on amount of compute used for exploring search space during training.

eval_interval: Dynamic String | Int64

The number of training steps between evaluation runs.

eval_samples: Dynamic String | Int64

Number of evaluation samples to generate per training step.

learning_rate_multiplier: Dynamic String | Float64

Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.

n_epochs: Dynamic String | Int64

The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.

reasoning_effort: String

Level of reasoning effort.

supervised: Attributes

Configuration for the supervised fine-tuning method.

hyperparameters: Attributes

The hyperparameters used for the fine-tuning job.

batch_size: Dynamic String | Int64

Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.

learning_rate_multiplier: Dynamic String | Float64

Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.

n_epochs: Dynamic String | Int64

The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.

openai_fine_tuning_jobs

data "openai_fine_tuning_jobs" "example_fine_tuning_jobs" {
  metadata = {
    foo = "string"
  }
}

Fine TuningJobsCheckpoints

Manage fine-tuning jobs to tailor a model to your specific training data.

data openai_fine_tuning_job_checkpoints

required Expand Collapse
fine_tuning_job_id: String
optional Expand Collapse
max_items?: Int64

Max items to fetch, default: 1000

computed Expand Collapse
items: List[Attributes]

The items returned by the data source

id: String

The checkpoint identifier, which can be referenced in the API endpoints.

created_at: Int64

The Unix timestamp (in seconds) for when the checkpoint was created.

fine_tuned_model_checkpoint: String

The name of the fine-tuned checkpoint model that is created.

fine_tuning_job_id: String

The name of the fine-tuning job that this checkpoint was created from.

metrics: Attributes

Metrics at the step number during the fine-tuning job.

full_valid_loss: Float64
full_valid_mean_token_accuracy: Float64
step: Float64
train_loss: Float64
train_mean_token_accuracy: Float64
valid_loss: Float64
valid_mean_token_accuracy: Float64
object: String

The object type, which is always “fine_tuning.job.checkpoint”.

step_number: Int64

The step number that the checkpoint was created at.

openai_fine_tuning_job_checkpoints

data "openai_fine_tuning_job_checkpoints" "example_fine_tuning_job_checkpoints" {
  fine_tuning_job_id = "ft-AF1WoRqd3aJAHsqc9NY7iL8F"
}

Fine TuningCheckpointsPermissions

Manage fine-tuning jobs to tailor a model to your specific training data.

resource openai_fine_tuning_checkpoint_permission

required Expand Collapse
fine_tuned_model_checkpoint: String
project_ids: List[String]

The project identifiers to grant access to.

computed Expand Collapse
id: String

The permission identifier, which can be referenced in the API endpoints.

created_at: Int64

The Unix timestamp (in seconds) for when the permission was created.

first_id: String
has_more: Bool
last_id: String
object: String
project_id: String

The project identifier that the permission is for.

data: List[Attributes]
id: String

The permission identifier, which can be referenced in the API endpoints.

created_at: Int64

The Unix timestamp (in seconds) for when the permission was created.

object: String

The object type, which is always “checkpoint.permission”.

project_id: String

The project identifier that the permission is for.

openai_fine_tuning_checkpoint_permission

resource "openai_fine_tuning_checkpoint_permission" "example_fine_tuning_checkpoint_permission" {
  fine_tuned_model_checkpoint = "ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd"
  project_ids = ["string"]
}

data openai_fine_tuning_checkpoint_permission

optional Expand Collapse
fine_tuned_model_checkpoint?: String
after?: String

Identifier for the last permission ID from the previous pagination request.

project_id?: String

The ID of the project to get permissions for.

limit?: Int64

Number of permissions to retrieve.

order?: String

The order in which to retrieve permissions.

find_one_by?: Attributes
order?: String

The order in which to retrieve permissions.

computed Expand Collapse
id: String
first_id: String
has_more: Bool
last_id: String
object: String
data: List[Attributes]
id: String

The permission identifier, which can be referenced in the API endpoints.

created_at: Int64

The Unix timestamp (in seconds) for when the permission was created.

object: String

The object type, which is always “checkpoint.permission”.

project_id: String

The project identifier that the permission is for.

openai_fine_tuning_checkpoint_permission

data "openai_fine_tuning_checkpoint_permission" "example_fine_tuning_checkpoint_permission" {
  fine_tuned_model_checkpoint = "ft-AF1WoRqd3aJAHsqc9NY7iL8F"
  after = "after"
  limit = 0
  order = "ascending"
  project_id = "project_id"
}

data openai_fine_tuning_checkpoint_permissions

required Expand Collapse
fine_tuned_model_checkpoint: String
optional Expand Collapse
project_id?: String

The ID of the project to get permissions for.

order?: String

The order in which to retrieve permissions.

max_items?: Int64

Max items to fetch, default: 1000

computed Expand Collapse
items: List[Attributes]

The items returned by the data source

id: String

The permission identifier, which can be referenced in the API endpoints.

created_at: Int64

The Unix timestamp (in seconds) for when the permission was created.

object: String

The object type, which is always “checkpoint.permission”.

project_id: String

The project identifier that the permission is for.

openai_fine_tuning_checkpoint_permissions

data "openai_fine_tuning_checkpoint_permissions" "example_fine_tuning_checkpoint_permissions" {
  fine_tuned_model_checkpoint = "ft-AF1WoRqd3aJAHsqc9NY7iL8F"
  project_id = "project_id"
}