Docker Compose and Docker Swarm deployment are currently in beta. Connect with the Cartesia team for support.
Prerequisites
- One or more machines with Docker installed (your user must be in the
dockergroup) - Compose only: Docker Compose V2 (
docker compose) - Swarm only: nodes meet Docker’s Swarm networking requirements
- At least one NVIDIA GPU with drivers installed. MIG (Multi-Instance GPU) partitioning is supported on compatible NVIDIA GPUs
- GPU nodes have the nvidia Docker runtime set as default (see below)
- The
cartesia-kuberepo downloaded as described in Downloading cartesia-kube - A Cartesia API key file (
container_key) and a GCS service account JSON file, provided during onboarding
GPU runtime check
On each GPU node, verify the NVIDIA runtime:nvidia is not the default runtime, install the NVIDIA Container Toolkit and run:
MIG must be enabled and instances created on the host before deploying. Recreating MIG instances generates new UUIDs; redeploy the stack if this happens.
Step 1 — Prepare secrets
Place these files on the host (Compose) or manager node (Swarm):container_key— file containing your Cartesia API keyservice-account.json— GCS service account JSON withroles/artifactregistry.reader(image pull) androles/storage.objectViewer(GCS sync)
- Compose
- Swarm
Step 2 — Initialize the cluster (Swarm only)
Skip this step if you are using Docker Compose. On the manager node:docker swarm join command from the output. On each additional node, run:
docker node ls to list node IDs:
mig=true and a comma-separated list of their MIG instance UUIDs (obtained from nvidia-smi -L on that node). Do not apply gpu=true to MIG nodes.
Step 3 — Configure environment
Set environment variables before deploying. Use a.env file in local/ (see local/.env.example) or export them in your shell.
Step 4 — Deploy
- Compose
- Swarm
From the repo root:When
--mig is used, the script auto-detects MIG instance UUIDs from nvidia-smi, generates a per-slice worker configuration, and scales the standard worker to zero.Step 5 — Verify
Check that services are running:- Compose
- Swarm
Troubleshooting
- Compose
- Swarm
no servers available for connection (NATS not ready), restart the API after the stack is up:Configuration
Set these environment variables before running the deploy script. You receiveIMAGE_REGISTRY, RELEASE_TAG, and MODEL_NAME from Cartesia during onboarding. If you mirror images into your own registry, use your mirror URL for IMAGE_REGISTRY.