Create Fine-tune
curl --request POST \
--url https://api.getflex.ai/v1/fine_tunes/create_finetune \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"model": "<string>",
"dataset_id": "<string>",
"n_epochs": 123,
"train_with_lora": true,
"batch_size": 123,
"wandb_key": "<string>",
"learning_rate": 123,
"n_checkpoints_and_evaluations_per_epoch": 1,
"save_only_best_checkpoint": false,
"lora_config": {},
"early_stopping_config": {}
}
'import requests
url = "https://api.getflex.ai/v1/fine_tunes/create_finetune"
payload = {
"name": "<string>",
"model": "<string>",
"dataset_id": "<string>",
"n_epochs": 123,
"train_with_lora": True,
"batch_size": 123,
"wandb_key": "<string>",
"learning_rate": 123,
"n_checkpoints_and_evaluations_per_epoch": 1,
"save_only_best_checkpoint": False,
"lora_config": {},
"early_stopping_config": {}
}
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({
name: '<string>',
model: '<string>',
dataset_id: '<string>',
n_epochs: 123,
train_with_lora: true,
batch_size: 123,
wandb_key: '<string>',
learning_rate: 123,
n_checkpoints_and_evaluations_per_epoch: 1,
save_only_best_checkpoint: false,
lora_config: {},
early_stopping_config: {}
})
};
fetch('https://api.getflex.ai/v1/fine_tunes/create_finetune', 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.getflex.ai/v1/fine_tunes/create_finetune",
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([
'name' => '<string>',
'model' => '<string>',
'dataset_id' => '<string>',
'n_epochs' => 123,
'train_with_lora' => true,
'batch_size' => 123,
'wandb_key' => '<string>',
'learning_rate' => 123,
'n_checkpoints_and_evaluations_per_epoch' => 1,
'save_only_best_checkpoint' => false,
'lora_config' => [
],
'early_stopping_config' => [
]
]),
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.getflex.ai/v1/fine_tunes/create_finetune"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"model\": \"<string>\",\n \"dataset_id\": \"<string>\",\n \"n_epochs\": 123,\n \"train_with_lora\": true,\n \"batch_size\": 123,\n \"wandb_key\": \"<string>\",\n \"learning_rate\": 123,\n \"n_checkpoints_and_evaluations_per_epoch\": 1,\n \"save_only_best_checkpoint\": false,\n \"lora_config\": {},\n \"early_stopping_config\": {}\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.getflex.ai/v1/fine_tunes/create_finetune")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"model\": \"<string>\",\n \"dataset_id\": \"<string>\",\n \"n_epochs\": 123,\n \"train_with_lora\": true,\n \"batch_size\": 123,\n \"wandb_key\": \"<string>\",\n \"learning_rate\": 123,\n \"n_checkpoints_and_evaluations_per_epoch\": 1,\n \"save_only_best_checkpoint\": false,\n \"lora_config\": {},\n \"early_stopping_config\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getflex.ai/v1/fine_tunes/create_finetune")
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 \"name\": \"<string>\",\n \"model\": \"<string>\",\n \"dataset_id\": \"<string>\",\n \"n_epochs\": 123,\n \"train_with_lora\": true,\n \"batch_size\": 123,\n \"wandb_key\": \"<string>\",\n \"learning_rate\": 123,\n \"n_checkpoints_and_evaluations_per_epoch\": 1,\n \"save_only_best_checkpoint\": false,\n \"lora_config\": {},\n \"early_stopping_config\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"config": {},
"user_id": "<string>",
"model_id": "<string>",
"name": "<string>",
"checkpoints_count": 123,
"total_steps": 123,
"dataset_id": "<string>",
"engine_data": {
"runpod_run_id": "<string>"
}
}{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}Fine-tunes
Create Fine Tune
POST
/
fine_tunes
/
create_finetune
Create Fine-tune
curl --request POST \
--url https://api.getflex.ai/v1/fine_tunes/create_finetune \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"model": "<string>",
"dataset_id": "<string>",
"n_epochs": 123,
"train_with_lora": true,
"batch_size": 123,
"wandb_key": "<string>",
"learning_rate": 123,
"n_checkpoints_and_evaluations_per_epoch": 1,
"save_only_best_checkpoint": false,
"lora_config": {},
"early_stopping_config": {}
}
'import requests
url = "https://api.getflex.ai/v1/fine_tunes/create_finetune"
payload = {
"name": "<string>",
"model": "<string>",
"dataset_id": "<string>",
"n_epochs": 123,
"train_with_lora": True,
"batch_size": 123,
"wandb_key": "<string>",
"learning_rate": 123,
"n_checkpoints_and_evaluations_per_epoch": 1,
"save_only_best_checkpoint": False,
"lora_config": {},
"early_stopping_config": {}
}
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({
name: '<string>',
model: '<string>',
dataset_id: '<string>',
n_epochs: 123,
train_with_lora: true,
batch_size: 123,
wandb_key: '<string>',
learning_rate: 123,
n_checkpoints_and_evaluations_per_epoch: 1,
save_only_best_checkpoint: false,
lora_config: {},
early_stopping_config: {}
})
};
fetch('https://api.getflex.ai/v1/fine_tunes/create_finetune', 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.getflex.ai/v1/fine_tunes/create_finetune",
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([
'name' => '<string>',
'model' => '<string>',
'dataset_id' => '<string>',
'n_epochs' => 123,
'train_with_lora' => true,
'batch_size' => 123,
'wandb_key' => '<string>',
'learning_rate' => 123,
'n_checkpoints_and_evaluations_per_epoch' => 1,
'save_only_best_checkpoint' => false,
'lora_config' => [
],
'early_stopping_config' => [
]
]),
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.getflex.ai/v1/fine_tunes/create_finetune"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"model\": \"<string>\",\n \"dataset_id\": \"<string>\",\n \"n_epochs\": 123,\n \"train_with_lora\": true,\n \"batch_size\": 123,\n \"wandb_key\": \"<string>\",\n \"learning_rate\": 123,\n \"n_checkpoints_and_evaluations_per_epoch\": 1,\n \"save_only_best_checkpoint\": false,\n \"lora_config\": {},\n \"early_stopping_config\": {}\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.getflex.ai/v1/fine_tunes/create_finetune")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"model\": \"<string>\",\n \"dataset_id\": \"<string>\",\n \"n_epochs\": 123,\n \"train_with_lora\": true,\n \"batch_size\": 123,\n \"wandb_key\": \"<string>\",\n \"learning_rate\": 123,\n \"n_checkpoints_and_evaluations_per_epoch\": 1,\n \"save_only_best_checkpoint\": false,\n \"lora_config\": {},\n \"early_stopping_config\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getflex.ai/v1/fine_tunes/create_finetune")
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 \"name\": \"<string>\",\n \"model\": \"<string>\",\n \"dataset_id\": \"<string>\",\n \"n_epochs\": 123,\n \"train_with_lora\": true,\n \"batch_size\": 123,\n \"wandb_key\": \"<string>\",\n \"learning_rate\": 123,\n \"n_checkpoints_and_evaluations_per_epoch\": 1,\n \"save_only_best_checkpoint\": false,\n \"lora_config\": {},\n \"early_stopping_config\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"config": {},
"user_id": "<string>",
"model_id": "<string>",
"name": "<string>",
"checkpoints_count": 123,
"total_steps": 123,
"dataset_id": "<string>",
"engine_data": {
"runpod_run_id": "<string>"
}
}{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
⌘I