Keep a family warm
Keep the model a family serves loaded between requests, or stop. Switching on a family
that serves no model gets 409 family_empty, and one that is switched off 409 family_off.
With served, the id of the model it served when the caller looked, only while it still
serves that model: 409 served_changed otherwise. Keep warm follows the family when it
moves. switch_off stops keep warm on families or models in the same step and leaves
their switches on, so a request at the limit can swap. Past the account’s limit, 409
warm_limit lists the models still kept warm after that, least recently used first
(used_at), each with the keep warms that hold it: its own (keep_warm) and its
families’ (families). A size with no kept-warm place left answers 503 warm_capacity,
unless switch_off stops a model of that size.
curl --request POST \
--url https://console.sqwish.ai/v1/families/{family}/keep-warm \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"max_price_usd": "<string>",
"served": "<string>",
"switch_off": [
"<string>"
]
}
'import requests
url = "https://console.sqwish.ai/v1/families/{family}/keep-warm"
payload = {
"enabled": True,
"max_price_usd": "<string>",
"served": "<string>",
"switch_off": ["<string>"]
}
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({
enabled: true,
max_price_usd: '<string>',
served: '<string>',
switch_off: ['<string>']
})
};
fetch('https://console.sqwish.ai/v1/families/{family}/keep-warm', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"object": "family",
"switched_on": true,
"used_at": 123,
"switches_off_at": 123,
"off_reason": "owner",
"off_at": 123,
"dataset_id": "<string>",
"origin": "<string>",
"created_at": 123,
"served": {
"version": 123,
"ref": "<string>",
"adapter": "<string>",
"status": "<string>",
"on_at": 123,
"keep_warm": true,
"keep_warm_stopped_at": 123,
"used_at": 123,
"switches_off_at": 123,
"off_reason": "owner",
"off_at": 123,
"state": "loaded",
"parent": "<string>",
"created_at": 123,
"gate": {
"passed": true,
"against": "parent",
"reasons": [
"<string>"
],
"groups": {},
"deltas": {},
"ece": {}
},
"heldout": {},
"discarded_at": 123
},
"latest": {
"version": 123,
"ref": "<string>",
"adapter": "<string>",
"status": "<string>",
"on_at": 123,
"keep_warm": true,
"keep_warm_stopped_at": 123,
"used_at": 123,
"switches_off_at": 123,
"off_reason": "owner",
"off_at": 123,
"state": "loaded",
"parent": "<string>",
"created_at": 123,
"gate": {
"passed": true,
"against": "parent",
"reasons": [
"<string>"
],
"groups": {},
"deltas": {},
"ece": {}
},
"heldout": {},
"discarded_at": 123
},
"models": [
{
"version": 123,
"ref": "<string>",
"adapter": "<string>",
"status": "<string>",
"on_at": 123,
"keep_warm": true,
"keep_warm_stopped_at": 123,
"used_at": 123,
"switches_off_at": 123,
"off_reason": "owner",
"off_at": 123,
"state": "loaded",
"parent": "<string>",
"created_at": 123,
"gate": {
"passed": true,
"against": "parent",
"reasons": [
"<string>"
],
"groups": {},
"deltas": {},
"ece": {}
},
"heldout": {},
"discarded_at": 123
}
],
"keep_warm": true,
"keep_warm_window": {
"started_at": 123,
"ends_at": 123,
"reserved_usd": "<string>"
},
"keep_warm_stopped_at": 123,
"move": {
"to": "<string>",
"waiting_for": "place",
"reason": "live_limit"
},
"moved": {
"at": 123,
"from": "<string>"
},
"continue": {
"state": "new_data",
"version": 123,
"added_at": 123,
"added_from": "<string>",
"evaluation_decisions": 123,
"needed": 123,
"rows": {
"new": 123,
"earlier": 123,
"evaluation": 123
},
"price_usd": "<string>"
},
"jobs": [
{
"id": "<string>",
"status": "queued",
"outcome": "joined",
"reason": "<string>",
"dataset_version": 123,
"output_model": "<string>",
"created_at": 123,
"price_usd": "<string>",
"charge": "free"
}
]
}{
"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.
Path Parameters
Body
The most you agree to pay for the first hour, which switching keep warm on holds, in USD, such as the price you were shown. If it costs more when it is admitted, it is refused with price_changed and nothing is held.
^\d{1,9}(\.\d{1,9})?$The id of the model the family served when the caller looked: refused unless it still does. Null for none.
140Families, such as router, and models, such as router@2, whose keep warm stops in the same step, to make room when the account is at its limit (warm_limit) or the model's size has no kept-warm place left (warm_capacity). Their switches stay on.
20Response
Successful Response
"family"Whether calls to its name are answered.
Its idle clock: the latest of its last production call by an API key that named it, its last evaluation that named it, and when it was switched on.
When idling switches it off unless it's used. Null while it is off or kept warm on its own switch, and when idling never switches anything off. A family's is also null while it serves no model.
Why it is off: owner when it was switched off by hand, idle when nothing used it for too long. Null otherwise.
owner, idle When it went off, with off_reason. Null otherwise.
The dataset it grows on.
Where it started: a base model, or one of your models.
When it was named, as its first fine-tune was queued.
The model calls to its name get while it is switched on, or null for none yet.
Show child attributes
Show child attributes
Its newest model, neither deleted nor discarded.
Show child attributes
Show child attributes
Every model of its line, oldest first. A deleted one shows only where it stood.
- ModelVersion
- DeletedModelVersion
Show child attributes
Show child attributes
The hour of keep warm being billed for the model the family serves, while the family is kept warm. Null otherwise: a model kept warm on its own shows its own hour.
Show child attributes
Show child attributes
When keep warm switched off because the next hour couldn't be reserved, while it stays off. Otherwise null.
The move to its latest model it waits to make, and what it waits for. Null while it serves its latest model, or is switched off.
Show child attributes
Show child attributes
When it last moved by itself to the model it serves, and from which. Null when it never did, or serves another model or was rolled back since.
Show child attributes
Show child attributes
What continuing it would do now, from the family's dataset and jobs. It doesn't check credit, storage allowance or queue room, which the start refuses with insufficient_credit, storage_allowance, queue_full or tenant_queue_full. Null for a family with no dataset. A list of families reads no dataset: there new_data and retry only say a version no finished job used is waiting, and the counts and fee are null. The answers of a switch, keep warm or rollback leave it out.
Show child attributes
Show child attributes
Its fine-tunes, newest first, with how each ended. Lists of families, and the answers of a switch, keep warm or rollback, leave it out.
Show child attributes
Show child attributes
curl --request POST \
--url https://console.sqwish.ai/v1/families/{family}/keep-warm \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"max_price_usd": "<string>",
"served": "<string>",
"switch_off": [
"<string>"
]
}
'import requests
url = "https://console.sqwish.ai/v1/families/{family}/keep-warm"
payload = {
"enabled": True,
"max_price_usd": "<string>",
"served": "<string>",
"switch_off": ["<string>"]
}
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({
enabled: true,
max_price_usd: '<string>',
served: '<string>',
switch_off: ['<string>']
})
};
fetch('https://console.sqwish.ai/v1/families/{family}/keep-warm', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"object": "family",
"switched_on": true,
"used_at": 123,
"switches_off_at": 123,
"off_reason": "owner",
"off_at": 123,
"dataset_id": "<string>",
"origin": "<string>",
"created_at": 123,
"served": {
"version": 123,
"ref": "<string>",
"adapter": "<string>",
"status": "<string>",
"on_at": 123,
"keep_warm": true,
"keep_warm_stopped_at": 123,
"used_at": 123,
"switches_off_at": 123,
"off_reason": "owner",
"off_at": 123,
"state": "loaded",
"parent": "<string>",
"created_at": 123,
"gate": {
"passed": true,
"against": "parent",
"reasons": [
"<string>"
],
"groups": {},
"deltas": {},
"ece": {}
},
"heldout": {},
"discarded_at": 123
},
"latest": {
"version": 123,
"ref": "<string>",
"adapter": "<string>",
"status": "<string>",
"on_at": 123,
"keep_warm": true,
"keep_warm_stopped_at": 123,
"used_at": 123,
"switches_off_at": 123,
"off_reason": "owner",
"off_at": 123,
"state": "loaded",
"parent": "<string>",
"created_at": 123,
"gate": {
"passed": true,
"against": "parent",
"reasons": [
"<string>"
],
"groups": {},
"deltas": {},
"ece": {}
},
"heldout": {},
"discarded_at": 123
},
"models": [
{
"version": 123,
"ref": "<string>",
"adapter": "<string>",
"status": "<string>",
"on_at": 123,
"keep_warm": true,
"keep_warm_stopped_at": 123,
"used_at": 123,
"switches_off_at": 123,
"off_reason": "owner",
"off_at": 123,
"state": "loaded",
"parent": "<string>",
"created_at": 123,
"gate": {
"passed": true,
"against": "parent",
"reasons": [
"<string>"
],
"groups": {},
"deltas": {},
"ece": {}
},
"heldout": {},
"discarded_at": 123
}
],
"keep_warm": true,
"keep_warm_window": {
"started_at": 123,
"ends_at": 123,
"reserved_usd": "<string>"
},
"keep_warm_stopped_at": 123,
"move": {
"to": "<string>",
"waiting_for": "place",
"reason": "live_limit"
},
"moved": {
"at": 123,
"from": "<string>"
},
"continue": {
"state": "new_data",
"version": 123,
"added_at": 123,
"added_from": "<string>",
"evaluation_decisions": 123,
"needed": 123,
"rows": {
"new": 123,
"earlier": 123,
"evaluation": 123
},
"price_usd": "<string>"
},
"jobs": [
{
"id": "<string>",
"status": "queued",
"outcome": "joined",
"reason": "<string>",
"dataset_version": 123,
"output_model": "<string>",
"created_at": 123,
"price_usd": "<string>",
"charge": "free"
}
]
}{
"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>"
}
]
}
}