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
| Field | Description |
|---|---|
name | Human-readable template name |
imageName | Docker image (e.g., nvcr.io/nvidia/pytorch:2.1.0-py3.10-cuda12.1) |
dockerStartCmd | Command to run on container start |
containerDiskInGb | Size of the container’s local SSD storage |
volumeInGb | Size of the attached network volume |
Using Private Images
To use images from private container registries:
- Add your registry credentials in Container Registry
- Reference the private image in your template’s
imageName
Popular Base Images
| Image | Description |
|---|---|
nvcr.io/nvidia/pytorch:2.1.0-py3.10-cuda12.1 | PyTorch 2.1 with CUDA 12.1 |
stabilityai/stable-diffusion:web-ui | Stable Diffusion WebUI |
nvidia/cuda:12.1.0-devel-ubuntu22.04 | Base CUDA development |
Best Practices
- Pin image versions — Use specific tags, not
latest, for reproducibility - Minimize image size — Smaller images mean faster cold starts
- Pre-install dependencies — Bake your requirements into the image to avoid install-on-start delays
- Use startup scripts — Set
dockerStartCmdto automatically launch services (Jupyter, API servers, etc.)