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
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.