Estimate the fee of starting a family
The exact fee POST /v1/fine-tuning/jobs would hold for the same body now, without
max_price_usd, and the training tokens and steps it is for. It reads and counts the
dataset as the start does, and refuses what the start would about the dataset, the family
name, the base, the rows and the steps. Nothing is queued or held, and credit, storage and
queue room are checked when the job starts. The estimate is exact if nothing changes
before you start; pass it as max_price_usd to cap the price.
curl --request POST \
--url https://console.sqwish.ai/v1/fine-tuning/jobs/estimate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dataset_id": "<string>",
"family": "<string>",
"from": "sqwish-decision-core",
"method": "sft",
"hyperparameters": {
"steps": 1000,
"learning_rate": 0.00005,
"lora_rank": 8,
"seed": 42,
"checkpoint_every": 10,
"kl_coefficient": 0.05
}
}
'import requests
url = "https://console.sqwish.ai/v1/fine-tuning/jobs/estimate"
payload = {
"dataset_id": "<string>",
"family": "<string>",
"from": "sqwish-decision-core",
"method": "sft",
"hyperparameters": {
"steps": 1000,
"learning_rate": 0.00005,
"lora_rank": 8,
"seed": 42,
"checkpoint_every": 10,
"kl_coefficient": 0.05
}
}
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({
dataset_id: '<string>',
family: '<string>',
from: 'sqwish-decision-core',
method: 'sft',
hyperparameters: {
steps: 1000,
learning_rate: 0.00005,
lora_rank: 8,
seed: 42,
checkpoint_every: 10,
kl_coefficient: 0.05
}
})
};
fetch('https://console.sqwish.ai/v1/fine-tuning/jobs/estimate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"currency": "USD",
"price_usd": "<string>",
"minimum_applied": true,
"trained_tokens": 123,
"steps": 123,
"seed": 123,
"passes": 123,
"train_rows": 123,
"dataset_version": 123
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": [
{
"path": [
"<string>"
],
"message": "<string>",
"type": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": [
{
"path": [
"<string>"
],
"message": "<string>",
"type": "<string>"
}
]
}
}Authorizations
Create an API key in the console. Required when accounts are enabled.
Body
A new family's first fine-tune, from a base or one of your models, as its estimate takes it: the body that starts it, without max_price_usd.
^ds_[a-f0-9]{24}$The new family's name: lowercase letters and digits, with single hyphens between them, 2 to 63 characters. A name already taken is refused with family_exists.
63^[a-z](?:-?[a-z0-9]){1,62}$Where the family starts: a base model that can be fine-tuned, or one of your models as family@N, which it trains from on that model's base. Left out, Core.
1 - 140sft, reward Show child attributes
Show child attributes
Response
Successful Response
"USD"The fee a fine-tune started now with the same body would hold, as exact USD: its base's fine_tune_million_tokens_usd for trained_tokens, and at least fine_tune_minimum_usd. 0 when it would be free. The job's price_usd is this sum while the prices, the account, the dataset and the family stay as they are; send it as max_price_usd, and a job that would cost more is refused with price_changed.
True when the fee is fine_tune_minimum_usd, which is more than its training tokens cost.
The training tokens it would train, as the job's split.trained_tokens counts them. Null only for a free fine-tune whose rows can't be counted.
Its training steps: the ones sent, or the default passes.
Its seed, which orders the rows its steps take.
How many times its steps go over its training rows, to two decimals.
The training rows it trains on: a continuation's new rows and the earlier rows sampled with them.
The dataset version it would train on: its newest.
curl --request POST \
--url https://console.sqwish.ai/v1/fine-tuning/jobs/estimate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dataset_id": "<string>",
"family": "<string>",
"from": "sqwish-decision-core",
"method": "sft",
"hyperparameters": {
"steps": 1000,
"learning_rate": 0.00005,
"lora_rank": 8,
"seed": 42,
"checkpoint_every": 10,
"kl_coefficient": 0.05
}
}
'import requests
url = "https://console.sqwish.ai/v1/fine-tuning/jobs/estimate"
payload = {
"dataset_id": "<string>",
"family": "<string>",
"from": "sqwish-decision-core",
"method": "sft",
"hyperparameters": {
"steps": 1000,
"learning_rate": 0.00005,
"lora_rank": 8,
"seed": 42,
"checkpoint_every": 10,
"kl_coefficient": 0.05
}
}
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({
dataset_id: '<string>',
family: '<string>',
from: 'sqwish-decision-core',
method: 'sft',
hyperparameters: {
steps: 1000,
learning_rate: 0.00005,
lora_rank: 8,
seed: 42,
checkpoint_every: 10,
kl_coefficient: 0.05
}
})
};
fetch('https://console.sqwish.ai/v1/fine-tuning/jobs/estimate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"currency": "USD",
"price_usd": "<string>",
"minimum_applied": true,
"trained_tokens": 123,
"steps": 123,
"seed": 123,
"passes": 123,
"train_rows": 123,
"dataset_version": 123
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": [
{
"path": [
"<string>"
],
"message": "<string>",
"type": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": [
{
"path": [
"<string>"
],
"message": "<string>",
"type": "<string>"
}
]
}
}