> For the complete documentation index, see [llms.txt](https://support.spiderpool.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.spiderpool.com/ai/templates.md). Agents can also search and read this documentation through its [MCP server](https://support.spiderpool.com/~gitbook/mcp).

# Templates

What a template is, the fields on the Templates page, cached images versus first pull, why a template can be unavailable on a machine, and which data survives a stop.

A template decides the environment that runs in your instance. **Rent → Templates** ([go there](https://www.spiderpool.com/ai/templates)) lists every template the platform offers; you pick one in the first step of the **Create instance** drawer.

## What a template is

The note at the top of the page reads: "Template = image + launch mode + default disk + environment variables. The image cannot be changed; keep pip / conda environments under /workspace or they are lost when the instance is rebuilt on another GPU after a stop."

* **Image**: the container's operating system and preinstalled software, built and maintained by the platform. You cannot swap in your own image, but you can install software inside the instance (mind the persistence rules below).
* **Launch mode**: every template offers SSH (root login with your key). All platform images include JupyterLab; the template decides whether it is on by default. Some templates also start a service automatically (for example ComfyUI or the vLLM inference server).
* **Default disk**: the starting value for the disk size, which you can change in the drawer.
* **Environment variables**: variables preset by the template, plus those the platform sets for every instance (see below).

## Fields on the Templates page

| Field                            | Meaning                                                                                                                           |
| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| Name                             | The template's name, also shown in the **Config** column of the instance list.                                                    |
| Description                      | What the template contains, for example "PyTorch 2.14 + CUDA 13.0 + JupyterLab".                                                  |
| Image                            | The image digest (only its start is shown) or the image reference; **Copy** gives you the full value.                             |
| Access                           | **SSH** means you can log in over SSH; "Jupyter On / Off" is the default of the Jupyter switch at creation, which you can change. |
| Default disk                     | The default disk size in GB. The actual default never exceeds what the chosen machine can give you.                               |
| Preset env vars (N)              | Click to see every variable the template presets, one `NAME=value` per line. Hidden when a template presets none.                 |
| **Find GPUs with this template** | Opens **Find GPUs** showing only machines that can run this template, and preselects it in the drawer.                            |

## Templates on the platform

These are the platform's current templates. Which templates are offered, their versions and defaults are as shown on the Templates page.

| Template  | Contents                                                          | Jupyter by default | Models                       | Service started automatically        |
| --------- | ----------------------------------------------------------------- | ------------------ | ---------------------------- | ------------------------------------ |
| cuda-base | CUDA 12.8 + Ubuntu 22.04 base image with SSH access               | Off                | Optional                     | None                                 |
| pytorch   | PyTorch 2.14 + CUDA 13.0 + JupyterLab                             | On                 | Optional                     | None                                 |
| comfyui   | ComfyUI 0.46                                                      | Off                | Optional, image models only  | ComfyUI on container port 8188       |
| vllm      | vLLM OpenAI-compatible server serving the selected platform model | Off                | Required: one language model | Inference API on container port 8000 |

ComfyUI and the inference API are reachable only through an SSH tunnel; see [Connect to an instance](https://support.spiderpool.com/ai/connect.md). Model rules are in [Models](https://support.spiderpool.com/ai/models.md).

## Cached versus pulled on first use

Whether an image is already on a machine only shows once you look at a specific machine:

* "Cached: …" on a search card lists the templates whose image this machine already has.
* In the create drawer each template is marked **cached** or **pulled on first use**.

You can pick a template marked **pulled on first use**. The first instance on that machine downloads the image first: the instance shows "Creating · pulling image" with a percentage and takes longer than with a cached image. That time is not billed.

## When a template is unavailable on a machine

Some templates need something from the machine. When it is missing, the template is marked **Unavailable** in the create drawer, cannot be selected, and shows why:

| Reason                                                  | Meaning                                                                                                                | What to do                                                                                                                  |
| ------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| "Requires NVIDIA driver ≥ X (this machine has Y)"       | The image needs a newer driver than this machine has.                                                                  | Pick another template, or a machine with a newer driver. **Find GPUs with this template** shows only machines that qualify. |
| "This machine cannot receive platform image bundles: …" | The machine cannot fetch the platform's images right now; the text after the colon is the reason the machine reported. | Choose another machine.                                                                                                     |
| "Not available on this machine (…)"                     | Another reason, with its code in brackets.                                                                             | Choose another machine or template.                                                                                         |

If no template can run on a machine, the drawer says "No template can be used on this machine. Please choose another machine."

When you start a stopped instance whose template can no longer run on its machine, the start fails with the reason and "The instance cannot start on its machine for now. Try again later, or delete it and create it on another machine."

A template withdrawn by the platform can no longer be used for new instances, but existing instances created from it can still be stopped and started.

## Only /workspace persists

Every start rebuilds the container from the template's current image; only `/workspace` is kept. That means:

* Packages installed with `pip install` into the system Python, software installed with `apt`, and files under `/root` and `/tmp` are lost after a stop.
* After the platform updates a template's image, a stopped instance gets the new image the next time it starts.

How to keep a Python environment, per template:

* **pytorch, comfyui**: the image creates a persistent Python environment at `/workspace/.venv` and puts it first on `PATH`. A plain `pip install` goes there and survives stop and start; the preinstalled packages (such as torch) remain available in it. To avoid accidents, `pip install` does not replace the preinstalled torch version by default.
* **After the template's image is updated**: if `/workspace/.venv` was built by the old image, the next start moves it to `/workspace/.venv.old-<UTC time>` and creates a new one. Reinstall your packages, and delete the old directory when you no longer need it to free space.
* **cuda-base, vllm**: no persistent environment is created for you. Create one in `/workspace`, for example:

  ```bash
  python3 -m venv /workspace/venv
  source /workspace/venv/bin/activate
  ```
* **conda**: install conda into a directory under `/workspace`.
* **apt packages**: reinstall them after each start. Keep the install commands in a script under `/workspace` and run it once after starting.

The pytorch template also keeps the Hugging Face and PyTorch download caches under `/workspace/.cache`, and the comfyui template keeps ComfyUI's models, custom nodes, inputs, outputs and settings under `/workspace/ComfyUI`. All of these persist and count toward the instance disk.

{% hint style="warning" %}
`/workspace` lasts only as long as the instance: a stopped instance is deleted automatically with its `/workspace` after 7 days, deleting an instance deletes its `/workspace`, and the platform keeps no backups.
{% endhint %}

## Preset environment variables

**Preset env vars (N)** on the Templates page are the template's own variables, for example `SPIDER_SERVE=comfyui` and `SPIDER_SERVE_PORT=8188` on comfyui. On top of those, the platform sets these for every instance:

| Variable                              | Value                                                                      |
| ------------------------------------- | -------------------------------------------------------------------------- |
| `SPIDER_INSTANCE_ID`                  | The instance ID                                                            |
| `SPIDER_GPU_COUNT`                    | Number of GPUs in the instance                                             |
| `SPIDER_SSH_HOST` / `SPIDER_SSH_PORT` | The instance's SSH host name and port                                      |
| `SPIDER_WORKSPACE`                    | `/workspace`                                                               |
| `SPIDER_JUPYTER`                      | `1` with Jupyter on, otherwise `0`                                         |
| `JUPYTER_TOKEN`                       | The Jupyter access token, set only with Jupyter on. Do not share it.       |
| `SPIDER_MODELS_DIR`                   | `/models`                                                                  |
| `SPIDER_MODEL_IDS`                    | Repositories of the selected models, comma-separated; empty without models |
| `SPIDER_MODEL_PATH` / `MODEL_ID`      | Only with models: the mount path and repository of the first model         |

They are also set in SSH sessions; list them with `env | grep SPIDER_`. Model variables are described in [Models](https://support.spiderpool.com/ai/models.md).

## FAQ

**Can I use my own Docker image?** No, images come only from templates. Install what you need inside the instance and keep the environment in `/workspace` as described above.

**Does Jupyter work with cuda-base?** Yes. Every platform image includes JupyterLab; it is just off by default on cuda-base, comfyui and vllm. Turn on **Jupyter** in the create drawer; it cannot be changed after creation.

**Is nvcc in the image?** cuda-base and pytorch are runtime images and do not include the CUDA compiler nvcc.

**Why did my packages disappear after a start?** They were installed outside `/workspace`. On pytorch and comfyui, check that `which python` points to `/workspace/.venv/bin/python`; on other templates, create an environment in `/workspace` as shown above.

## Related

* [Find GPUs and create an instance](https://support.spiderpool.com/ai/search.md)
* [Models](https://support.spiderpool.com/ai/models.md)
* [Connect to an instance](https://support.spiderpool.com/ai/connect.md)
* [Manage instances](https://support.spiderpool.com/ai/instances.md)
