Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/phpaisdk/groq/llms.txt

Use this file to discover all available pages before exploring further.

aisdk/groq is the official Groq provider for the PHP AI SDK. It connects Groq’s ultra-fast inference API to the SDK’s unified Generate interface, built on top of the shared aisdk/openai-compatible wire adapter. All standard SDK features — text generation, streaming, tool calling, structured output, and image input — work with Groq models out of the box, with the same fluent API you use for every other provider.

Requirements

Both dependencies are pulled in automatically when you install aisdk/groq via Composer.

Capabilities

The table below summarises what the Groq provider supports and how each capability is implemented.
CapabilitySupportNotes
Text generation✅ NativeAll catalogued models
Streaming✅ NativeServer-sent events via /chat/completions
Tool calling✅ NativeParallel tool calls supported
Structured output⚙️ Adapted / ✅ Nativejson_object + injected instruction on llama-3.1-8b-instant; native json_schema on openai/gpt-oss-* and moonshotai/kimi*
Text input✅ NativeAll catalogued models
Image input✅ NativeLlama 4 models (meta-llama/llama-4-scout*, meta-llama/llama-4-maverick*)
Only llama-3.1-8b-instant exposes structured output in adapted form — the provider automatically downgrades json_schema to json_object and injects a JSON instruction. Models with native schema support (openai/gpt-oss-20b, openai/gpt-oss-120b, and moonshotai/kimi* variants) bypass this adaptation entirely. All other catalogued models do not support structured output.

Available Models

The provider ships with a built-in model catalogue at resources/models.json. Highlighted entries include:
Model IDContextStructured Output
llama-3.3-70b-versatile131 072 tokens❌ Not supported
llama-3.1-8b-instant131 072 tokensAdapted (json_object)
meta-llama/llama-4-scout*❌ Not supported
meta-llama/llama-4-maverick*❌ Not supported
openai/gpt-oss-20b131 072 tokensNative (json_schema)
openai/gpt-oss-120b131 072 tokensNative (json_schema)
moonshotai/kimi*Native (json_schema)
You can register models that are not yet in the catalogue using Groq::registerModel() — no package update required. See the configuration guide for details.

Get Started

Quickstart

Install the package and run your first text generation in under five minutes.

Configuration

Set API keys, swap the base URL, add custom headers, and register new models.

Text Generation

Explore prompts, system instructions, tool calling, and structured output.

Models

Browse the full model catalogue with capability and context-window details.

Build docs developers (and LLMs) love