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 '{
  "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": "<string>",
  "template": {
    "id": 123,
    "hash_id": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
image
string
required

Docker image path

Example:

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

tag
string

Docker image tag

env
string

Docker environment variables and run arguments

Example:

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

onstart
string

Command to run on instance startup

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

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

template
object

Template details