Set what stays loaded after a run, the idle timeout and the memory reserve, for every env of a host
const url = 'http://localhost:8300/v1/studio/admin/hosts/example/settings';const options = { method: 'PUT', headers: { 'x-api-key': '<x-api-key>', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"after_run":"unload","idle_unload_min":1,"reserve_gb":1,"reserve_mode":"auto"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url http://localhost:8300/v1/studio/admin/hosts/example/settings \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'x-api-key: <x-api-key>' \ --data '{ "after_run": "unload", "idle_unload_min": 1, "reserve_gb": 1, "reserve_mode": "auto" }'Admin only (403). <host>; each runner of the host applies it at once when idle, else after its run, without a restart, and reports it in its hosts key (policy.settings_version; HostSettings.applied). A first PUT creates the row with no pins. 404 for a host with no present hosts key. 422 reserve_gb leaves no memory on <host> (reserve_gb ≥ the smallest memory the host’s keys cut their budget from: device.memory_total_gb (VRAM) for a key whose device.kind is cuda, else machine.ram_gb; reserve_mode: auto = the budget follows the macOS GPU limit when one is set (machine.gpu_limit_gb, at most RAM − 4 GB), else device memory − RUNNER_RESERVE_GB; custom = device memory − reserve_gb (as before). Absent on the PUT = unchanged (a new row: custom).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Unknown or malformed = 404)
Request Bodyrequired
Section titled “Request Bodyrequired”object
What stays loaded once a run ends: unload = nothing; keep_warm = everything until memory is needed or the idle timeout passes (the default); keep_pinned = only the pins
Keep_warm: minutes idle before everything but the pins is unloaded; 0 = never
Custom: the host’s budget is its RAM (on cuda: its VRAM) minus this; kept in auto (used again on a switch back to custom)
: auto = the macOS GPU limit when set (at most RAM − 4 GB), else device memory − RUNNER_RESERVE_GB; custom = device memory − reserve_gb (the default). Absent = custom (a PUT: unchanged)
Responses
Section titled “Responses”The settings
object
What stays loaded once a run ends: unload = nothing; keep_warm = everything until memory is needed or the idle timeout passes (the default); keep_pinned = only the pins
: auto = the macOS GPU limit when set (at most RAM − 4 GB), else device memory − RUNNER_RESERVE_GB; custom = device memory − reserve_gb (the default). Absent = custom (a PUT: unchanged)
One resident entry’s identity (registry $defs/pin): what a resident component of GET /v1/studio/hosts shows, with its entry’s env
object
The entry’s compute as GET /v1/studio/hosts shows it; absent = float32
A baked set, in order (lora_id and strength as the admin’s hosts view shows them); absent or empty = the plain component
object
Every fresh hosts key of the host (but a local server’s server env, which holds no weights) reports policy.settings_version = version
Example
{ "after_run": "unload", "reserve_mode": "auto", "pins": [ { "precision": "bf16", "compute": "float32" } ]}Missing or invalid x-api-key (Kong), or missing/invalid/expired/revoked bearer token
object
Example generated
{ "detail": "example"}Valid token without the admin role: “admin role required”
object
Example generated
{ "detail": "example"}Not found
object
Example generated
{ "detail": "example"}Invalid input
object
Example generated
{ "detail": "example"}Retryable
object
Example generated
{ "detail": "example"}