Skip to main content
Update an existing autoscale worker group.

Signature

VastAI.update_workergroup(
    id: int,
    min_load: Optional[float] = None,
    target_util: Optional[float] = None,
    cold_mult: Optional[float] = None,
    cold_workers: Optional[int] = None,
    test_workers: Optional[int] = None,
    gpu_ram: Optional[float] = None,
    template_hash: Optional[str] = None,
    template_id: Optional[int] = None,
    search_params: Optional[str] = None,
    no_default: bool = False,
    launch_args: Optional[str] = None,
    endpoint_name: Optional[str] = None,
    endpoint_id: Optional[int] = None
) -> dict

Parameters

id
int
required
id of autoscale group to update
min_load
Optional[float]
minimum floor load in perf units/s (token/s for LLms)
target_util
Optional[float]
target capacity utilization (fraction, max 1.0, default 0.9)
cold_mult
Optional[float]
cold/stopped instance capacity target as multiple of hot capacity target (default 2.5)
cold_workers
Optional[int]
min number of workers to keep ‘cold’ for this workergroup
test_workers
Optional[int]
number of workers to create to get an performance estimate for while initializing workergroup (default 3)
gpu_ram
Optional[float]
estimated GPU RAM req (independent of search string)
template_hash
Optional[str]
template hash (Note: if you use this field, you can skip search_params, as they are automatically inferred from the template)
template_id
Optional[int]
template id
search_params
Optional[str]
search param string for search offers ex: “gpu_ram>=23 num_gpus=2 gpu_name=RTX_4090 inet_down>200 direct_port_count>2 disk_space>=64”
no_default
bool
Disable default search param query args
launch_args
Optional[str]
launch args string for create instance ex: “—onstart onstart_wget.sh —env ‘-e ONSTART_PATH=https://s3.amazonaws.com/public.vast.ai/onstart_OOBA.sh’ —image atinoda/text-generation-webui:default-nightly —disk 64”
endpoint_name
Optional[str]
deployment endpoint name (allows multiple workergroups to share same deployment endpoint)
endpoint_id
Optional[int]
deployment endpoint id (allows multiple workergroups to share same deployment endpoint)

Returns

dict

Example

from vastai import VastAI

client = VastAI(api_key="YOUR_API_KEY")
result = client.update_workergroup(id=12345)
print(result)