> ## Documentation Index
> Fetch the complete documentation index at: https://vastai-80aa3a82-docs-host-security-hardening.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# VastAI.create_workergroup

Create a new autoscale worker group.

## Signature

```python theme={null}
VastAI.create_workergroup(
    template_hash: Optional[str] = None,
    template_id: Optional[int] = None,
    no_default: bool = False,
    launch_args: Optional[str] = None,
    endpoint_name: Optional[str] = None,
    endpoint_id: Optional[int] = None,
    gpu_ram: Optional[float] = None,
    search_params: Optional[str] = None
) -> dict
```

## Parameters

<ParamField path="template_hash" type="Optional[str]">
  template hash (required, but **Note**: if you use this field, you can skip search\_params, as they are automatically inferred from the template)
</ParamField>

<ParamField path="template_id" type="Optional[int]">
  template id (optional)
</ParamField>

<ParamField path="no_default" type="bool">
  Disable default search param query args
</ParamField>

<ParamField path="launch_args" type="Optional[str]">
  launch args  string for create instance  ex: "--onstart onstart\_wget.sh  --env '-e ONSTART\_PATH=[https://s3.amazonaws.com/vast.ai/onstart\_OOBA.sh](https://s3.amazonaws.com/vast.ai/onstart_OOBA.sh)' --image atinoda/text-generation-webui:default-nightly --disk 64"
</ParamField>

<ParamField path="endpoint_name" type="Optional[str]">
  deployment endpoint name (allows multiple workergroups to share same deployment endpoint)
</ParamField>

<ParamField path="endpoint_id" type="Optional[int]">
  deployment endpoint id (allows multiple workergroups to share same deployment endpoint)
</ParamField>

<ParamField path="gpu_ram" type="Optional[float]">
  estimated GPU RAM req  (independent of search string)
</ParamField>

<ParamField path="search_params" type="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"
</ParamField>

## Returns

`dict`

## Example

```python theme={null}
from vastai import VastAI

client = VastAI(api_key="YOUR_API_KEY")
result = client.create_workergroup()
print(result)
```
