Skip to main content
Docker Compose and Docker Swarm deployment are currently in beta. Connect with the Cartesia team for support.
Deploy Cartesia TTS on a single machine with Docker Compose, or across a multi-node cluster with Docker Swarm.

Prerequisites

  • One or more machines with Docker installed (your user must be in the docker group)
  • 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-kube repo 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:
If nvidia is not the default runtime, install the NVIDIA Container Toolkit and run:
If using MIG: After enabling MIG and creating instances on the host, verify they are visible:
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 key
  • service-account.json — GCS service account JSON with roles/artifactregistry.reader (image pull) and roles/storage.objectViewer (GCS sync)
Make the deploy script executable:

Step 2 — Initialize the cluster (Swarm only)

Skip this step if you are using Docker Compose. On the manager node:
Copy the docker swarm join command from the output. On each additional node, run:
Label each node from the manager. Use docker node ls to list node IDs:
If using MIG: Label MIG-enabled nodes with 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.
Mixed clusters with both standard GPU nodes and MIG nodes are supported — the deploy script handles scheduling for both automatically.

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.
See Configuration for full details on each variable.

Step 4 — Deploy

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.
TTS workers take a few minutes to load the model into GPU memory. During this time, TTS requests will return errors even though containers appear healthy. Wait for the ready signal:

Step 5 — Verify

Check that services are running:
If deployed with MIG, verify each worker sees exactly one MIG device:
Test the API:
Test TTS:

Troubleshooting

If the API exits with 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 receive IMAGE_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.

Required

Optional