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
- PHP 8.3 or higher
aisdk/core^0.2aisdk/openai-compatible^0.2
aisdk/groq via Composer.
Capabilities
The table below summarises what the Groq provider supports and how each capability is implemented.| Capability | Support | Notes |
|---|---|---|
| Text generation | ✅ Native | All catalogued models |
| Streaming | ✅ Native | Server-sent events via /chat/completions |
| Tool calling | ✅ Native | Parallel tool calls supported |
| Structured output | ⚙️ Adapted / ✅ Native | json_object + injected instruction on llama-3.1-8b-instant; native json_schema on openai/gpt-oss-* and moonshotai/kimi* |
| Text input | ✅ Native | All catalogued models |
| Image input | ✅ Native | Llama 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 atresources/models.json. Highlighted entries include:
| Model ID | Context | Structured Output |
|---|---|---|
llama-3.3-70b-versatile | 131 072 tokens | ❌ Not supported |
llama-3.1-8b-instant | 131 072 tokens | Adapted (json_object) |
meta-llama/llama-4-scout* | — | ❌ Not supported |
meta-llama/llama-4-maverick* | — | ❌ Not supported |
openai/gpt-oss-20b | 131 072 tokens | Native (json_schema) |
openai/gpt-oss-120b | 131 072 tokens | Native (json_schema) |
moonshotai/kimi* | — | Native (json_schema) |
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.