Skip to main content
Create a new template

Usage

vastai create template

Options

--name
string
name of the template
--image
string
docker container image to launch
--image_tag
string
docker image tag (can also be appended to end of image_path)
--href
string
link you want to provide
--repo
string
link to repository
--login
string
docker login arguments for private repo authentication, surround with ”
--env
string
Contents of the ‘Docker options’ field
--ssh
boolean
Launch as an ssh instance type
--jupyter
boolean
Launch as a jupyter instance instead of an ssh instance
--direct
boolean
Use (faster) direct connections for jupyter & ssh
--jupyter-dir
string
For runtype ‘jupyter’, directory in instance to use to launch jupyter. Defaults to image’s working directory
--jupyter-lab
boolean
For runtype ‘jupyter’, Launch instance with jupyter lab
--onstart-cmd
string
contents of onstart script as single argument
--search_params
string
search offers filters
-n
boolean
Disable default search param query args (alias: --no-default)
--disk_space
string
disk storage space, in GB
--readme
string
readme string
--hide-readme
boolean
hide the readme from users
--desc
string
description string
--public
boolean
make template available to public

Description

Create a template that can be used to create instances with

Examples

vastai create template --name "tgi-llama2-7B-quantized" --image "ghcr.io/huggingface/text-generation-inference:1.0.3"
                            --env "-p 3000:3000 -e MODEL_ARGS='--model-id TheBloke/Llama-2-7B-chat-GPTQ --quantize gptq'"
                            --onstart-cmd 'wget -O - https://raw.githubusercontent.com/vast-ai/vast-pyworker/main/scripts/launch_tgi.sh | bash'
                            --search_params "gpu_ram>=23 num_gpus=1 gpu_name=RTX_3090 inet_down>128 direct_port_count>3 disk_space>=192 driver_version>=535086005 rented=False"
                            --disk_space 8.0 --ssh --direct

Global Options

The following options are available for all commands:
OptionDescription
--url URLServer REST API URL
--retry NRetry limit
--rawOutput machine-readable JSON
--explainVerbose explanation of API calls
--api-key KEYAPI key (defaults to ~/.config/vastai/vast_api_key)