Models
Switch a model
Switch a model’s own switch, by its number such as router@4. On, it answers calls to
that number, loaded and probed first, which takes a place unless it answers already:
past the account’s limit, 409 live_limit lists what answers, and switch_off switches
families or models off in the same step. Off, calls to its number stop, and so does its
own keep warm. With adapter, only while the number names the model the caller saw: 409
model_changed, which also answers when the model, read as on, was switched off before the
switch took hold.
POST
/
v1
/
models
/
{model}
/
switch
Switch a model
curl --request POST \
--url https://api.sqwish.ai/v1/models/{model}/switch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"on": true,
"switch_off": [
"<string>"
],
"adapter": "<string>"
}
'import requests
url = "https://api.sqwish.ai/v1/models/{model}/switch"
payload = {
"on": True,
"switch_off": ["<string>"],
"adapter": "<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({on: true, switch_off: ['<string>'], adapter: '<string>'})
};
fetch('https://api.sqwish.ai/v1/models/{model}/switch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"status": "<string>",
"evaluation_key": "<string>",
"name": "<string>",
"description": "<string>",
"family": "<string>",
"size_order": 123,
"lora": "<string>",
"metrics": {},
"max_input_tokens": 123,
"max_questions": 123,
"calibration": "<string>",
"availability_reason": "<string>",
"adapter_capacity": {
"max_rank": 123
},
"created_at": 123,
"deleted_at": 123,
"discarded_at": 123,
"on_at": 123,
"keep_warm": true,
"keep_warm_window": {
"started_at": 123,
"ends_at": 123,
"reserved_usd": "<string>"
},
"keep_warm_trial": {
"slot": 123,
"started_at": 123,
"ends_at": 123,
"state": "pending"
},
"keep_warm_stopped_at": 123,
"used_at": 123,
"switches_off_at": 123,
"off_reason": "owner",
"off_at": 123,
"job_id": "<string>",
"model_name": "<string>",
"version": 123,
"parent": "<string>",
"decision_price_nano": "<string>",
"base": "<string>",
"evaluation_set": {
"dataset": {
"id": "<string>",
"name": "<string>",
"archived_at": 123,
"deleted": true
},
"training_examples": 123,
"validation_examples": 123,
"earlier_examples": 123
},
"request_latency": {
"median_ms": 123,
"samples": 123,
"median_is_lower_bound": true,
"start": "<string>",
"end": "<string>"
}
}{
"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>"
}
]
}
}Body
application/json
Response
Successful Response
A base model or a trained adapter.
Switch a model
curl --request POST \
--url https://api.sqwish.ai/v1/models/{model}/switch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"on": true,
"switch_off": [
"<string>"
],
"adapter": "<string>"
}
'import requests
url = "https://api.sqwish.ai/v1/models/{model}/switch"
payload = {
"on": True,
"switch_off": ["<string>"],
"adapter": "<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({on: true, switch_off: ['<string>'], adapter: '<string>'})
};
fetch('https://api.sqwish.ai/v1/models/{model}/switch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"status": "<string>",
"evaluation_key": "<string>",
"name": "<string>",
"description": "<string>",
"family": "<string>",
"size_order": 123,
"lora": "<string>",
"metrics": {},
"max_input_tokens": 123,
"max_questions": 123,
"calibration": "<string>",
"availability_reason": "<string>",
"adapter_capacity": {
"max_rank": 123
},
"created_at": 123,
"deleted_at": 123,
"discarded_at": 123,
"on_at": 123,
"keep_warm": true,
"keep_warm_window": {
"started_at": 123,
"ends_at": 123,
"reserved_usd": "<string>"
},
"keep_warm_trial": {
"slot": 123,
"started_at": 123,
"ends_at": 123,
"state": "pending"
},
"keep_warm_stopped_at": 123,
"used_at": 123,
"switches_off_at": 123,
"off_reason": "owner",
"off_at": 123,
"job_id": "<string>",
"model_name": "<string>",
"version": 123,
"parent": "<string>",
"decision_price_nano": "<string>",
"base": "<string>",
"evaluation_set": {
"dataset": {
"id": "<string>",
"name": "<string>",
"archived_at": 123,
"deleted": true
},
"training_examples": 123,
"validation_examples": 123,
"earlier_examples": 123
},
"request_latency": {
"median_ms": 123,
"samples": 123,
"median_is_lower_bound": true,
"start": "<string>",
"end": "<string>"
}
}{
"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>"
}
]
}
}