Skip to main content
POST
/
v1
/
fine_tuning
/
jobs
Create a fine-tuning job
curl --request POST \
  --url https://api.tokenfactory.nebius.com/v1/fine_tuning/jobs \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "training_file": "<string>",
  "from_checkpoint": {
    "repo": "<string>",
    "type": "hf",
    "revision": "<string>",
    "token": "<string>"
  },
  "validation_file": "file_123456",
  "hyperparameters": {
    "batch_size": 8,
    "learning_rate": 0.00001,
    "n_epochs": 3,
    "warmup_ratio": 0,
    "weight_decay": 0,
    "packing": true,
    "max_grad_norm": 1,
    "context_length": 8192,
    "lora": false,
    "lora_r": 8,
    "lora_alpha": 8,
    "lora_dropout": 0
  },
  "method": {
    "supervised": {
      "hyperparameters": {
        "batch_size": 8,
        "learning_rate": 0.00001,
        "n_epochs": 3,
        "warmup_ratio": 0,
        "weight_decay": 0,
        "packing": true,
        "max_grad_norm": 1,
        "context_length": 8192,
        "lora": false,
        "lora_r": 8,
        "lora_alpha": 8,
        "lora_dropout": 0
      }
    },
    "type": "supervised"
  },
  "integrations": [
    {
      "wandb": {
        "project": "<string>",
        "api_key": "<string>",
        "name": "<string>",
        "entity": "<string>",
        "tags": [
          "<string>"
        ]
      },
      "type": "wandb"
    }
  ],
  "seed": 42,
  "suffix": "<string>",
  "tags": "my-ft-job",
  "extra_body": {}
}
'
{
  "id": "<string>",
  "created_at": 123,
  "model": "<string>",
  "status": "validating_files",
  "training_file": "<string>",
  "error": {
    "code": "<string>",
    "message": "<string>",
    "param": "<string>"
  },
  "finished_at": 123,
  "hyperparameters": {
    "batch_size": 8,
    "learning_rate": 0.00001,
    "n_epochs": 3,
    "warmup_ratio": 0,
    "weight_decay": 0,
    "packing": true,
    "max_grad_norm": 1,
    "context_length": 8192,
    "lora": false,
    "lora_r": 8,
    "lora_alpha": 8,
    "lora_dropout": 0
  },
  "method": {
    "supervised": {
      "hyperparameters": {
        "batch_size": 8,
        "learning_rate": 0.00001,
        "n_epochs": 3,
        "warmup_ratio": 0,
        "weight_decay": 0,
        "packing": true,
        "max_grad_norm": 1,
        "context_length": 8192,
        "lora": false,
        "lora_r": 8,
        "lora_alpha": 8,
        "lora_dropout": 0
      }
    },
    "type": "supervised"
  },
  "integrations": [
    {
      "wandb": {
        "project": "<string>",
        "name": "<string>",
        "entity": "<string>",
        "tags": [
          "<string>"
        ]
      },
      "type": "wandb"
    }
  ],
  "from_checkpoint": {
    "repo": "<string>",
    "type": "hf",
    "revision": "<string>"
  },
  "object": "fine_tuning.job",
  "organization_id": "",
  "result_files": [],
  "seed": 0,
  "suffix": "<string>",
  "trained_tokens": 123,
  "validation_file": "<string>",
  "estimated_finish": 123,
  "trained_steps": 123,
  "total_steps": 123
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

ai_project_id
string | null

Project ID to list fine tuning jobs

Body

application/json
model
string
required

The name of the model to fine-tune

Examples:

"meta-llama/Llama-3.1-70B-Instruct"

"meta-llama/Llama-3.1-70B"

"meta-llama/Llama-3.1-8B-Instruct"

"meta-llama/Llama-3.1-8B"

training_file
string
required

The ID of the uploaded training data file

Example:

"file_123456"

from_checkpoint
HFCheckpointParametersRequest · object

Checkpoint to continue training from

validation_file
string | null

The ID of the uploaded validation data file

Example:

"file_123456"

hyperparameters
SupervisedHParameters · object

Training hyperparameters

method
SupervisedMethodConfig · object

Fine-tuning method configuration

integrations
(WandbIntegrationRequest · object | MlflowIntegrationRequest · object | HfExportIntegrationRequest · object)[] | null

Job integration paramaters

seed
integer | null

The seed controls the reproducibility of the job

Example:

42

suffix
string | null

The suffix that will be used for output model name

Maximum string length: 64
tags
string[] | null

List of tags to associate with the job

Example:

"my-ft-job"

extra_body
Extra Body · object

Extra params to pass to the fine-tuning job

Response

Successful Response

id
string
required
created_at
integer
required
model
string
required
status
enum<string>
required
Available options:
validating_files,
queued,
running,
succeeded,
failed,
cancelled
training_file
string
required
error
Error · object
finished_at
integer | null
hyperparameters
SupervisedHParameters · object
method
SupervisedMethodConfig · object
integrations
(WandbIntegrationResponse · object | MlflowIntegrationResponse · object | HfExportIntegrationResponse · object)[] | null
from_checkpoint
HFCheckpointParametersResponse · object
object
enum<string>
default:fine_tuning.job
Available options:
fine_tuning.job
Allowed value: "fine_tuning.job"
organization_id
string
default:""
result_files
string[]
seed
integer
default:0
suffix
string | null
Maximum string length: 64
trained_tokens
integer | null
validation_file
string | null
estimated_finish
integer | null
trained_steps
integer | null
total_steps
integer | null