Skip to main content
Launch the top instance from the search offers based on the given parameters

Usage

vastai launch instance [--help] [--api-key API_KEY] <gpu_name> <num_gpus> <image> [geolocation] [disk_space]

Options

-g
string
Name of the GPU model, replace spaces with underscores (alias: --gpu-name) Choices: A10, A100_PCIE, A100_SXM4, A100X, A40, A800_PCIE, B200, CMP_50HX, GTX_1050, GTX_1050_Ti, GTX_1060, GTX_1070, GTX_1070_Ti, GTX_1080, GTX_1080_Ti, GTX_1650, GTX_1660, GTX_1660_S, GTX_1660_Ti, H100_NVL, H100_PCIE, H100_SXM, H200, H200_NVL, L4, L40, L40S, Q_RTX_4000, Q_RTX_6000, Q_RTX_8000, Quadro_P4000, Radeon_VII, RTX_2060, RTX_2060S, RTX_2070, RTX_2070S, RTX_2080, RTX_2080_Ti, RTX_3050, RTX_3060, RTX_3060_laptop, RTX_3060_Ti, RTX_3070, RTX_3070_laptop, RTX_3070_Ti, RTX_3080, RTX_3080_Ti, RTX_3090, RTX_3090_Ti, RTX_4000Ada, RTX_4060, RTX_4060_Ti, RTX_4070, RTX_4070S, RTX_4070S_Ti, RTX_4070_Ti, RTX_4080, RTX_4080S, RTX_4090, RTX_4090D, RTX_4500Ada, RTX_5000Ada, RTX_5060, RTX_5060_Ti, RTX_5070, RTX_5070_Ti, RTX_5080, RTX_5090, RTX_5880Ada, RTX_6000Ada, RTX_A2000, RTX_A4000, RTX_A4500, RTX_A5000, RTX_A6000, RTX_PRO_4000, RTX_PRO_4500, RTX_PRO_5000, RTX_PRO_6000_S, RTX_PRO_6000_WS, RX_6950_XT, Tesla_P100, Tesla_P4, Tesla_P40, Tesla_T4, Tesla_V100, Titan_RTX, Titan_V, Titan_Xp
-n
string
Number of GPUs required (alias: --num-gpus) Choices: 1, 2, 4, 8, 12, 14
-r
string
Geographical location of the instance (alias: --region)
-i
string
Name of the image to use for instance (alias: --image)
-d
number
default:"16.0"
Disk space required in GB (alias: --disk)
--limit
integer
default:"3"
-o
string
default:"score-"
Comma-separated list of fields to sort on. postfix field with - to sort desc. ex: -o ‘num_gpus,total_flops-’. default=‘score-’ (alias: --order)
--login
string
docker login arguments for private repo authentication, surround with ”
--label
string
label to set on the instance
--onstart
string
filename to use as onstart script
--onstart-cmd
string
contents of onstart script as single argument
--entrypoint
string
override entrypoint for args launch instance
--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
--lang-utf8
boolean
Workaround for images with locale problems: install and generate locales before instance launch, and set locale to C.UTF-8
--python-utf8
boolean
Workaround for images with locale problems: set python’s locale to C.UTF-8
--env
string
env variables and port mapping options, surround with ”
--args
string
list of arguments passed to container ENTRYPOINT. Onstart is recommended for this purpose. (must be last argument)
--force
boolean
Skip sanity checks when creating from an existing instance
--cancel-unavail
boolean
Return error if scheduling fails (rather than creating a stopped instance)
--template_hash
string
template hash which contains all relevant information about an instance. This can be used as a replacement for other parameters describing the instance configuration

Description

Launches an instance based on the given parameters. The instance will be created with the top offer from the search results. Besides the gpu_name and num_gpus, you must pass in an ‘—image’ argument as a minimum. If you use args/entrypoint launch mode, we create a container from your image as is, without attempting to inject ssh and or jupyter. If you use the args launch mode, you can override the entrypoint with —entrypoint, and pass arguments to the entrypoint with —args. If you use —args, that must be the last argument, as any following tokens are consumed into the args string. For ssh/jupyter launch types, use —onstart-cmd to pass in startup script, instead of —entrypoint and —args.

Examples

# launch a single RTX 3090 instance with the pytorch image and 16 GB of disk space located anywhere
    python vast.py launch instance -g RTX_3090 -n 1 -i pytorch/pytorch

    # launch a 4x RTX 3090 instance with the pytorch image and 32 GB of disk space located in North America
    python vast.py launch instance -g RTX_3090 -n 4 -i pytorch/pytorch -d 32.0 -r North_America

Available fields:

    Name                    Type      Description

    num_gpus:               int       # of GPUs
    gpu_name:               string    GPU model name
    region:                 string    Region of the instance
    image:                  string    Docker image name
    disk_space:             float     Disk space in GB
    ssh, jupyter, direct:   bool      Flags to specify the instance type and connection method.
    env:                    str       Environment variables and port mappings, encapsulated in single quotes.
    args:                   list      Arguments passed to the container's ENTRYPOINT, used only if '--args' is specified.

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)