Templates

Create reusable container templates for fast GPU instance deployment.

Templates

Templates are pre-configured container images that define the software environment for your GPU instances and serverless endpoints. Use templates to standardize your deployment stack and speed up launches.

Creating a Template

curl -X POST https://api.gpuworker.com/templates \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "pytorch-2.1-jupyter",
    "imageName": "nvcr.io/nvidia/pytorch:2.1.0-py3.10-cuda12.1",
    "dockerStartCmd": "bash -c '\''jupyter lab --ip=0.0.0.0 --allow-root --no-browser'\''",
    "containerDiskInGb": 20,
    "volumeInGb": 50
  }'

Template Fields

FieldDescription
nameHuman-readable template name
imageNameDocker image (e.g., nvcr.io/nvidia/pytorch:2.1.0-py3.10-cuda12.1)
dockerStartCmdCommand to run on container start
containerDiskInGbSize of the container’s local SSD storage
volumeInGbSize of the attached network volume

Using Private Images

To use images from private container registries:

  1. Add your registry credentials in Container Registry
  2. Reference the private image in your template’s imageName
ImageDescription
nvcr.io/nvidia/pytorch:2.1.0-py3.10-cuda12.1PyTorch 2.1 with CUDA 12.1
stabilityai/stable-diffusion:web-uiStable Diffusion WebUI
nvidia/cuda:12.1.0-devel-ubuntu22.04Base CUDA development

Best Practices

  1. Pin image versions — Use specific tags, not latest, for reproducibility
  2. Minimize image size — Smaller images mean faster cold starts
  3. Pre-install dependencies — Bake your requirements into the image to avoid install-on-start delays
  4. Use startup scripts — Set dockerStartCmd to automatically launch services (Jupyter, API servers, etc.)