A production-ready voice agent capable of making outbound calls using LiveKit, Deepgram, and Groq (Llama 3.3).
Designed for reliability, speed, and ease of deployment.
- Ultra-Fast LLM: Uses Groq running
llama-3.3-70b-versatilefor near-instant responses. - High-Quality Audio: Uses Deepgram for both Speech-to-Text (STT) and Text-to-Speech (TTS).
- SIP Trunking: Integrated with Vobiz for PSTN connectivity.
- Robust Configuration: Centralized
config.pyfor easy customization of prompts, models, and voices.
- Python 3.10+ (Recommended: 3.10.13)
- A LiveKit Cloud account
- A Deepgram API Key
- A Groq API Key
- A SIP Provider (e.g., Vobiz)
# Clone the repository
git clone <your-repo-url>
cd basic-conversation-agent
# Create a virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txtCopy the example environment file and fill in your credentials:
cp .env.example .env
nano .env # Or open in your editorRequired Variables:
LIVEKIT_URL,LIVEKIT_API_KEY,LIVEKIT_SECRETDEEPGRAM_API_KEYGROQ_API_KEYVOBIZ_SIP_*variables (for outbound calls)
This runs the agent process which listens for room connections.
python agent.py startIn a new terminal window (ensure venv is active), run:
python make_call.py --to +91XXXXXXXXXXNote: The number must include the country code (e.g., +1 or +91).
Cause: The configured LLM model is no longer supported by Groq.
Fix:
- Open
config.py. - Update
GROQ_MODELto a supported model (e.g.,llama-3.3-70b-versatileorllama-3.1-8b-instant). - Restart
agent.pyto apply changes.
Cause: The SIP_TRUNK_ID in .env is incorrect or doesn't exist in your LiveKit project.
Fix:
- Run
python list_trunks.pyto see available trunks. - If none exist, run
python create_trunk.pyto create one. - Update
.envwith the correct ID.
Cause: Another instance of agent.py is already running.
Fix:
- Find the process:
lsof -i :8081 - Kill it:
kill -9 <PID>orpkill -f "python agent.py"
Cause: Dependencies are missing.
Fix:
- Ensure your virtual environment is active (
source venv/bin/activate). - Run
pip install -r requirements.txt.
Cause: TTS (Text-to-Speech) failure or WebSocket issues.
Fix:
- Check terminal logs for
APIStatusError. - If using OpenAI TTS, ensure you have OpenAI credits.
- Recommended: Switch to Deepgram TTS (set
TTS_PROVIDER=deepgramin.env).
agent.py: Main application logic.config.py: Central configuration for prompts, models, and constants.make_call.py: Script to initiate outbound calls.create_trunk.py/setup_trunk.py: Utilities for SIP trunk management.