Hack LiveKit Voice Agent to Support Groq LLM & STT Models
AI Summary
Video Summary: Converting Live Kit Agent from OpenAI to Grock API
Setup:
- Start with a Live Kit voice agent template from the previous video.
- Open the voice agent’s folder in VS Code.
Configuration Changes:
- Add a system variable for the Grock API key in the
.env.local
file.- Import the OS library in the
agent.py
file.- Use the search function to find and modify the LLM engine code.
Understanding Dependencies:
- Use “Go to Definition” in VS Code to view Python dependency files.
- If using a virtual environment, navigate to the dependency file in the
venv
folder.Modifying Live Kit Dependencies:
- Update the Live Kit Python dependency files to support Grock for speech-to-text.
- Modify the OpenAI STT class to send audio to the Grock API.
- Change the model to Grock’s
distilwhisper large v3
.- Set the base URL to Grock’s OpenAI formatted API URL.
- Adjust the
stt
class and parameters to match Grock’s API requirements.Finalizing Agent Configuration:
- Pass the Grock API key as an input parameter to the STT and LLM engines.
Running the Agent:
- Open a new terminal in VS Code.
- If using a virtual environment, activate it.
- Run the command to start the agent in development mode.
Future Improvements:
- The video hints at future content for enhancing the voice agent, including function calling, setting up the Live Kit front end and API locally, and more.
Note:
- The source code for the updates is available for Pro members on the creator’s Discord server.
- The video encourages likes and subscriptions for future updates and offers early access to tutorials for Pro members.