pydantic_ai.models.groq
For details on how to set up authentication with this model, see model configuration for Groq.
Bases: ModelSettings
Settings used for a Groq model request.
The format of the reasoning output.
See the Groq docs for more details.
Type: Literal[‘hidden’, ‘raw’, ‘parsed’]
Bases: Model
A model that uses the Groq API.
Internally, this uses the Groq Python client to interact with the API.
Apart from __init__, all methods are private or match those of the base class.
The model name.
Type: GroqModelName
The model provider.
Type: str
def __init__(
model_name: GroqModelName,
provider: Literal['groq', 'gateway'] | Provider[AsyncGroq] = 'groq',
profile: ModelProfileSpec | None = None,
settings: ModelSettings | None = None,
)
Initialize a Groq model.
The name of the Groq model to use. List of model names available here.
provider : Literal[‘groq’, ‘gateway’] | Provider[AsyncGroq] Default: 'groq'
The provider to use for authentication and API access. Can be either the string
‘groq’ or an instance of Provider[AsyncGroq]. If not provided, a new provider will be
created using the other parameters.
profile : ModelProfileSpec | None Default: None
The model profile to use. Defaults to a profile picked by the provider based on the model name.
settings : ModelSettings | None Default: None
Model-specific settings that will be used as defaults for this model.
@classmethod
def supported_builtin_tools(cls) -> frozenset[type[AbstractBuiltinTool]]
Return the set of builtin tool types this model can handle.
frozenset[type[AbstractBuiltinTool]]
Bases: StreamedResponse
Implementation of StreamedResponse for Groq models.
Get the model name of the response.
Type: GroqModelName
Get the provider name.
Type: str
Get the provider base URL.
Type: str
Get the timestamp of the response.
Type: datetime
Production Groq models from https://console.groq.com/docs/models#production-models.
Default: Literal['llama-3.1-8b-instant', 'llama-3.3-70b-versatile', 'meta-llama/llama-guard-4-12b', 'openai/gpt-oss-120b', 'openai/gpt-oss-20b', 'whisper-large-v3', 'whisper-large-v3-turbo']
Preview Groq models from https://console.groq.com/docs/models#preview-models.
Default: Literal['meta-llama/llama-4-maverick-17b-128e-instruct', 'meta-llama/llama-4-scout-17b-16e-instruct', 'meta-llama/llama-prompt-guard-2-22m', 'meta-llama/llama-prompt-guard-2-86m', 'moonshotai/kimi-k2-instruct-0905', 'openai/gpt-oss-safeguard-20b', 'playai-tts', 'playai-tts-arabic', 'qwen/qwen-3-32b']
Possible Groq model names.
Since Groq supports a variety of models and the list changes frequencly, we explicitly list the named models as of 2025-03-31 but allow any name in the type hints.
See https://console.groq.com/docs/models for an up to date date list of models and more details.
Default: str | ProductionGroqModelNames | PreviewGroqModelNames