Groq regularly launches preview checkpoints and fine-tuned variants before they appear in the SDK’s bundled catalog. Rather than waiting for a package release,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 lets you register any model ID at runtime so that the rest of the SDK — capability checks, structured-output adaptation, tool calling — works exactly the same as for a built-in model. This page explains both registration approaches, runtime assumption helpers, and the fallback behaviour for completely unknown models.
Registration approaches
There are two ways to register a custom model. The terse facade signature is recommended for quick registration when you only need to declare capabilities. TheModelDefinition object is the right choice when you want to attach full metadata or plan to inspect the definition elsewhere in your application.
registerModel, the model ID is available throughout the SDK just like any built-in model.
Using a registered model
Register the model
Call
Groq::registerModel() once, typically in your application bootstrap or a service provider:bootstrap.php
Verify capabilities (optional)
Inspect the declared capabilities before sending a request:
Capability checks
Capability handling for registered models
When you register a model with an explicit capabilities list, the SDK enforces those declarations strictly. Calling a capability that is not in the list throws aCapabilityNotSupportedException before any HTTP request is made:
Undeclared capability throws an exception
Runtime assumption helpers
If you do not want to register a model globally but still need to use it with specific capabilities, you can annotate the model handle directly.->assume()
assume() tells the SDK to treat listed capabilities as supported on this handle only, without touching the global registry. The capability source is recorded as user-assumed.
Assuming capabilities on a handle
->allowUnknownCapabilities()
allowUnknownCapabilities() lifts all capability restrictions on the handle. Every capability — including ImageInput — is treated as supported, with source user-allowed-unknown-capabilities.
Allowing all capabilities on a handle
Unknown model fallback
If you callGroq::model() with an ID that is neither in the catalog nor in the registry, the SDK does not throw immediately. Instead, Capability::TextGeneration is silently allowed with source unknown-model-fallback, so you can still attempt a basic text request. All other capabilities are reported as not supported:
Unknown model fallback behaviour
The fallback only allows
TextGeneration. Any other capability — streaming, tool calling, structured output, image input — must be declared explicitly via registerModel() or assume(), or unlocked via allowUnknownCapabilities().Resetting the registry
Groq::reset() tears down the default provider instance, which also clears all models registered at runtime. If your application or test suite calls Groq::reset(), you must call registerModel() again afterwards:
Re-registering after reset