Skip to main content

jobs

Creates, updates, deletes, gets or lists a jobs resource.

Overview

Namejobs
TypeResource
Idopenai.fine_tuning.jobs

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe object identifier, which can be referenced in the API endpoints.
organization_idstringThe organization that owns the fine-tuning job.
created_atinteger (unixtime)The Unix timestamp (in seconds) for when the fine-tuning job was created.
errorobjectFor fine-tuning jobs that have failed, this will contain more information on the cause of the failure.
estimated_finishinteger (unixtime)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_modelstringThe name of the fine-tuned model that is being created. The value will be null if the fine-tuning job is still running.
finished_atinteger (unixtime)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.
hyperparametersobjectThe hyperparameters used for the fine-tuning job. This value will only be returned when running supervised jobs.
integrationsarrayA list of integrations to enable for this fine-tuning job.
metadataobjectSet 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. (x-oaiTypeLabel: map)
methodobjectThe method used for fine-tuning.
modelstringThe base model that is being fine-tuned.
objectstringThe object type, which is always "fine_tuning.job". (fine_tuning.job)
result_filesarrayThe compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the Files API.
seedintegerThe seed used for the fine-tuning job.
statusstringThe current status of the fine-tuning job, which can be either validating_files, queued, running, succeeded, failed, or cancelled. (validating_files, queued, running, succeeded, failed, cancelled)
trained_tokensintegerThe 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_filestringThe file ID used for training. You can retrieve the training data with the Files API.
validation_filestringThe file ID used for validation. You can retrieve the validation results with the Files API.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectfine_tuning_job_idopenai-organization, openai-project
listselectafter, limit, metadata, openai-organization, openai-project
createinsertmodel, training_fileopenai-organization, openai-project
cancelexecfine_tuning_job_idopenai-organization, openai-project
pauseexecfine_tuning_job_idopenai-organization, openai-project
resumeexecfine_tuning_job_idopenai-organization, openai-project

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
fine_tuning_job_idstringThe ID of the fine-tuning job to resume.
afterstringIdentifier for the last job from the previous pagination request.
limitintegerNumber of fine-tuning jobs to retrieve. Automatically applied from a SQL LIMIT clause - SELECT ... LIMIT 10 sends limit=10 on the wire. Setting it explicitly in a WHERE clause is not required.
metadataobjectOptional metadata filter. To filter, use the syntax metadata[k]=v. Alternatively, set metadata=null to indicate no metadata.
openai-organizationstringOptionally scope the request to a specific organization (overrides the default associated with the API key). Addressable in SQL as openai_organization.
openai-projectstringOptionally scope the request to a specific project (overrides the default associated with the API key). Addressable in SQL as openai_project.

SELECT examples

OK

SELECT
id,
organization_id,
created_at,
error,
estimated_finish,
fine_tuned_model,
finished_at,
hyperparameters,
integrations,
metadata,
method,
model,
object,
result_files,
seed,
status,
trained_tokens,
training_file,
validation_file
FROM openai.fine_tuning.jobs
WHERE fine_tuning_job_id = '{{ fine_tuning_job_id }}' -- required
AND "openai-organization" = '{{ openai-organization }}'
AND "openai-project" = '{{ openai-project }}'
;

INSERT examples

No description available.

INSERT INTO openai.fine_tuning.jobs (
model,
training_file,
hyperparameters,
suffix,
validation_file,
integrations,
seed,
method,
metadata,
"openai-organization",
"openai-project"
)
SELECT
'{{ model }}' /* required */,
'{{ training_file }}' /* required */,
'{{ hyperparameters }}',
'{{ suffix }}',
'{{ validation_file }}',
'{{ integrations }}',
{{ seed }},
'{{ method }}',
'{{ metadata }}',
'{{ openai-organization }}',
'{{ openai-project }}'
RETURNING
id,
organization_id,
created_at,
error,
estimated_finish,
fine_tuned_model,
finished_at,
hyperparameters,
integrations,
metadata,
method,
model,
object,
result_files,
seed,
status,
trained_tokens,
training_file,
validation_file
;

Lifecycle Methods

OK

EXEC openai.fine_tuning.jobs.cancel
@fine_tuning_job_id='{{ fine_tuning_job_id }}' --required,
@openai-organization='{{ openai-organization }}',
@openai-project='{{ openai-project }}'
;