Models
Keep model warm
Enable or disable keeping the production version loaded between requests.
POST
/
v1
/
models
/
{name}
/
keep-warm
Keep model warm
curl --request POST \
--url https://console.sqwish.ai/v1/models/{name}/keep-warm \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true
}
'import requests
url = "https://console.sqwish.ai/v1/models/{name}/keep-warm"
payload = { "enabled": True }
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})
};
fetch('https://console.sqwish.ai/v1/models/{name}/keep-warm', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"object": "model",
"kind": "named",
"production": {
"version": 123,
"ref": "<string>",
"adapter": "<string>",
"status": "<string>",
"state": "loaded",
"parent": "<string>",
"created_at": 123,
"gate": {
"passed": true,
"against": "parent",
"reasons": [
"<string>"
],
"groups": {},
"deltas": {},
"ece": {}
},
"heldout": {}
},
"candidate": {
"version": 123,
"ref": "<string>",
"adapter": "<string>",
"status": "<string>",
"state": "loaded",
"parent": "<string>",
"created_at": 123,
"gate": {
"passed": true,
"against": "parent",
"reasons": [
"<string>"
],
"groups": {},
"deltas": {},
"ece": {}
},
"heldout": {}
},
"previous": {
"version": 123,
"ref": "<string>",
"adapter": "<string>",
"status": "<string>",
"state": "loaded",
"parent": "<string>",
"created_at": 123,
"gate": {
"passed": true,
"against": "parent",
"reasons": [
"<string>"
],
"groups": {},
"deltas": {},
"ece": {}
},
"heldout": {}
},
"keep_warm": true,
"learning": {
"enabled": true,
"after": 123,
"auto_promote": true,
"labelled": 123,
"waiting": "<string>",
"next_round_after": 123,
"round": {
"job": "<string>",
"version": 123,
"state": "<string>",
"started_at": 123,
"message": "<string>"
}
},
"versions": [
{
"version": 123,
"ref": "<string>",
"adapter": "<string>",
"status": "<string>",
"state": "loaded",
"parent": "<string>",
"created_at": 123,
"gate": {
"passed": true,
"against": "parent",
"reasons": [
"<string>"
],
"groups": {},
"deltas": {},
"ece": {}
},
"heldout": {}
}
],
"memory": {}
}{
"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
application/json
Response
Successful Response
Allowed value:
"model"Allowed value:
"named"Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Keep model warm
curl --request POST \
--url https://console.sqwish.ai/v1/models/{name}/keep-warm \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true
}
'import requests
url = "https://console.sqwish.ai/v1/models/{name}/keep-warm"
payload = { "enabled": True }
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})
};
fetch('https://console.sqwish.ai/v1/models/{name}/keep-warm', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"object": "model",
"kind": "named",
"production": {
"version": 123,
"ref": "<string>",
"adapter": "<string>",
"status": "<string>",
"state": "loaded",
"parent": "<string>",
"created_at": 123,
"gate": {
"passed": true,
"against": "parent",
"reasons": [
"<string>"
],
"groups": {},
"deltas": {},
"ece": {}
},
"heldout": {}
},
"candidate": {
"version": 123,
"ref": "<string>",
"adapter": "<string>",
"status": "<string>",
"state": "loaded",
"parent": "<string>",
"created_at": 123,
"gate": {
"passed": true,
"against": "parent",
"reasons": [
"<string>"
],
"groups": {},
"deltas": {},
"ece": {}
},
"heldout": {}
},
"previous": {
"version": 123,
"ref": "<string>",
"adapter": "<string>",
"status": "<string>",
"state": "loaded",
"parent": "<string>",
"created_at": 123,
"gate": {
"passed": true,
"against": "parent",
"reasons": [
"<string>"
],
"groups": {},
"deltas": {},
"ece": {}
},
"heldout": {}
},
"keep_warm": true,
"learning": {
"enabled": true,
"after": 123,
"auto_promote": true,
"labelled": 123,
"waiting": "<string>",
"next_round_after": 123,
"round": {
"job": "<string>",
"version": 123,
"state": "<string>",
"started_at": 123,
"message": "<string>"
}
},
"versions": [
{
"version": 123,
"ref": "<string>",
"adapter": "<string>",
"status": "<string>",
"state": "loaded",
"parent": "<string>",
"created_at": 123,
"gate": {
"passed": true,
"against": "parent",
"reasons": [
"<string>"
],
"groups": {},
"deltas": {},
"ece": {}
},
"heldout": {}
}
],
"memory": {}
}{
"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>"
}
]
}
}