Module livekit.plugins.groq.services

Classes

class LLM (*,
model: str | Literal['llama3-8b-8192', 'llama3-70b-8192', 'llama-guard-3-8b', 'llama-3.1-8b-instant', 'llama-3.3-70b-versatile'] = 'llama-3.3-70b-versatile',
api_key: str | None = None,
user: str | None = None,
temperature: float | None = None,
parallel_tool_calls: bool | None = None,
tool_choice: ToolChoice | Literal['auto', 'required', 'none'] = 'auto',
max_tokens: int | None = None,
base_url: str | None = 'https://api.groq.com/openai/v1',
client: openai.AsyncOpenAI | None = None)
Expand source code
class LLM(OpenAILLM):
    def __init__(
        self,
        *,
        model: str | LLMModels = "llama-3.3-70b-versatile",
        api_key: str | None = None,
        user: str | None = None,
        temperature: float | None = None,
        parallel_tool_calls: bool | None = None,
        tool_choice: Union[ToolChoice, Literal["auto", "required", "none"]] = "auto",
        max_tokens: int | None = None,
        base_url: str | None = "https://api.groq.com/openai/v1",
        client: openai.AsyncClient | None = None,
    ):
        """
        Create a new instance of Groq LLM.

        ``api_key`` must be set to your Groq API key, either using the argument or by setting
        the ``GROQ_API_KEY`` environmental variable.
        """
        super().__init__(
            model=model,
            api_key=_get_api_key(api_key),
            base_url=base_url,
            client=client,
            user=user,
            temperature=temperature,
            parallel_tool_calls=parallel_tool_calls,
            tool_choice=tool_choice,
            max_tokens=max_tokens,
        )

Helper class that provides a standard way to create an ABC using inheritance.

Create a new instance of Groq LLM.

api_key must be set to your Groq API key, either using the argument or by setting the GROQ_API_KEY environmental variable.

Ancestors

Inherited members

class STT (*,
model: Literal['whisper-large-v3', 'whisper-large-v3-turbo', 'distil-whisper-large-v3-en'] | str = 'whisper-large-v3-turbo',
api_key: str | None = None,
base_url: str | None = 'https://api.groq.com/openai/v1',
client: openai.AsyncOpenAI | None = None,
language: str = 'en',
prompt: str | None = None,
detect_language: bool = False)
Expand source code
class STT(OpenAISTT):
    def __init__(
        self,
        *,
        model: STTModels | str = "whisper-large-v3-turbo",
        api_key: str | None = None,
        base_url: str | None = "https://api.groq.com/openai/v1",
        client: openai.AsyncClient | None = None,
        language: str = "en",
        prompt: str | None = None,
        detect_language: bool = False,
    ):
        """
        Create a new instance of Groq STT.

        ``api_key`` must be set to your Groq API key, either using the argument or by setting
        the ``GROQ_API_KEY`` environmental variable.
        """
        super().__init__(
            model=model,
            api_key=_get_api_key(api_key),
            base_url=base_url,
            client=client,
            language=language,
            detect_language=detect_language,
            prompt=prompt,
            use_realtime=False,
        )

Helper class that provides a standard way to create an ABC using inheritance.

Create a new instance of Groq STT.

api_key must be set to your Groq API key, either using the argument or by setting the GROQ_API_KEY environmental variable.

Ancestors

Inherited members