Skip to main content

Overview

GroqTTSService provides fast text-to-speech synthesis using Groq’s TTS API with multiple voice options. The service operates at a fixed 48kHz sample rate and offers efficient audio streaming for real-time applications with ultra-low latency.

Installation

To use Groq services, install the required dependencies:
pip install "pipecat-ai[groq]"

Prerequisites

Groq Account Setup

Before using Groq TTS services, you need:
  1. Groq Account: Sign up at Groq Console
  2. API Key: Generate an API key from your account dashboard
  3. Voice Selection: Choose from available voice models

Required Environment Variables

  • GROQ_API_KEY: Your Groq API key for authentication

Configuration

GroqTTSService

api_key
str
required
Groq API key for authentication.
model_name
str
default:"canopylabs/orpheus-v1-english"
deprecated
TTS model to use. Deprecated in v0.0.105. Use settings=GroqTTSService.Settings(model=...) instead.
voice_id
str
default:"autumn"
deprecated
Voice identifier to use. Deprecated in v0.0.105. Use settings=GroqTTSService.Settings(voice=...) instead.
output_format
str
default:"wav"
Audio output format.
sample_rate
int
default:"48000"
Audio sample rate. Must be 48000 Hz for Groq TTS.
params
InputParams
default:"None"
deprecated
Deprecated in v0.0.105. Use settings=GroqTTSService.Settings(...) instead.
settings
GroqTTSService.Settings
default:"None"
Runtime-configurable settings. See Settings below.

Settings

Runtime-configurable settings passed via the settings constructor argument using GroqTTSService.Settings(...). These can be updated mid-conversation with TTSUpdateSettingsFrame. See Service Settings for details.
ParameterTypeDefaultDescription
modelstrNoneModel identifier. (Inherited.)
voicestrNoneVoice identifier. (Inherited.)
languageLanguage | strNoneLanguage for synthesis. (Inherited.)
speedfloatNOT_GIVENSpeech rate control.

Usage

Basic Setup

from pipecat.services.groq import GroqTTSService

tts = GroqTTSService(
    api_key=os.getenv("GROQ_API_KEY"),
    settings=GroqTTSService.Settings(
        voice="autumn",
    ),
)

With Custom Settings

from pipecat.transcriptions.language import Language

tts = GroqTTSService(
    api_key=os.getenv("GROQ_API_KEY"),
    settings=GroqTTSService.Settings(
        model="canopylabs/orpheus-v1-english",
        voice="autumn",
        language=Language.EN,
        speed=1.2,
    ),
)
The InputParams / params= pattern is deprecated as of v0.0.105. Use Settings / settings= instead. See the Service Settings guide for migration details.

Notes

  • Fixed sample rate: Groq TTS only supports 48kHz sample rate. Setting a different value will produce a warning.
  • WAV output: The service outputs WAV-formatted audio, which is decoded internally to extract raw PCM frames.