Deactivate model
Take a named model out of service: calls to its name get 409 no_production_version
until a version is promoted. Its production version becomes the previous version, so
promoting it or rolling back serves it again, and keep warm switches off. Versions can
still be called by number, such as router@2. With version, only while production is
still that version; otherwise 409 production_changed.
curl --request POST \
--url https://console.sqwish.ai/v1/models/{name}/deactivate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"version": "<string>"
}
'import requests
url = "https://console.sqwish.ai/v1/models/{name}/deactivate"
payload = { "version": "<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({version: '<string>'})
};
fetch('https://console.sqwish.ai/v1/models/{name}/deactivate', 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,
"keep_warm_window": {
"started_at": 123,
"ends_at": 123,
"reserved_usd": "<string>"
},
"keep_warm_stopped_at": 123,
"learning": {
"enabled": true,
"after": 123,
"auto_promote": true,
"labelled": 123,
"carried": 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
^\d{1,6}$Response
Successful Response
"model""named"Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
The hour of keep warm being billed, or null when nothing is billed.
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.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
curl --request POST \
--url https://console.sqwish.ai/v1/models/{name}/deactivate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"version": "<string>"
}
'import requests
url = "https://console.sqwish.ai/v1/models/{name}/deactivate"
payload = { "version": "<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({version: '<string>'})
};
fetch('https://console.sqwish.ai/v1/models/{name}/deactivate', 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,
"keep_warm_window": {
"started_at": 123,
"ends_at": 123,
"reserved_usd": "<string>"
},
"keep_warm_stopped_at": 123,
"learning": {
"enabled": true,
"after": 123,
"auto_promote": true,
"labelled": 123,
"carried": 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>"
}
]
}
}