> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vast.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# vastai create template

Create a new template

## Usage

```bash theme={null}
vastai create template
```

## Options

<ParamField path="--name" type="string">
  name of the template
</ParamField>

<ParamField path="--image" type="string">
  docker container image to launch
</ParamField>

<ParamField path="--image_tag" type="string">
  docker image tag (can also be appended to end of image\_path)
</ParamField>

<ParamField path="--href" type="string">
  link you want to provide
</ParamField>

<ParamField path="--repo" type="string">
  link to repository
</ParamField>

<ParamField path="--login" type="string">
  docker login arguments for private repo authentication, surround with ''
</ParamField>

<ParamField path="--env" type="string">
  Contents of the 'Docker options' field
</ParamField>

<ParamField path="--ssh" type="boolean">
  Launch as an ssh instance type
</ParamField>

<ParamField path="--jupyter" type="boolean">
  Launch as a jupyter instance instead of an ssh instance
</ParamField>

<ParamField path="--direct" type="boolean">
  Use (faster) direct connections for jupyter & ssh
</ParamField>

<ParamField path="--jupyter-dir" type="string">
  For runtype 'jupyter', directory in instance to use to launch jupyter. Defaults to image's working directory
</ParamField>

<ParamField path="--jupyter-lab" type="boolean">
  For runtype 'jupyter', Launch instance with jupyter lab
</ParamField>

<ParamField path="--onstart-cmd" type="string">
  contents of onstart script as single argument
</ParamField>

<ParamField path="--search_params" type="string">
  search offers filters
</ParamField>

<ParamField path="-n" type="boolean">
  Disable default search param query args (alias: `--no-default`)
</ParamField>

<ParamField path="--disk_space" type="string">
  disk storage space, in GB
</ParamField>

<ParamField path="--readme" type="string">
  readme string
</ParamField>

<ParamField path="--hide-readme" type="boolean">
  hide the readme from users
</ParamField>

<ParamField path="--desc" type="string">
  description string
</ParamField>

<ParamField path="--public" type="boolean">
  make template available to public
</ParamField>

## Description

Create a template that can be used to create instances with

## Examples

```bash theme={null}
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:

| Option          | Description                                           |
| --------------- | ----------------------------------------------------- |
| `--url URL`     | Server REST API URL                                   |
| `--retry N`     | Retry limit                                           |
| `--raw`         | Output machine-readable JSON                          |
| `--explain`     | Verbose explanation of API calls                      |
| `--api-key KEY` | API key (defaults to `~/.config/vastai/vast_api_key`) |
