itzmekhokan / ai-provider-for-groq
AI Provider for Groq for the PHP AI Client SDK. Works as both a Composer package and WordPress plugin.
Package info
github.com/itzmekhokan/ai-provider-for-groq
pkg:composer/itzmekhokan/ai-provider-for-groq
Requires
- php: >=7.4
Requires (Dev)
- dealerdirect/phpcodesniffer-composer-installer: ^1.0
- phpcompatibility/php-compatibility: dev-develop
- phpstan/phpstan: ~2.1
- slevomat/coding-standard: ^8.20
- squizlabs/php_codesniffer: ^3.7 || ^4.0
- wordpress/php-ai-client: ^0.4 || dev-trunk
Suggests
- wordpress/php-ai-client: Required. The core PHP AI Client SDK that this provider extends.
This package is auto-updated.
Last update: 2026-06-25 03:59:24 UTC
README
AI Provider for Groq for the WordPress AI Client. Works as both a Composer package and a WordPress plugin.
This provider registers Groq with the AI Client, exposing the open models Groq serves on its fast LPU inference platform (Llama, Mixtral, Gemma, Qwen, GPT-OSS, and more) for text generation through Groq's OpenAI-compatible Chat Completions API.
Requirements
- PHP 7.4+
- WordPress 6.9+ (when used as a plugin)
- The
wordpress/php-ai-clientSDK - A Groq API key from the Groq console
How it works
Groq exposes an OpenAI-compatible API, so this provider is intentionally thin:
| Class | Responsibility |
|---|---|
Provider\GroqProvider |
Registers the provider, base URL (https://api.groq.com/openai/v1), API-key auth, and metadata. |
Metadata\GroqModelMetadataDirectory |
Lists models from GET /openai/v1/models and maps capabilities/options. |
Models\GroqTextGenerationModel |
Sends POST /openai/v1/chat/completions via the shared OpenAI-compatible base class. |
Because Groq speaks the Chat Completions format, GroqTextGenerationModel extends
AbstractOpenAiCompatibleTextGenerationModel from the SDK and only overrides request construction.
Supported capabilities
- Text generation (chat) with the open models hosted on Groq
- Multimodal (image) input for vision-capable models (e.g. the Llama 4 family)
- Function calling and JSON / structured output
Groq also serves Whisper (speech-to-text) and PlayAI (text-to-speech) models; these are listed without text generation capability since they are not chat models.
Installation
As a WordPress plugin
Copy this directory into wp-content/plugins/ and activate it alongside the WordPress AI Client.
As a Composer package
composer require itzmekhokan/ai-provider-for-groq
Author
License
GPL-2.0-or-later