Skip to main content
POST
/
api
/
v0
/
template
/
create template
curl --request POST \
  --url https://console.vast.ai/api/v0/template/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "My Template",
  "image": "ghcr.io/huggingface/text-generation-inference:1.0.3",
  "tag": "<string>",
  "env": "-p 3000:3000 -e MODEL_ARGS='\''--model-id TheBloke/Llama-2-7B-chat-GPTQ'\''",
  "onstart": "<string>",
  "jup_direct": true,
  "ssh_direct": true,
  "use_jupyter_lab": true,
  "runtype": "jupyter",
  "use_ssh": true,
  "jupyter_dir": "<string>",
  "docker_login_repo": "<string>",
  "extra_filters": {},
  "recommended_disk_space": 123
}'
{
  "success": true,
  "msg": "Template Created Successfully! New Template ID: 123456",
  "template": {
    "name": "<string>",
    "id": 123,
    "hash_id": "<string>"
  }
}

Authorizations

Authorization
string
header
required

API key must be provided in the Authorization header

Body

application/json
name
string
required

Name of the template

Maximum length: 256
Example:

"My Template"

image
string
required

Docker image path

Maximum length: 1024
Example:

"ghcr.io/huggingface/text-generation-inference:1.0.3"

tag
string

Docker image tag

env
string

Docker environment variables and run arguments

Maximum length: 1024
Example:

"-p 3000:3000 -e MODEL_ARGS='--model-id TheBloke/Llama-2-7B-chat-GPTQ'"

onstart
string

Command to run on instance startup

Maximum length: 2048
jup_direct
boolean

Enable direct Jupyter connection

ssh_direct
boolean

Enable direct SSH connection

use_jupyter_lab
boolean

Use JupyterLab instead of Jupyter Notebook

runtype
enum<string>

Type of instance runtime

Available options:
jupyter,
ssh,
args
use_ssh
boolean

Enable SSH access

jupyter_dir
string

Jupyter notebook directory

Maximum length: 256
docker_login_repo
string

Docker repository requiring authentication

extra_filters
object

Additional machine search filters

Recommended disk space in GB

Response

Template created or existing template found

success
boolean

Whether operation was successful

msg
string

Status message

Example:

"Template Created Successfully! New Template ID: 123456"

template
object

Template details