Skip to main content
Sayna ships as a single Axum binary that runs anywhere you can schedule containers. The sections below walk through the recommended workflow for container builds, Docker Compose, and Kubernetes.

1. Prerequisites

  • LiveKit cluster reachable from the Sayna pod/container (LAN or VPC). Set LIVEKIT_URL to the internal address and LIVEKIT_PUBLIC_URL to what clients should use.
  • Provider credentials for the STT/TTS services you plan to use:
    • DEEPGRAM_API_KEY for Deepgram STT/TTS
    • ELEVENLABS_API_KEY for ElevenLabs TTS
    • These server-level credentials serve as defaults. Clients can optionally override them per session or per request using the auth field in STT/TTS config objects. See the WebSocket guide.
  • Optional: S3-compatible bucket for LiveKit recording egress (RECORDING_S3_*).
  • Optional: Authentication settings from the Authentication guide.
  • Persistent volume (or host path) for CACHE_PATH when you want cached audio and turn-detector assets to survive container restarts.

2. Build the container image

Use the provided multi-stage Dockerfile (Rust toolchain + runtime slim image):
Key flags:
  • --build-arg RUST_VERSION=1.75.0 pins the toolchain when you need reproducibility.
  • sayna init runs during the image build to pre-download turn-detection assets when CACHE_PATH is set. Re-run sayna init at runtime if you mount a fresh cache volume.
  • Sayna listens on port 3001 by default; override via -e PORT=XXXX.

3. Runtime environment

4. Local Docker run

Mounting sayna-cache ensures cached voices and turn detection assets persist between runs.

5. Docker Compose example

Compose networking keeps LIVEKIT_URL=ws://livekit:7880 internal while LIVEKIT_PUBLIC_URL remains externally accessible.

6. Kubernetes deployment

Recommended ConfigMap snippet:
Store DEEPGRAM_API_KEY, ELEVENLABS_API_KEY, LIVEKIT_API_KEY, LIVEKIT_API_SECRET, and S3 credentials inside sayna-secrets.

7. LiveKit configuration checklist

  1. Networking – ensure the Sayna pod can reach the LiveKit signaling endpoint specified in LIVEKIT_URL (Compose service name, Kubernetes service DNS, etc.).
  2. Credentials – set LIVEKIT_API_KEY / LIVEKIT_API_SECRET. Sayna uses these to mint:
    • Agent tokens during the WebSocket config workflow (livekit block).
    • User tokens returned by the /livekit/token REST endpoint.
  3. Client workflow – a typical config message includes:
When enable_recording=true, LiveKit needs a valid egress target. Set a session-level stream_id to control the {server_prefix}/{stream_id}/audio.ogg path, or omit it to let the server generate one. Ensure RECORDING_S3_* or other LiveKit egress settings are populated.