Class: OpenAI::Models::FineTuning::JobCreateParams

Inherits:
Internal::Type::BaseModel show all
Extended by:
Internal::Type::RequestParameters::Converter
Includes:
Internal::Type::RequestParameters
Defined in:
lib/openai/models/fine_tuning/job_create_params.rb,
sig/openai/models/fine_tuning/job_create_params.rbs

Overview

See Also:

  • OpenAI::Resources::FineTuning::Jobs#create

Defined Under Namespace

Modules: Model Classes: Hyperparameters, Integration, Method

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

Attributes inherited from Internal::Type::BaseModel

#last_response

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Internal::Type::RequestParameters::Converter

dump_request

Methods included from Internal::Type::RequestParameters

included

Methods inherited from Internal::Type::BaseModel

==, #==, #[], #_request_id, #_set_last_response, coerce, #deconstruct_keys, #deep_to_h, dump, #encode_with, fields, hash, #hash, inherited, #inspect, inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, coerce_cached, coerce_with_error, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, resolve_type, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(project:, entity: nil, name: nil, tags: nil) ⇒ JobCreateParams

Returns a new instance of JobCreateParams.

Parameters:

  • model —

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

  • training_file —

    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.

  • hyperparameters —

    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.

  • integrations —

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

  • metadata —

    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.

    Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.

  • method_ —

    The method used for fine-tuning.

  • seed —

    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 —

    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-4.1-mini-2025-04-14:openai:custom-model-name:7p4lURel.

  • validation_file —

    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.

  • model: (OpenAI::Models::FineTuning::JobCreateParams::model)
  • training_file: (String)
  • hyperparameters: (OpenAI::FineTuning::JobCreateParams::Hyperparameters)
  • integrations: (::Array[OpenAI::FineTuning::JobCreateParams::Integration], nil)
  • metadata: (OpenAI::Models::metadata, nil)
  • method_: (OpenAI::FineTuning::JobCreateParams::Method)
  • seed: (Integer, nil)
  • suffix: (String, nil)
  • validation_file: (String, nil)
  • request_options: (OpenAI::request_opts)


# File 'lib/openai/models/fine_tuning/job_create_params.rb', line 113

Instance Attribute Details

#hyperparameters ⇒ OpenAI::FineTuning::JobCreateParams::Hyperparameters?

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.

Returns:

  • (OpenAI::FineTuning::JobCreateParams::Hyperparameters, nil)


49
# File 'lib/openai/models/fine_tuning/job_create_params.rb', line 49

optional :hyperparameters, -> { OpenAI::FineTuning::JobCreateParams::Hyperparameters }

#integrations ⇒ ::Array[OpenAI::FineTuning::JobCreateParams::Integration]?

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

Returns:

  • (::Array[OpenAI::FineTuning::JobCreateParams::Integration], nil)


55
56
57
58
59
# File 'lib/openai/models/fine_tuning/job_create_params.rb', line 55

optional(
  :integrations,
  -> { OpenAI::Internal::Type::ArrayOf[OpenAI::FineTuning::JobCreateParams::Integration] },
  nil?: true
)

#metadata ⇒ OpenAI::Models::metadata?

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.

Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.

Returns:

  • (OpenAI::Models::metadata, nil)


69
# File 'lib/openai/models/fine_tuning/job_create_params.rb', line 69

optional :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true

#method_ ⇒ OpenAI::FineTuning::JobCreateParams::Method?

The method used for fine-tuning.

Returns:

  • (OpenAI::FineTuning::JobCreateParams::Method, nil)


75
# File 'lib/openai/models/fine_tuning/job_create_params.rb', line 75

optional :method_, -> { OpenAI::FineTuning::JobCreateParams::Method }, api_name: :method

#model ⇒ OpenAI::Models::FineTuning::JobCreateParams::model

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

Returns:

  • (OpenAI::Models::FineTuning::JobCreateParams::model)


16
# File 'lib/openai/models/fine_tuning/job_create_params.rb', line 16

required :model, union: -> { OpenAI::FineTuning::JobCreateParams::Model }

#seed ⇒ Integer?

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.

Returns:

  • (Integer, nil)


83
# File 'lib/openai/models/fine_tuning/job_create_params.rb', line 83

optional :seed, Integer, nil?: true

#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-4.1-mini-2025-04-14:openai:custom-model-name:7p4lURel.

Returns:

  • (String, nil)


93
# File 'lib/openai/models/fine_tuning/job_create_params.rb', line 93

optional :suffix, String, nil?: true

#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.

Returns:

  • (String)


40
# File 'lib/openai/models/fine_tuning/job_create_params.rb', line 40

required :training_file, String

#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.

Returns:

  • (String, nil)


111
# File 'lib/openai/models/fine_tuning/job_create_params.rb', line 111

optional :validation_file, String, nil?: true

Class Method Details

.variants ⇒ Array(Symbol, :auto, Integer)

Returns:

  • (Array(Symbol, :auto, Integer))


# File 'lib/openai/models/fine_tuning/job_create_params.rb', line 303

Instance Method Details

#to_hash ⇒ { model: OpenAI::Models::FineTuning::JobCreateParams::model, training_file: String, ?hyperparameters: OpenAI::FineTuning::JobCreateParams::Hyperparameters, ?integrations: ::Array[OpenAI::FineTuning::JobCreateParams::Integration]?, ?metadata: OpenAI::Models::metadata?, ?method_: OpenAI::FineTuning::JobCreateParams::Method, ?seed: Integer?, ?suffix: String?, ?validation_file: String?, ?request_options: OpenAI::RequestOptions }

Returns:

  • ({ model: OpenAI::Models::FineTuning::JobCreateParams::model, training_file: String, ?hyperparameters: OpenAI::FineTuning::JobCreateParams::Hyperparameters, ?integrations: ::Array[OpenAI::FineTuning::JobCreateParams::Integration]?, ?metadata: OpenAI::Models::metadata?, ?method_: OpenAI::FineTuning::JobCreateParams::Method, ?seed: Integer?, ?suffix: String?, ?validation_file: String?, ?request_options: OpenAI::RequestOptions })


175
176
177
178
179
180
181
182
183
184
185
186
# File 'sig/openai/models/fine_tuning/job_create_params.rbs', line 175

def to_hash: -> {
  model: OpenAI::Models::FineTuning::JobCreateParams::model,
  training_file: String,
  ?hyperparameters: OpenAI::FineTuning::JobCreateParams::Hyperparameters,
  ?integrations: ::Array[OpenAI::FineTuning::JobCreateParams::Integration]?,
  ?metadata: OpenAI::Models::metadata?,
  ?method_: OpenAI::FineTuning::JobCreateParams::Method,
  ?seed: Integer?,
  ?suffix: String?,
  ?validation_file: String?,
  ?request_options: OpenAI::RequestOptions
}