Skip to content
Alphahelmstudio is early software: things will change, and some will break.What's newReport an issue

Set what stays loaded after a run, the idle timeout and the memory reserve, for every env of a host

PUT
/v1/studio/admin/hosts/{host}/settings
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).

host
required
string

Unknown or malformed = 404)

Media typeapplication/json
object
after_run
required

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

string
Allowed values: unload keep_warm keep_pinned
idle_unload_min
required

Keep_warm: minutes idle before everything but the pins is unloaded; 0 = never

integer
<= 1440
reserve_gb
required

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)

number
<= 1024 multiple of 0.5
reserve_mode

: 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)

string
Allowed values: auto custom

The settings

Media typeapplication/json
object
host
required
string
version
required
integer
>= 1
after_run
required

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

string
Allowed values: unload keep_warm keep_pinned
idle_unload_min
required
integer
<= 1440
reserve_gb
required
number
reserve_mode
required

: 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)

string
Allowed values: auto custom
pins
required
Array<object>

One resident entry’s identity (registry $defs/pin): what a resident component of GET /v1/studio/hosts shows, with its entry’s env

object
env
required
string
/^[a-z0-9]{1,32}$/
component
required
string
/^[a-z][a-z0-9_]{0,63}$/
model
required
string
/^[a-z0-9][a-z0-9_.-]{0,63}$/
variant
required
string
/^[a-z0-9][a-z0-9_-]{0,63}$/
precision
required
string
Allowed values: bf16 fp16 int8 int4 fp8 fp32
compute

The entry’s compute as GET /v1/studio/hosts shows it; absent = float32

string
Allowed values: float32 float16
loras

A baked set, in order (lora_id and strength as the admin’s hosts view shows them); absent or empty = the plain component

Array<object>
<= 32 items
object
lora_id
required
string
/^([0-9a-f]{64}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/
strength
required
number
applied
required

Every fresh hosts key of the host (but a local server’s server env, which holds no weights) reports policy.settings_version = version

boolean
updated_at
required
string format: date-time

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

Media typeapplication/json
object
detail
required
string

Example generated

{
"detail": "example"
}

Valid token without the admin role: “admin role required”

Media typeapplication/json
object
detail
required
string

Example generated

{
"detail": "example"
}

Not found

Media typeapplication/json
object
detail
required
string

Example generated

{
"detail": "example"
}

Invalid input

Media typeapplication/json
object
detail
required
string

Example generated

{
"detail": "example"
}

Retryable

Media typeapplication/json
object
detail
required
string

Example generated

{
"detail": "example"
}