jobs
Creates, updates, deletes, gets or lists a jobs resource.
Overview
| Name | jobs |
| Type | Resource |
| Id | openai.fine_tuning.jobs |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string | The object identifier, which can be referenced in the API endpoints. |
organization_id | string | The organization that owns the fine-tuning job. |
created_at | integer (unixtime) | The Unix timestamp (in seconds) for when the fine-tuning job was created. |
error | object | For fine-tuning jobs that have failed, this will contain more information on the cause of the failure. |
estimated_finish | integer (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_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 | integer (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. |
hyperparameters | object | The hyperparameters used for the fine-tuning job. This value will only be returned when running supervised jobs. |
integrations | array | A list of integrations to enable for this fine-tuning job. |
metadata | object | 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. (x-oaiTypeLabel: map) |
method | object | The method used for fine-tuning. |
model | string | The base model that is being fine-tuned. |
object | string | The object type, which is always "fine_tuning.job". (fine_tuning.job) |
result_files | array | The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the Files API. |
seed | integer | 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. (validating_files, queued, running, succeeded, failed, cancelled) |
trained_tokens | integer | 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. |
| Name | Datatype | Description |
|---|---|---|
id | string | The object identifier, which can be referenced in the API endpoints. |
organization_id | string | The organization that owns the fine-tuning job. |
created_at | integer (unixtime) | The Unix timestamp (in seconds) for when the fine-tuning job was created. |
error | object | For fine-tuning jobs that have failed, this will contain more information on the cause of the failure. |
estimated_finish | integer (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_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 | integer (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. |
hyperparameters | object | The hyperparameters used for the fine-tuning job. This value will only be returned when running supervised jobs. |
integrations | array | A list of integrations to enable for this fine-tuning job. |
metadata | object | 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. (x-oaiTypeLabel: map) |
method | object | The method used for fine-tuning. |
model | string | The base model that is being fine-tuned. |
object | string | The object type, which is always "fine_tuning.job". (fine_tuning.job) |
result_files | array | The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the Files API. |
seed | integer | 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. (validating_files, queued, running, succeeded, failed, cancelled) |
trained_tokens | integer | 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. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | fine_tuning_job_id | openai-organization, openai-project | |
list | select | after, limit, metadata, openai-organization, openai-project | ||
create | insert | model, training_file | openai-organization, openai-project | |
cancel | exec | fine_tuning_job_id | openai-organization, openai-project | |
pause | exec | fine_tuning_job_id | openai-organization, openai-project | |
resume | exec | fine_tuning_job_id | openai-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.
| Name | Datatype | Description |
|---|---|---|
fine_tuning_job_id | string | The ID of the fine-tuning job to resume. |
after | string | Identifier for the last job from the previous pagination request. |
limit | integer | Number 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. |
metadata | object | Optional metadata filter. To filter, use the syntax metadata[k]=v. Alternatively, set metadata=null to indicate no metadata. |
openai-organization | string | Optionally scope the request to a specific organization (overrides the default associated with the API key). Addressable in SQL as openai_organization. |
openai-project | string | Optionally scope the request to a specific project (overrides the default associated with the API key). Addressable in SQL as openai_project. |
SELECT examples
- get
- list
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 }}'
;
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 after = '{{ after }}'
AND metadata = '{{ metadata }}'
AND "openai-organization" = '{{ openai-organization }}'
AND "openai-project" = '{{ openai-project }}'
;
INSERT examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: jobs
props:
- name: model
value: "{{ model }}"
description: |
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).
valid_values: ['babbage-002', 'davinci-002', 'gpt-3.5-turbo', 'gpt-4o-mini']
- name: training_file
value: "{{ training_file }}"
description: |
The ID of an uploaded file that contains training data.
See [upload file](https://platform.openai.com/docs/api-reference/files/create) 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](https://platform.openai.com/docs/api-reference/fine-tuning/chat-input), [completions](https://platform.openai.com/docs/api-reference/fine-tuning/completions-input) format, or if the fine-tuning method uses the [preference](https://platform.openai.com/docs/api-reference/fine-tuning/preference-input) format.
See the [fine-tuning guide](https://platform.openai.com/docs/guides/model-optimization) for more details.
- name: hyperparameters
description: |
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.
value:
batch_size: "{{ batch_size }}"
learning_rate_multiplier: "{{ learning_rate_multiplier }}"
n_epochs: "{{ n_epochs }}"
- name: suffix
value: "{{ suffix }}"
description: |
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`.
default: null
- name: validation_file
value: "{{ validation_file }}"
description: |
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](https://platform.openai.com/docs/guides/model-optimization) for more details.
- name: integrations
description: |
A list of integrations to enable for your fine-tuning job.
value:
- type: "{{ type }}"
wandb:
project: "{{ project }}"
name: "{{ name }}"
entity: "{{ entity }}"
tags:
- "{{ tags }}"
- name: seed
value: {{ seed }}
description: |
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.
- name: method
description: |
The method used for fine-tuning.
value:
type: "{{ type }}"
supervised:
hyperparameters:
batch_size: "{{ batch_size }}"
learning_rate_multiplier: "{{ learning_rate_multiplier }}"
n_epochs: "{{ n_epochs }}"
dpo:
hyperparameters:
beta: "{{ beta }}"
batch_size: "{{ batch_size }}"
learning_rate_multiplier: "{{ learning_rate_multiplier }}"
n_epochs: "{{ n_epochs }}"
reinforcement:
grader:
type: "{{ type }}"
name: "{{ name }}"
input: "{{ input }}"
reference: "{{ reference }}"
operation: "{{ operation }}"
evaluation_metric: "{{ evaluation_metric }}"
source: "{{ source }}"
image_tag: "{{ image_tag }}"
model: "{{ model }}"
sampling_params:
seed: "{{ seed }}"
top_p: "{{ top_p }}"
temperature: "{{ temperature }}"
max_completions_tokens: "{{ max_completions_tokens }}"
reasoning_effort: "{{ reasoning_effort }}"
range:
- {{ range }}
graders:
type: "{{ type }}"
name: "{{ name }}"
input: "{{ input }}"
reference: "{{ reference }}"
operation: "{{ operation }}"
evaluation_metric: "{{ evaluation_metric }}"
source: "{{ source }}"
image_tag: "{{ image_tag }}"
model: "{{ model }}"
sampling_params:
seed: "{{ seed }}"
top_p: "{{ top_p }}"
temperature: "{{ temperature }}"
max_completions_tokens: "{{ max_completions_tokens }}"
reasoning_effort: "{{ reasoning_effort }}"
range:
- {{ range }}
labels:
- "{{ labels }}"
passing_labels:
- "{{ passing_labels }}"
calculate_output: "{{ calculate_output }}"
hyperparameters:
batch_size: "{{ batch_size }}"
learning_rate_multiplier: "{{ learning_rate_multiplier }}"
n_epochs: "{{ n_epochs }}"
reasoning_effort: "{{ reasoning_effort }}"
compute_multiplier: "{{ compute_multiplier }}"
eval_interval: "{{ eval_interval }}"
eval_samples: "{{ eval_samples }}"
- name: metadata
value: "{{ metadata }}"
description: |
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.
- name: openai-organization
value: "{{ openai-organization }}"
description: Optionally scope the request to a specific organization (overrides the default associated with the API key). Addressable in SQL as `openai_organization`.
description: Optionally scope the request to a specific organization (overrides the default associated with the API key). Addressable in SQL as `openai_organization`.
- name: openai-project
value: "{{ openai-project }}"
description: Optionally scope the request to a specific project (overrides the default associated with the API key). Addressable in SQL as `openai_project`.
description: Optionally scope the request to a specific project (overrides the default associated with the API key). Addressable in SQL as `openai_project`.
Lifecycle Methods
- cancel
- pause
- resume
OK
EXEC openai.fine_tuning.jobs.cancel
@fine_tuning_job_id='{{ fine_tuning_job_id }}' --required,
@openai-organization='{{ openai-organization }}',
@openai-project='{{ openai-project }}'
;
OK
EXEC openai.fine_tuning.jobs.pause
@fine_tuning_job_id='{{ fine_tuning_job_id }}' --required,
@openai-organization='{{ openai-organization }}',
@openai-project='{{ openai-project }}'
;
OK
EXEC openai.fine_tuning.jobs.resume
@fine_tuning_job_id='{{ fine_tuning_job_id }}' --required,
@openai-organization='{{ openai-organization }}',
@openai-project='{{ openai-project }}'
;