Creates a new template for launching instances.
Templates store default configuration values that can be used when creating instances. When an instance is created with a template reference, template values serve as defaults that can be overridden by request parameters.
For detailed usage, see Creating and Using Templates with API.
CLI Usage: vastai create template --name <name> --image <image> [options]
API key must be provided in the Authorization header
Name of the template
Docker image path. Used when launching instances from this template.
Docker image tag specifying version of the image. Defaults to latest. Can also be included in the image field instead.
Environment variables and port mappings in Docker flag format.
Example: "-e HF_TOKEN=hf_xxx123456789 -e MODEL_ID=TheBloke/Llama-2-7B-Chat-GPTQ -p 8000:8000"
Commands to run when instance starts
Example : env | grep _ >> /etc/environment; echo 'starting up'
Launch mode for the instance. Defaults to args. Recommended: use ssh with ssh_direct: true for reliable SSH access.
ssh, jupyter, args Enable direct SSH connection
Enable direct Jupyter connection
Directory to launch Jupyter from
Example : /home/notebooks
Use JupyterLab instead of Jupyter Notebook
Name of the private Docker repo (i.e docker.io)
Username for private Docker repo
Access token or password for private Docker repo.
Additional machine search filters. Example: {"cuda_max_good": {"gte": 12.6}}
Recommended disk space in GB. Defaults to 8GB if not specified.
Short description of the template
Longer documentation/readme content for the template
Arguments string passed to the container entrypoint when runtype is args
Enable SSH access to instances created from this template
Link to Docker Hub or image documentation
Repository identifier (e.g., library/ubuntu)
Whether the template is private (not publicly searchable)
UI hint for volume configuration. Note: This does not affect instance creation - use volume_info in the instance creation request to actually attach volumes.
Content-based hash ID of the template. Can be included when editing but will change based on new content.