sttp.openai.requests.finetuning

Members list

Type members

Classlikes

case class Dpo(hyperparameters: Option[Hyperparameters])

Value parameters

hyperparameters

The hyperparameters used for the fine-tuning job.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Dpo

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Dpo.type
case class Error(code: String, message: String, param: Option[String])

Value parameters

code

A machine-readable error code.

message

A human-readable error message.

param

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

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Error

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Error.type
case class FineTuningJobCheckpointResponse(id: String, createdAt: Int, fineTunedModelCheckpoint: String, stepNumber: Int, metrics: Metrics, fineTuningJobId: String, `object`: String)

The fine_tuning.job.checkpoint object represents a model checkpoint for a fine-tuning job that is ready to use.

The fine_tuning.job.checkpoint object represents a model checkpoint for a fine-tuning job that is ready to use.

Value parameters

`object`

The object type, which is always "fine_tuning.job.checkpoint".

createdAt

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

fineTunedModelCheckpoint

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

fineTuningJobId

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

id

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

metrics

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

stepNumber

The step number that the checkpoint was created at.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class FineTuningJobEventResponse(`object`: String, id: String, createdAt: Int, level: String, message: String, `type`: String, data: Map[String, Value])

Fine-tuning job event object

Fine-tuning job event object

Value parameters

`object`

The object type, which is always "fine_tuning.job.event".

`type`

The type of event.

createdAt

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

data

The data associated with the event.

id

The object identifier.

level

The log level of the event.

message

The message of the event.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class FineTuningJobRequestBody(model: FineTuningModel, trainingFile: String, suffix: Option[String], validationFile: Option[String], integrations: Option[Seq[Integration]], seed: Option[Int], method: Option[Method])

Value parameters

integrations

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

method

The method used for fine-tuning.

model

The name of the model to fine-tune. You can select one of the supported models https://platform.openai.com/docs/guides/fine-tuning#which-models-can-be-fine-tuned.

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-4o-mini:openai:custom-model-name:7p4lURel.

trainingFile

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.

validationFile

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.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class FineTuningJobResponse(id: String, createdAt: Int, error: Option[Error], fineTunedModel: Option[String], finishedAt: Option[Int], hyperparameters: Option[Hyperparameters], model: String, `object`: String, organizationId: String, resultFiles: Seq[String], status: Status, trainedTokens: Option[Int], trainingFile: String, validationFile: Option[String], integrations: Option[Seq[Integration]], seed: Int, estimatedFinish: Option[Int], method: Method)

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.

Value parameters

`object`

The object type, which is always "fine_tuning.job".

createdAt

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

error

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

estimatedFinish

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.

fineTunedModel

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

finishedAt

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

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

id

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

integrations

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

method

The method used for fine-tuning.

model

The base model that is being fine-tuned.

organizationId

The organization that owns the fine-tuning job.

resultFiles

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

seed

The seed used for the fine-tuning job.

status

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

trainedTokens

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.

trainingFile

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

validationFile

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

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed abstract class FineTuningModel(val value: String)

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Companion
class
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
case class Hyperparameters(batchSize: Option[Int], learningRateMultiplier: Option[Float], nEpochs: Option[Int], beta: Option[Float])

Value parameters

batchSize

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

beta

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

learningRateMultiplier

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

nEpochs

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

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class Integration(`type`: Type, wandb: Wandb)

Value parameters

`type`

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

wandb

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.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Integration

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class ListFineTuningJobCheckpointResponse(`object`: String, data: Seq[FineTuningJobCheckpointResponse], firstId: String, lastId: String, hasMore: Boolean)

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class ListFineTuningJobEventResponse(`object`: String, data: Seq[FineTuningJobEventResponse], hasMore: Boolean)

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class ListFineTuningJobResponse(`object`: String, data: Seq[FineTuningJobResponse], hasMore: Boolean)

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class Method(`type`: Option[Type], supervised: Option[Supervised], dpo: Option[Dpo])

Value parameters

`type`

The type of method. Is either supervised or dpo.

dpo

Configuration for the DPO fine-tuning method.

supervised

Configuration for the supervised fine-tuning method.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Method

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Method.type
case class Metrics(step: Float, trainLoss: Float, trainMeanTokenAccuracy: Float, validLoss: Float, validMeanTokenAccuracy: Float, fullValidLoss: Float, fullValidMeanTokenAccuracy: Float)

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Metrics

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Metrics.type
case class QueryParameters(after: Option[String], limit: Option[Int])

Value parameters

after

Identifier for the last job from the previous pagination request.

limit

Number of fine-tuning jobs to retrieve.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed abstract class Status(val value: String)

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Cancelled
class CustomStatus
object Failed
object Queued
object Running
object Succeeded
Show all
object Status

Attributes

Companion
class
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Status.type
case class Supervised(hyperparameters: Option[Hyperparameters])

Value parameters

hyperparameters

The hyperparameters used for the fine-tuning job.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Supervised

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Supervised.type
abstract class Type(val value: String)

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Wandb
object Dpo
object Supervised
object Type

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
Type.type
case class Wandb(project: String, name: Option[String], entity: Option[String], tags: Option[Seq[String]])

Value parameters

entity

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

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

project

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

tags

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}".

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Wandb

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Wandb.type