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)

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:
VariableDescription
TENSORONE_CLUSTER_IDUnique identifier of your Cluster
TENSORONE_API_KEYAPI key for making authenticated calls
TENSORONE_CLUSTER_HOSTNAMEHostname of the Cluster instance
Leverage environment variables to manage sensitive data and runtime configuration without hardcoding values into your application.