Skip to main content

Overview

GroqLLMService provides access to Groq’s language models through an OpenAI-compatible interface. It inherits from OpenAILLMService and supports streaming responses, function calling, and context management with ultra-fast inference speeds.

Groq LLM API Reference

Pipecat’s API methods for Groq integration

Example Implementation

Complete example with function calling

Groq Documentation

Official Groq API documentation and features

Groq Console

Access models and manage API keys

Installation

To use Groq services, install the required dependency:

Prerequisites

Groq Account Setup

Before using Groq LLM services, you need:
  1. Groq Account: Sign up at Groq Console
  2. API Key: Generate an API key from your console dashboard
  3. Model Selection: Choose from available models with ultra-fast inference

Required Environment Variables

  • GROQ_API_KEY: Your Groq API key for authentication

Configuration

str
required
Groq API key for authentication. Raises ValueError when empty.
str
default:"https://api.groq.com/openai/v1"
Base URL for Groq API endpoint.
str
default:"None"
deprecated
Deprecated since 0.0.105, removed in 2.0.0. Use settings=GroqLLMService.Settings(model=...) instead.
GroqLLMService.Settings
default:"None"
Runtime-configurable settings. See Settings below.
The constructor also accepts default_headers, service_tier, retry_on_timeout, and retry_timeout_secs, as described for OpenAILLMService.

Settings

Runtime-configurable settings passed via the settings constructor argument using GroqLLMService.Settings(...). These can be updated mid-conversation with LLMUpdateSettingsFrame. See Service Settings for details. This service extends OpenAILLMService settings with Groq-specific parameters. See OpenAI LLM Settings for inherited parameters. The default model is "openai/gpt-oss-120b".
Literal["none", "default", "low", "medium", "high"] | None
default:"None"
Controls how much the model thinks before answering. Which values a model accepts varies: "low", "medium" and "high" on the GPT-OSS models and qwen/qwen3.8-27b, "none" and "default" on the Qwen models, and the non-reasoning models reject the parameter altogether. "none" also keeps a Qwen model’s reasoning out of the spoken response, which Groq otherwise streams inline in <think> tags. When unset, Groq’s per-model default applies.

Usage

Basic Setup

With Custom Settings

Notes

  • Groq provides ultra-fast inference using custom LPU (Language Processing Unit) hardware.
  • Groq fully supports the OpenAI-compatible parameter set inherited from OpenAILLMService.