llm
Groq LLM Service implementation using OpenAI-compatible interface.
- class pipecat.services.groq.llm.GroqLLMSettings(model: str | None | _NotGiven = <factory>, extra: dict[str, Any]=<factory>, system_instruction: str | None | _NotGiven = <factory>, temperature: float | None | _NotGiven | NotGiven = <factory>, max_tokens: int | None | _NotGiven | NotGiven = <factory>, top_p: float | None | _NotGiven | NotGiven = <factory>, top_k: int | None | _NotGiven = <factory>, frequency_penalty: float | None | _NotGiven | NotGiven = <factory>, presence_penalty: float | None | _NotGiven | NotGiven = <factory>, seed: int | None | _NotGiven | NotGiven = <factory>, filter_incomplete_user_turns: bool | None | _NotGiven = <factory>, user_turn_completion_config: UserTurnCompletionConfig | None | _NotGiven = <factory>, max_completion_tokens: int | _NotGiven | NotGiven = <factory>)[source]
Bases:
OpenAILLMSettingsSettings for GroqLLMService.
- class pipecat.services.groq.llm.GroqLLMService(*, api_key: str, base_url: str = 'https://api.groq.com/openai/v1', model: str | None = None, settings: GroqLLMSettings | None = None, **kwargs)[source]
Bases:
OpenAILLMServiceA service for interacting with Groq’s API using the OpenAI-compatible interface.
This service extends OpenAILLMService to connect to Groq’s API endpoint while maintaining full compatibility with OpenAI’s interface and functionality.
- Settings
alias of
GroqLLMSettings
- __init__(*, api_key: str, base_url: str = 'https://api.groq.com/openai/v1', model: str | None = None, settings: GroqLLMSettings | None = None, **kwargs)[source]
Initialize Groq LLM service.
- Parameters:
api_key – The API key for accessing Groq’s API.
base_url – The base URL for Groq API. Defaults to “https://api.groq.com/openai/v1”.
model –
The model identifier to use. Defaults to “llama-3.3-70b-versatile”.
Deprecated since version 0.0.105: Use
settings=GroqLLMService.Settings(model=...)instead.settings – Runtime-updatable settings. When provided alongside deprecated parameters,
settingsvalues take precedence.**kwargs – Additional keyword arguments passed to OpenAILLMService.
- create_client(api_key=None, base_url=None, **kwargs)[source]
Create OpenAI-compatible client for Groq API endpoint.
- Parameters:
api_key – API key for authentication. If None, uses instance api_key.
base_url – Base URL for the API. If None, uses instance base_url.
**kwargs – Additional arguments passed to the client constructor.
- Returns:
An OpenAI-compatible client configured for Groq’s API.