Groq (Whisper)
Overview
The GroqSTTService provides ultra-fast transcription using Groq's high-speed LPU™ Inference Engine running Whisper models. It is ideal for applications where extremely low latency is critical.
Installation
To use Groq STT, install the required dependencies:
pip install "piopiy-ai[groq]"
Prerequisites
- A Groq account and API key (Get yours here).
- Set your API key in your environment:
export GROQ_API_KEY="your_api_key_here"
Configuration
GroqSTTService Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
api_key | str | None | Groq API key (defaults to env var). |
model | str | "whisper-large-v3-turbo" | Whisper model ID. |
language | Language | EN | Language of the audio input. |
prompt | str | None | Optional text to guide the model style. |
temperature | float | 0.0 | Sampling temperature for transcription. |
Usage
Basic Setup
import os
from piopiy.services.groq.stt import GroqSTTService
from piopiy.transcriptions.language import Language
stt = GroqSTTService(
api_key=os.getenv("GROQ_API_KEY"),
model="whisper-large-v3-turbo",
language=Language.EN
)
Notes
- Performance: Groq's specialized hardware allows for near-instantaneous transcription using large Whisper models.
- Segmented Processing: This service processes audio in segments, typically yielding results at the end of a user's utterance.