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.Documentation Index
Fetch the complete documentation index at: https://docs.sayna.ai/llms.txt
Use this file to discover all available pages before exploring further.
1. Prerequisites
- LiveKit cluster reachable from the Sayna pod/container (LAN or VPC). Set
LIVEKIT_URLto the internal address andLIVEKIT_PUBLIC_URLto what clients should use. - Provider credentials for the STT/TTS services you plan to use:
DEEPGRAM_API_KEYfor Deepgram STT/TTSELEVENLABS_API_KEYfor ElevenLabs TTS- These server-level credentials serve as defaults. Clients can optionally override them per session or per request using the
authfield 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_PATHwhen you want cached audio and turn-detector assets to survive container restarts.
2. Build the container image
Use the provided multi-stageDockerfile (Rust toolchain + runtime slim image):
--build-arg RUST_VERSION=1.75.0pins the toolchain when you need reproducibility.sayna initruns during the image build to pre-download turn-detection assets whenCACHE_PATHis set. Re-runsayna initat runtime if you mount a fresh cache volume.- Sayna listens on port
3001by default; override via-e PORT=XXXX.
3. Runtime environment
| Variable | Purpose | Example |
|---|---|---|
HOST | Bind address inside the container. | 0.0.0.0 |
PORT | Axum listener port. | 3001 |
CACHE_PATH | Directory that stores cached audio and turn-detect assets. | /data/cache |
DEEPGRAM_API_KEY | Enables Deepgram STT/TTS. | dg-secret |
ELEVENLABS_API_KEY | Enables ElevenLabs TTS. | el-secret |
LIVEKIT_URL | Server-to-server WebSocket URL (internal). | ws://livekit:7880 |
LIVEKIT_PUBLIC_URL | URL clients should dial. | https://rtc.yourdomain.com |
LIVEKIT_API_KEY / LIVEKIT_API_SECRET | Credentials used to mint /livekit/token responses and join rooms. | lk_key / lk_secret |
RECORDING_S3_* | Bucket configuration for LiveKit recordings. | bucket, region, endpoint, access key, secret key |
AUTH_* | Optional shared-secret or JWT auth; see Authentication. | – |
4. Local Docker run
sayna-cache ensures cached voices and turn detection assets persist between runs.
5. Docker Compose example
LIVEKIT_URL=ws://livekit:7880 internal while LIVEKIT_PUBLIC_URL remains externally accessible.
6. Kubernetes deployment
ConfigMap snippet:
DEEPGRAM_API_KEY, ELEVENLABS_API_KEY, LIVEKIT_API_KEY, LIVEKIT_API_SECRET, and S3 credentials inside sayna-secrets.
7. LiveKit configuration checklist
- Networking – ensure the Sayna pod can reach the LiveKit signaling endpoint specified in
LIVEKIT_URL(Compose service name, Kubernetes service DNS, etc.). - Credentials – set
LIVEKIT_API_KEY/LIVEKIT_API_SECRET. Sayna uses these to mint:- Agent tokens during the WebSocket
configworkflow (livekitblock). - User tokens returned by the
/livekit/tokenREST endpoint.
- Agent tokens during the WebSocket
- Client workflow – a typical
configmessage 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.