Internal Module Dependencies
External Service Integrations
- LiveKit
- OpenAI
- Twilio
- Vonage
- AWS S3
- RabbitMQ (Dialer)
| Aspect | Detail |
|---|---|
| Purpose | Media server, SIP gateway, room management, Egress (recording) |
| SDK | livekit-api (backend), livekit-agents (worker), @livekit/components-react (widget) |
| Config | LIVEKIT_API_KEY, LIVEKIT_API_SECRET, LIVEKIT_URL, LIVEKIT_SIP_URI |
| Integration Points | SIP trunk creation, dispatch rules, outbound SIP participant, room egress, webhook events |
| Failure Handling | LiveKit SIP errors caught and logged; LiveKitSIPError exception class |
| Critical Files | app/services/livekit/livekit_api.py, app/services/livekit/livekit_singleton.py |
Additional AI Providers
| Provider | SDK | Config Key | Used For |
|---|---|---|---|
| Groq | livekit-plugins-groq | GROQ_API_KEY | LLM |
| Deepgram | livekit-plugins-deepgram | DEEPGRAM_API_KEY | STT, TTS |
| ElevenLabs | livekit-plugins-elevenlabs | ELEVENLABS_API_KEY | TTS |
| Cartesia | livekit-plugins-cartesia | CARTESIA_API_KEY | STT, TTS |
| Sarvam | livekit-plugins-sarvam | SARVAM_API_KEY | STT, TTS |
| Rime | livekit-plugins-rime | RIME_API_KEY | TTS |
| Murf | livekit-plugins-murf | MURF_API_KEY | TTS |
| Inworld | livekit-plugins-inworld | INWORLD_API_KEY | TTS |
Secrets Management
All secrets are managed via environment variables, loaded bypydantic-settings.BaseSettings with optional .env file support.
Secret Types
- SecretStr fields:
OPENAI_API_KEY,S3_ACCESS_KEY,JWT_API_SECRET,TWILIO_AUTH_TOKEN,LIVEKIT_API_SECRET, etc. - Access pattern:
settings.SECRET_FIELD.get_secret_value()(prevents accidental logging) - Docker: Production uses
env_filedirective — values never committed to Git
Failure Handling Summary
| Integration | Failure Strategy |
|---|---|
| LiveKit SIP | Errors caught with LiveKitSIPError; logged but may leave orphaned resources |
| Twilio/Vonage | SDK/HTTP exceptions caught; returned as error dicts |
| OpenAI | Plugin-level handling; streaming errors terminate turn |
| S3 Upload | LiveKit Egress handles directly; download errors return recording: null |
| Redis | Connection errors may break capacity tracking |
| PostgreSQL | SQLAlchemy session rollback on exception |
| Celery | Auto-retry with max_retries=3 for batch dispatch |