Install & Compatibility
Where this runs
tested against v1.1.7 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 6.081s · 268.7MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 18.8s · import 4.625s · 342MB
309MB installed
● package 309MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
groq
✓ from livekit.plugins import groq
The Groq plugin exposes LLM, STT, and TTS functionalities through the 'groq' module.
LLM
✓ from livekit.plugins.groq import LLM
✗ from livekit.plugins import groq.LLM
Access LLM directly from the groq plugin submodule. It can also be accessed via `groq.LLM` after importing `from livekit.plugins import groq`.
This quickstart demonstrates how to initialize a LiveKit Agent session using Groq as the Large Language Model (LLM) provider. It highlights the essential import and configuration steps, including setting the `GROQ_API_KEY` environment variable. Groq can also be configured for STT and TTS.
import os
from livekit.agents import AgentSession, JobContext, WorkerOptions
from livekit.plugins import groq
# Set your Groq API key (e.g., in a .env file or directly as an environment variable)
os.environ['GROQ_API_KEY'] = os.environ.get('GROQ_API_KEY', 'your_groq_api_key_here')
async def entrypoint(ctx: JobContext):
session = AgentSession(
llm=groq.LLM(
model="llama3-8b-8192", # or 'llama-3.3-70b-versatile'
temperature=0.7
),
# Optionally add Groq STT and TTS
# stt=groq.STT(model="whisper-large-v3-turbo"),
# tts=groq.TTS(model="playai-tts", voice="Arista-PlayAI"),
# ... other agent session configurations like vad, turn_handling
)
# In a real application, you'd handle participant events and process audio/text
# For a minimal quickstart, this demonstrates LLM initialization.
# For example:
# while True:
# user_message = await session.stt.recognize_one_utterance()
# if user_message:
# reply_text = await session.llm.generate_reply(messages=[{'role': 'user', 'content': user_message.text}])
# await session.tts.synthesize(reply_text)
print("Groq LLM initialized within AgentSession. Ensure GROQ_API_KEY is set.")
# Example of how you might run this (typically part of a larger LiveKit Agent server setup)
if __name__ == "__main__":
# This part is illustrative; actual LiveKit Agent deployment uses AgentServer.start()
# You would normally run your agent via `python -m your_agent_file dev`
print("To run a full LiveKit Agent, please refer to the LiveKit Agents documentation.")
print("Ensure GROQ_API_KEY is set in your environment or .env file.")
Errors
Common errors & fixes
ImportError: cannot import name 'groq' from 'livekit.plugins'
The `livekit-plugins-groq` package is either not installed, or the Python virtual environment where it's installed is not active.
fixEnsure you have installed the package using `pip install livekit-plugins-groq` and that your virtual environment is activated before running your script.
Groq API key not provided. Set GROQ_API_KEY environment variable or pass `api_key` in constructor.
The Groq API key, essential for authentication, was not found in the environment variables and was not passed directly to the plugin's constructor.
fixSet the `GROQ_API_KEY` environment variable (e.g., in a `.env` file loaded by `python-dotenv`) or provide the key when initializing `groq.LLM(api_key="YOUR_KEY")`, `groq.STT(api_key="YOUR_KEY")`, or `groq.TTS(api_key="YOUR_KEY")`.
ValueError: response_format must be one of [flac mp3 mulaw ogg wav]
When using Groq TTS, an unsupported audio output format was requested, or the default format is no longer valid/supported by the Groq API.
fixSpecify a valid `response_format` parameter in your `groq.TTS` configuration, choosing from `flac`, `mp3`, `mulaw`, `ogg`, or `wav`.
Upgrade
Version history
1.6.0latest on PyPI · released Jun 11, 2026
Audit
Dependencies
livekit-agentsrequiredCore framework for building LiveKit AI agents, which this plugin extends.