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

# Managing Cluster Templates

> Learn how to explore, create, and configure Tensor One cluster templates via the web interface or GraphQL API.

***

You can **explore and manage Templates** directly from the **Tensor One Web Interface** or by using the **GraphQL API**.

***

## Exploring Templates

### Official & Community Templates

* Navigate to the **Explore** section in the Web UI
* Browse Templates maintained by **Tensor One** and contributions from the **community**

### Private & Team Templates

* Visit the **Templates** section under your dashboard
* View and manage Templates created by **you or your team**

***

## Creating a Template

Templates define how an image is launched as a Cluster, including:

* Container disk size
* Volume size and mount path
* Ports to expose
* Environment variables

### Example: Create Template via GraphQL (using `curl`)

```bash
curl --request POST \
--header 'content-type: application/json' \
--url 'https://api.tensorone.ai/graphql?api_key=${YOUR_API_KEY}' \
--data '{
  "query": "mutation {
    saveTemplate(input: {
      containerDiskInGb: 5,
      dockerArgs: \"sleep infinity\",
      env: [
        { key: \"key1\", value: \"value1\" },
        { key: \"key2\", value: \"value2\" }
      ],
      imageName: \"ubuntu:latest\",
      name: \"Generated Template\",
      ports: \"8888/http,22/tcp\",
      readme: \"## Hello, World!\",
      volumeInGb: 15,
      volumeMountPath: \"/workspace\"
    }) {
      containerDiskInGb
      dockerArgs
      env { key value }
      id
      imageName
      name
      ports
      readme
      volumeInGb
      volumeMountPath
    }
  }"
}'
```

This mutation creates a new Template with preconfigured disk size, image, ports, and environment variables.

***

## Environment Variables in Templates

Environment variables are **key-value pairs** that are injected into your Cluster at runtime. They are useful for:

* Storing **API keys**
* Defining **file paths**
* Providing **service credentials**

### Example Use Cases

* `OPENAI_API_KEY=sk-xxx`
* `MODEL_PATH=/workspace/models/my-model`
* `DB_PASSWORD=secure1234`

### Predefined Variables (by Tensor One)

These are automatically injected into every Cluster:

| Variable | Description |
| - | - |
| `TENSORONE_CLUSTER_ID` | Unique identifier of your Cluster |
| `TENSORONE_API_KEY` | API key for making authenticated calls |
| `TENSORONE_CLUSTER_HOSTNAME` | Hostname of the Cluster instance |

Leverage environment variables to manage sensitive data and runtime configuration **without hardcoding** values into your application.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.