Console

Templates

16min

What are Templates?

Templates help you easily set up instances, and can define the docker image, environment settings, and launch mode for your new instance. For comprehensive information for how our templates work on Vast, visit our template docs. This page will not go as deep into the system but serves as a walkthrough of the GUI within the Console.

Recommended

As the name indicates, we recommend you select from our recommended templates when choosing a template. These are Vast-approved and more reliable.

Page Walkthrough

Page
Page


Selecting a Template

If you click on the "Play" button on a given Template, it will set the given template as your current template and will take you to the Console's Search page.

Templatecard
Templatecard


Editing a Template

If you click on the "Edit" button, the Template Editor will open for the given template. There you can edit settings and customize the template.

Template Editor

The template editor is a convenient GUI for controlling all your template's settings.

Docker Repository and Environment

This section of a template allows you to set the docker image, tag of the image, and the Docker options.

Repoandenv
Repoandenv


You can currently set 3 types of docker create/run options in the GUI and CLI:

  • environment variables: "-e JUPYTER_DIR=/ -e TEST=OK"
  • hostname: "-h billybob"
  • ports: "-p 8081:8081 -p 8082:8082/udp -p 70000:70000"

For more information, visit our Docker Execution Environment docs.

Launch Mode

The launch mode allows you to define how you are going to connect to your instance. For our comprehensive documentation on launch mode options you can visit our launch mode docs.

Launchmode
Launchmode

  • Jupyter: For this launch option we setup a jupyter using a proxy and or direct connections where appropriate (mapping to port 8080 internal). For Jupyter direct HTTPS to work, you must ensure you have loaded our TLS certificate. For more information on how to set this up, check out our Jupyter docs.
  • SSH (both direct and proxy): For this launch option we setup an ssh connection using proxy and or direct connections where appropriate (mapping to port 22 internal). If the machine supports open ports our system will try to setup both a direct ssh connection and a backup proxy connection. For more information on SSH/SCP, visit our docs on it.
  • Docker Entrypoint: This allows you to configure a docker run command with a normal ENTRYPOINT process, instead of setting up ssh and remote access. Unless you know you intend to use a docker ENTRYPOINT, you probably want the ssh launch type with an onstart script.

For Windows users, read our Windows guide on how to use Putty tools to SSH into a Vast instance.

On-start Script

For both Jupyter and SSH launch modes, you can paste in a script that will run Bash commands after the machine starts. Add a semicolon ; at the end of each command.

Onstart
Onstart


Extra Filters

Here you can set specific filters that will be applied on the Search page results.

Extrafilters
Extrafilters


Docker Repository Authentication

Dockerrepo
Dockerrepo


Identification and Disk Space

Id
Id


With the slider you can set the Disk Space for your instance. It is important to estimate how much disk you will need and then to move the slider to the desired disk size. The default disk size for an instance is 10GB.

When the instance is created, the disk size is set and cannot be modified. Providers charge for disk allocation even when the instance is stopped.

Accessibility and CLI Command

Cli
Cli

  • Accessibility: This portion of the template editor is for you to include information and also set the template to be public if you'd like. You can earn referral credits with your public templates via the referral program.
  • CLI Command: Within the template editor, at the bottom it displays the equivalent CLI command for the given template with it's current state. Although within our GUI, when selecting your template everything will be taken care of for you, this can give you visibility if you want to know how to create an instance in CLI in the future or if you would like to run the equivalent command in CLI.

VM Templates

Templates using docker image tags from the docker.io/vastai/kvm repository automatically launch VMs on machines that support VMs.

Add vms_enabled=true to the Extra Filters field of the template to filter for machines that support VMs.

VM images must be specified using the fully qualified server/organization/repo name.

Currently available VM images are (a recommended template is provided for each image):

Image (Recommended Template Link)

Available Launch Modes

Description

Provides

Use cases

Notes

docker.io/vastai/kvm:ubuntu_terminal (link)

direct_ssh

A Ubuntu 22.04 server VM.

CUDA, Docker

Serving Docker Compose applications; CUDA performance profiling

Will refuse to start without SSH pubkeys set; SSH pubkeys will not be able to be changed while instance is running. Env variables will be written to /etc/environment and may need to be sourced by onstart. Onstart script will need interpreter specified via shebangs.

The table below lists some of the differences between VM and Docker based instances:

Feature

Docker

VM

Systemd/Docker/Snap

Not supported

Supported

ptrace

Not supported

Supported

Disk Usage/Performance

Smaller initial disk footprint

Larger initial disk footprint

Common Questions

Can I change my template on an existing instance?

You can't change existing instances - templates are recipes for new instances, so any changes to a template only effect new instances.

Can I increase/decrease my disk space on my instance?

No, you can't change existing instances disk space.

Updated 18 Dec 2024
Doc contributor
Did this page help you?