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": {}
}
'import requests
url = "https://api.tokenfactory.nebius.com/v1/fine_tuning/jobs"
payload = {
"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": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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: {}
})
};
fetch('https://api.tokenfactory.nebius.com/v1/fine_tuning/jobs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tokenfactory.nebius.com/v1/fine_tuning/jobs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tokenfactory.nebius.com/v1/fine_tuning/jobs"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"training_file\": \"<string>\",\n \"from_checkpoint\": {\n \"repo\": \"<string>\",\n \"type\": \"hf\",\n \"revision\": \"<string>\",\n \"token\": \"<string>\"\n },\n \"validation_file\": \"file_123456\",\n \"hyperparameters\": {\n \"batch_size\": 8,\n \"learning_rate\": 0.00001,\n \"n_epochs\": 3,\n \"warmup_ratio\": 0,\n \"weight_decay\": 0,\n \"packing\": true,\n \"max_grad_norm\": 1,\n \"context_length\": 8192,\n \"lora\": false,\n \"lora_r\": 8,\n \"lora_alpha\": 8,\n \"lora_dropout\": 0\n },\n \"method\": {\n \"supervised\": {\n \"hyperparameters\": {\n \"batch_size\": 8,\n \"learning_rate\": 0.00001,\n \"n_epochs\": 3,\n \"warmup_ratio\": 0,\n \"weight_decay\": 0,\n \"packing\": true,\n \"max_grad_norm\": 1,\n \"context_length\": 8192,\n \"lora\": false,\n \"lora_r\": 8,\n \"lora_alpha\": 8,\n \"lora_dropout\": 0\n }\n },\n \"type\": \"supervised\"\n },\n \"integrations\": [\n {\n \"wandb\": {\n \"project\": \"<string>\",\n \"api_key\": \"<string>\",\n \"name\": \"<string>\",\n \"entity\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n },\n \"type\": \"wandb\"\n }\n ],\n \"seed\": 42,\n \"suffix\": \"<string>\",\n \"tags\": \"my-ft-job\",\n \"extra_body\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tokenfactory.nebius.com/v1/fine_tuning/jobs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"training_file\": \"<string>\",\n \"from_checkpoint\": {\n \"repo\": \"<string>\",\n \"type\": \"hf\",\n \"revision\": \"<string>\",\n \"token\": \"<string>\"\n },\n \"validation_file\": \"file_123456\",\n \"hyperparameters\": {\n \"batch_size\": 8,\n \"learning_rate\": 0.00001,\n \"n_epochs\": 3,\n \"warmup_ratio\": 0,\n \"weight_decay\": 0,\n \"packing\": true,\n \"max_grad_norm\": 1,\n \"context_length\": 8192,\n \"lora\": false,\n \"lora_r\": 8,\n \"lora_alpha\": 8,\n \"lora_dropout\": 0\n },\n \"method\": {\n \"supervised\": {\n \"hyperparameters\": {\n \"batch_size\": 8,\n \"learning_rate\": 0.00001,\n \"n_epochs\": 3,\n \"warmup_ratio\": 0,\n \"weight_decay\": 0,\n \"packing\": true,\n \"max_grad_norm\": 1,\n \"context_length\": 8192,\n \"lora\": false,\n \"lora_r\": 8,\n \"lora_alpha\": 8,\n \"lora_dropout\": 0\n }\n },\n \"type\": \"supervised\"\n },\n \"integrations\": [\n {\n \"wandb\": {\n \"project\": \"<string>\",\n \"api_key\": \"<string>\",\n \"name\": \"<string>\",\n \"entity\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n },\n \"type\": \"wandb\"\n }\n ],\n \"seed\": 42,\n \"suffix\": \"<string>\",\n \"tags\": \"my-ft-job\",\n \"extra_body\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tokenfactory.nebius.com/v1/fine_tuning/jobs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"training_file\": \"<string>\",\n \"from_checkpoint\": {\n \"repo\": \"<string>\",\n \"type\": \"hf\",\n \"revision\": \"<string>\",\n \"token\": \"<string>\"\n },\n \"validation_file\": \"file_123456\",\n \"hyperparameters\": {\n \"batch_size\": 8,\n \"learning_rate\": 0.00001,\n \"n_epochs\": 3,\n \"warmup_ratio\": 0,\n \"weight_decay\": 0,\n \"packing\": true,\n \"max_grad_norm\": 1,\n \"context_length\": 8192,\n \"lora\": false,\n \"lora_r\": 8,\n \"lora_alpha\": 8,\n \"lora_dropout\": 0\n },\n \"method\": {\n \"supervised\": {\n \"hyperparameters\": {\n \"batch_size\": 8,\n \"learning_rate\": 0.00001,\n \"n_epochs\": 3,\n \"warmup_ratio\": 0,\n \"weight_decay\": 0,\n \"packing\": true,\n \"max_grad_norm\": 1,\n \"context_length\": 8192,\n \"lora\": false,\n \"lora_r\": 8,\n \"lora_alpha\": 8,\n \"lora_dropout\": 0\n }\n },\n \"type\": \"supervised\"\n },\n \"integrations\": [\n {\n \"wandb\": {\n \"project\": \"<string>\",\n \"api_key\": \"<string>\",\n \"name\": \"<string>\",\n \"entity\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n },\n \"type\": \"wandb\"\n }\n ],\n \"seed\": 42,\n \"suffix\": \"<string>\",\n \"tags\": \"my-ft-job\",\n \"extra_body\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"created_at": 123,
"model": "<string>",
"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
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Create a fine-tuning job
Creates a job that fine-tunes a specified model based on a given dataset.
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": {}
}
'import requests
url = "https://api.tokenfactory.nebius.com/v1/fine_tuning/jobs"
payload = {
"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": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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: {}
})
};
fetch('https://api.tokenfactory.nebius.com/v1/fine_tuning/jobs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tokenfactory.nebius.com/v1/fine_tuning/jobs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tokenfactory.nebius.com/v1/fine_tuning/jobs"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"training_file\": \"<string>\",\n \"from_checkpoint\": {\n \"repo\": \"<string>\",\n \"type\": \"hf\",\n \"revision\": \"<string>\",\n \"token\": \"<string>\"\n },\n \"validation_file\": \"file_123456\",\n \"hyperparameters\": {\n \"batch_size\": 8,\n \"learning_rate\": 0.00001,\n \"n_epochs\": 3,\n \"warmup_ratio\": 0,\n \"weight_decay\": 0,\n \"packing\": true,\n \"max_grad_norm\": 1,\n \"context_length\": 8192,\n \"lora\": false,\n \"lora_r\": 8,\n \"lora_alpha\": 8,\n \"lora_dropout\": 0\n },\n \"method\": {\n \"supervised\": {\n \"hyperparameters\": {\n \"batch_size\": 8,\n \"learning_rate\": 0.00001,\n \"n_epochs\": 3,\n \"warmup_ratio\": 0,\n \"weight_decay\": 0,\n \"packing\": true,\n \"max_grad_norm\": 1,\n \"context_length\": 8192,\n \"lora\": false,\n \"lora_r\": 8,\n \"lora_alpha\": 8,\n \"lora_dropout\": 0\n }\n },\n \"type\": \"supervised\"\n },\n \"integrations\": [\n {\n \"wandb\": {\n \"project\": \"<string>\",\n \"api_key\": \"<string>\",\n \"name\": \"<string>\",\n \"entity\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n },\n \"type\": \"wandb\"\n }\n ],\n \"seed\": 42,\n \"suffix\": \"<string>\",\n \"tags\": \"my-ft-job\",\n \"extra_body\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tokenfactory.nebius.com/v1/fine_tuning/jobs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"training_file\": \"<string>\",\n \"from_checkpoint\": {\n \"repo\": \"<string>\",\n \"type\": \"hf\",\n \"revision\": \"<string>\",\n \"token\": \"<string>\"\n },\n \"validation_file\": \"file_123456\",\n \"hyperparameters\": {\n \"batch_size\": 8,\n \"learning_rate\": 0.00001,\n \"n_epochs\": 3,\n \"warmup_ratio\": 0,\n \"weight_decay\": 0,\n \"packing\": true,\n \"max_grad_norm\": 1,\n \"context_length\": 8192,\n \"lora\": false,\n \"lora_r\": 8,\n \"lora_alpha\": 8,\n \"lora_dropout\": 0\n },\n \"method\": {\n \"supervised\": {\n \"hyperparameters\": {\n \"batch_size\": 8,\n \"learning_rate\": 0.00001,\n \"n_epochs\": 3,\n \"warmup_ratio\": 0,\n \"weight_decay\": 0,\n \"packing\": true,\n \"max_grad_norm\": 1,\n \"context_length\": 8192,\n \"lora\": false,\n \"lora_r\": 8,\n \"lora_alpha\": 8,\n \"lora_dropout\": 0\n }\n },\n \"type\": \"supervised\"\n },\n \"integrations\": [\n {\n \"wandb\": {\n \"project\": \"<string>\",\n \"api_key\": \"<string>\",\n \"name\": \"<string>\",\n \"entity\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n },\n \"type\": \"wandb\"\n }\n ],\n \"seed\": 42,\n \"suffix\": \"<string>\",\n \"tags\": \"my-ft-job\",\n \"extra_body\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tokenfactory.nebius.com/v1/fine_tuning/jobs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"training_file\": \"<string>\",\n \"from_checkpoint\": {\n \"repo\": \"<string>\",\n \"type\": \"hf\",\n \"revision\": \"<string>\",\n \"token\": \"<string>\"\n },\n \"validation_file\": \"file_123456\",\n \"hyperparameters\": {\n \"batch_size\": 8,\n \"learning_rate\": 0.00001,\n \"n_epochs\": 3,\n \"warmup_ratio\": 0,\n \"weight_decay\": 0,\n \"packing\": true,\n \"max_grad_norm\": 1,\n \"context_length\": 8192,\n \"lora\": false,\n \"lora_r\": 8,\n \"lora_alpha\": 8,\n \"lora_dropout\": 0\n },\n \"method\": {\n \"supervised\": {\n \"hyperparameters\": {\n \"batch_size\": 8,\n \"learning_rate\": 0.00001,\n \"n_epochs\": 3,\n \"warmup_ratio\": 0,\n \"weight_decay\": 0,\n \"packing\": true,\n \"max_grad_norm\": 1,\n \"context_length\": 8192,\n \"lora\": false,\n \"lora_r\": 8,\n \"lora_alpha\": 8,\n \"lora_dropout\": 0\n }\n },\n \"type\": \"supervised\"\n },\n \"integrations\": [\n {\n \"wandb\": {\n \"project\": \"<string>\",\n \"api_key\": \"<string>\",\n \"name\": \"<string>\",\n \"entity\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n },\n \"type\": \"wandb\"\n }\n ],\n \"seed\": 42,\n \"suffix\": \"<string>\",\n \"tags\": \"my-ft-job\",\n \"extra_body\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"created_at": 123,
"model": "<string>",
"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
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Project ID to list fine tuning jobs
Body
The name of the model to fine-tune
"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"
The ID of the uploaded training data file
"file_123456"
Checkpoint to continue training from
- HFCheckpointParametersRequest
- FTCheckpointParameters
Show child attributes
Show child attributes
The ID of the uploaded validation data file
"file_123456"
Training hyperparameters
Show child attributes
Show child attributes
Fine-tuning method configuration
- SupervisedMethodConfig
- SpecDraftMethodConfig
Show child attributes
Show child attributes
Job integration paramaters
- WandbIntegrationRequest
- MlflowIntegrationRequest
- HfExportIntegrationRequest
Show child attributes
Show child attributes
The seed controls the reproducibility of the job
42
The suffix that will be used for output model name
64List of tags to associate with the job
"my-ft-job"
Extra params to pass to the fine-tuning job
Response
Successful Response
validating_files, queued, running, succeeded, failed, cancelled For fine-tuning jobs that have failed, this will contain more information on the cause of the failure.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
- SupervisedMethodConfig
- SpecDraftMethodConfig
Show child attributes
Show child attributes
- WandbIntegrationResponse
- MlflowIntegrationResponse
- HfExportIntegrationResponse
Show child attributes
Show child attributes
- HFCheckpointParametersResponse
- FTCheckpointParameters
Show child attributes
Show child attributes
"fine_tuning.job"64Was this page helpful?