Skip to main content
Update an existing template.

Signature

VastAI.update_template(
    HASH_ID: str,
    name: Optional[str] = None,
    image: Optional[str] = None,
    env: Optional[str] = None,
    onstart_cmd: Optional[str] = None,
    search_params: Optional[str] = None,
    disk: Optional[float] = None,
    ssh: bool = False,
    direct: bool = False,
    jupyter: bool = False
) -> str

Parameters

HASH_ID
str
required
Hash ID of the template to update.
name
Optional[str]
New name for the template.
image
Optional[str]
New Docker image for the template.
env
Optional[str]
Environment variables to set (formatted as Docker -e flags).
onstart_cmd
Optional[str]
Shell command to run on instance start.
search_params
Optional[str]
Default search query parameters for this template.
disk
Optional[float]
Disk space allocation in GB.
ssh
bool
default:"False"
Enable SSH access for instances created from this template.
direct
bool
default:"False"
Enable direct (peer-to-peer) connections.
jupyter
bool
default:"False"
Enable Jupyter notebook server.

Returns

str — Result from the API call.

Example

from vastai import VastAI

client = VastAI(api_key="YOUR_API_KEY")
result = client.update_template(HASH_ID="...")
print(result)