Back to Eliza

@elizaos/plugin-groq

plugins/plugin-groq/README.md

2.0.12.8 KB
Original Source

@elizaos/plugin-groq

Groq LLM plugin for elizaOS - Fast inference with GPT-OSS models.

This plugin provides Groq API integration for elizaOS agents, enabling ultra-fast text generation, audio transcription, and text-to-speech synthesis.

Features

  • 🚀 Fast Inference - Leverage Groq's LPU for industry-leading inference speeds
  • 📝 Text Generation - Generate text with GPT-OSS models
  • 🎤 Audio Transcription - Transcribe audio with Whisper models
  • 🔊 Text-to-Speech - Generate speech with PlayAI voices
  • 🔢 Object Generation - Generate structured JSON objects
  • 🎯 Tokenization - Tokenize and detokenize text

Installation

TypeScript/JavaScript (npm)

bash
npm install @elizaos/plugin-groq
# or
bun add @elizaos/plugin-groq

Usage

TypeScript

typescript
import { groqPlugin } from "@elizaos/plugin-groq";

// Add to your agent's plugins
const agent = new Agent({
  plugins: [groqPlugin],
});

Configuration

Set the following environment variables:

VariableRequiredDefaultDescription
GROQ_API_KEYYes-Your Groq API key
GROQ_BASE_URLNohttps://api.groq.com/openai/v1Custom API base URL
GROQ_SMALL_MODELNoopenai/gpt-oss-120bModel for small tasks
GROQ_LARGE_MODELNoopenai/gpt-oss-120bModel for large tasks
GROQ_TTS_MODELNocanopylabs/orpheus-v1-englishText-to-speech model
GROQ_TTS_VOICENotroyTTS voice name
GROQ_TTS_RESPONSE_FORMATNowavTTS response format

Model Capabilities

This plugin provides handlers for the following elizaOS model types:

Model TypeDescription
TEXT_SMALLFast text + structured output via native tool calling (tools, toolChoice, responseSchema)
TEXT_LARGECapable text + structured output via native tool calling (tools, toolChoice, responseSchema)
TRANSCRIPTIONAudio transcription with Whisper
TEXT_TO_SPEECHSpeech synthesis with PlayAI
TEXT_TOKENIZER_ENCODETokenize text to tokens
TEXT_TOKENIZER_DECODEDetokenize tokens to text

Development

Building from Source

bash
# TypeScript
bun install
bun run build
# TypeScript
bun run test
# TypeScript
bun run format:check