# pydantic\_ai.profiles

### ModelProfile

Describes how requests to and responses from specific models or families of models need to be constructed and processed to get the best results, independent of the model and provider classes used.

#### Attributes

##### supports\_tools

Whether the model supports tools.

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `True`

##### supports\_tool\_return\_schema

Whether the model natively supports tool return schemas.

When True, the model's API accepts a structured return schema alongside each tool definition. When False, return schemas are injected as JSON text into tool descriptions as a fallback.

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `False`

##### supports\_json\_schema\_output

Whether the model supports JSON schema output.

This is also referred to as 'native' support for structured output. Relates to the `NativeOutput` output type.

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `False`

##### supports\_json\_object\_output

Whether the model supports a dedicated mode to enforce JSON output, without necessarily sending a schema.

E.g. [OpenAI's JSON mode](https://platform.openai.com/docs/guides/structured-outputs#json-mode) Relates to the `PromptedOutput` output type.

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `False`

##### supports\_image\_output

Whether the model supports image output.

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `False`

##### supports\_inline\_system\_prompts

Whether the provider's API accepts `SystemPromptPart`s inline at any position.

When `False` (default), non-leading `SystemPromptPart`s are wrapped as `UserPromptPart`s with `<system>...</system>` content in `Model.prepare_messages`. Leading ones still hoist to the provider's top-level system parameter.

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `False`

##### default\_structured\_output\_mode

The default structured output mode to use for the model.

**Type:** `StructuredOutputMode` **Default:** `'tool'`

##### prompted\_output\_template

The instructions template to use for prompted structured output. The '{schema}' placeholder will be replaced with the JSON schema for the output.

**Type:** [`str`](https://docs.python.org/3/library/stdtypes.html#str) **Default:** `dedent("\n Always respond with a JSON object that's compatible with this schema:\n\n {schema}\n\n Don't include any text or Markdown fencing before or after.\n ")`

##### native\_output\_requires\_schema\_in\_instructions

Whether to add prompted output template in native structured output mode

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `False`

##### json\_schema\_transformer

The transformer to use to make JSON schemas for tools and structured output compatible with the model.

**Type:** [`type`](https://docs.python.org/3/glossary.html#term-type)\[`JsonSchemaTransformer`\] | [`None`](https://docs.python.org/3/library/constants.html#None) **Default:** `None`

##### supports\_thinking

Whether the model supports thinking/reasoning configuration.

When False, the unified `thinking` setting in `ModelSettings` is silently ignored.

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `False`

##### thinking\_always\_enabled

Whether the model always uses thinking/reasoning (e.g., OpenAI o-series, DeepSeek R1).

When True, `thinking=False` is silently ignored since the model cannot disable thinking. Implies `supports_thinking=True`.

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `False`

##### thinking\_tags

The tags used to indicate thinking parts in the model's output. Defaults to ('<think>', '</think>').

**Type:** [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple)\[[`str`](https://docs.python.org/3/library/stdtypes.html#str), [`str`](https://docs.python.org/3/library/stdtypes.html#str)\] **Default:** `('<think>', '</think>')`

##### ignore\_streamed\_leading\_whitespace

Whether to ignore leading whitespace when streaming a response.

This is a workaround for models that emit \`<think> </think>

`or an empty text part ahead of tool calls (e.g. Ollama + Qwen3), which we don't want to end up treating as a final result when using`run\_stream`with`str`a valid`output\_type\`.

This is currently only used by `OpenAIChatModel`, `HuggingFaceModel`, and `GroqModel`.

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `False`

##### supported\_native\_tools

The set of native tool types that this model/profile supports.

Defaults to ALL native tools. Profile functions should explicitly restrict this based on model capabilities.

**Type:** [`frozenset`](https://docs.python.org/3/library/stdtypes.html#frozenset)\[[`type`](https://docs.python.org/3/glossary.html#term-type)\[`AbstractNativeTool`\]\] **Default:** `field(default_factory=(lambda: SUPPORTED_NATIVE_TOOLS))`

#### Methods

##### from\_profile

`@classmethod`

```python
def from_profile(cls, profile: ModelProfile | None) -> Self
```

Build a ModelProfile subclass instance from a ModelProfile instance.

###### Returns

[`Self`](https://docs.python.org/3/library/typing.html#typing.Self)

##### update

```python
def update(profile: ModelProfile | None) -> Self
```

Update this ModelProfile (subclass) instance with the non-default values from another ModelProfile instance.

###### Returns

[`Self`](https://docs.python.org/3/library/typing.html#typing.Self)

### OpenAIModelProfile

**Bases:** [`ModelProfile`](/docs/ai/api/pydantic-ai/profiles/#pydantic_ai.profiles.ModelProfile)

Profile for models used with `OpenAIChatModel`.

ALL FIELDS MUST BE `openai_` PREFIXED SO YOU CAN MERGE THEM WITH OTHER MODELS.

#### Attributes

##### openai\_chat\_thinking\_field

Non-standard field name used by some providers for model thinking content in Chat Completions API responses.

Plenty of providers use custom field names for thinking content. Ollama and newer versions of vLLM use `reasoning`, while DeepSeek, older vLLM and some others use `reasoning_content`.

Notice that the thinking field configured here is currently limited to `str` type content.

If `openai_chat_send_back_thinking_parts` is set to `'field'`, this field must be set to a non-None value.

**Type:** [`str`](https://docs.python.org/3/library/stdtypes.html#str) | [`None`](https://docs.python.org/3/library/constants.html#None) **Default:** `None`

##### openai\_chat\_send\_back\_thinking\_parts

Whether the model includes thinking content in requests.

This can be:

-   `'auto'` (default): Automatically detects how to send thinking content. If thinking was received in a custom field (tracked via `ThinkingPart.id` and `ThinkingPart.provider_name`), it's sent back in that same field. Otherwise, it's sent using tags. Only the `reasoning` and `reasoning_content` fields are checked by default when receiving responses. If your provider uses a different field name, you must explicitly set `openai_chat_thinking_field` to that field name.
-   `'tags'`: The thinking content is included in the main `content` field, enclosed within thinking tags as specified in `thinking_tags` profile option.
-   `'field'`: The thinking content is included in a separate field specified by `openai_chat_thinking_field`.
-   `False`: No thinking content is sent in the request.

Defaults to `'auto'` to ensure thinking is sent back in the format expected by the model/provider.

**Type:** [`Literal`](https://docs.python.org/3/library/typing.html#typing.Literal)\['auto', 'tags', 'field', [`False`](https://docs.python.org/3/library/constants.html#False)\] **Default:** `'auto'`

##### openai\_supports\_strict\_tool\_definition

This can be set by a provider or user if the OpenAI-"compatible" API doesn't support strict tool definitions.

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `True`

##### openai\_supports\_sampling\_settings

Turn off to don't send sampling settings like `temperature` and `top_p` to models that don't support them, like OpenAI's o-series reasoning models.

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `True`

##### openai\_unsupported\_model\_settings

A list of model settings that are not supported by this model.

**Type:** [`Sequence`](https://docs.python.org/3/library/typing.html#typing.Sequence)\[[`str`](https://docs.python.org/3/library/stdtypes.html#str)\] **Default:** `()`

##### openai\_supports\_tool\_choice\_required

Whether the provider accepts the value `tool_choice='required'` in the request payload.

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `True`

##### openai\_system\_prompt\_role

The role to use for the system prompt message. If not provided, defaults to `'system'`.

**Type:** `OpenAISystemPromptRole` | [`None`](https://docs.python.org/3/library/constants.html#None) **Default:** `None`

##### supports\_inline\_system\_prompts

OpenAI's APIs accept `system`/`developer`/`user`\-role messages at any position.

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `True`

##### openai\_chat\_supports\_multiple\_system\_messages

Whether the Chat Completions API accepts more than one system-role message at the start of the conversation.

OpenAI itself and most compatible providers accept multiple system messages, so this defaults to `True`. Set to `False` for strict OpenAI-compatible backends (e.g. some LiteLLM/vLLM deployments) that require exactly one initial system message; consecutive system messages at the start will be merged into one (joined with two newlines) before being sent.

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `True`

##### openai\_chat\_supports\_web\_search

Whether the model supports web search in Chat Completions API.

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `False`

##### openai\_chat\_audio\_input\_encoding

The encoding to use for audio input in Chat Completions requests.

-   `'base64'`: Raw base64 encoded string. (Default, used by OpenAI)
-   `'uri'`: Data URI (e.g. `data:audio/wav;base64,...`).

**Type:** [`Literal`](https://docs.python.org/3/library/typing.html#typing.Literal)\['base64', 'uri'\] **Default:** `'base64'`

##### openai\_chat\_supports\_file\_urls

Whether the Chat API supports file URLs directly in the `file_data` field.

OpenAI's native Chat API only supports base64-encoded data, but some providers like OpenRouter support passing URLs directly.

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `False`

##### openai\_supports\_encrypted\_reasoning\_content

Whether the model supports including encrypted reasoning content in the response.

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `False`

##### openai\_supports\_reasoning

Whether the model supports reasoning (o-series, GPT-5+).

When True, sampling parameters may need to be dropped depending on reasoning\_effort setting.

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `False`

##### openai\_supports\_reasoning\_effort\_none

Whether the model supports sampling parameters (temperature, top\_p, etc.) when reasoning\_effort='none'.

Models like GPT-5.1 and GPT-5.2 default to reasoning\_effort='none' and support sampling params in that mode. When reasoning is enabled (low/medium/high/xhigh), sampling params are not supported.

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `False`

##### openai\_responses\_requires\_function\_call\_status\_none

Whether the Responses API requires the `status` field on function tool calls to be `None`.

This is required by vLLM Responses API versions before [https://github.com/vllm-project/vllm/pull/26706](https://github.com/vllm-project/vllm/pull/26706). See [https://github.com/pydantic/pydantic-ai/issues/3245](https://github.com/pydantic/pydantic-ai/issues/3245) for more details.

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `False`

##### openai\_supports\_phase

Whether the Responses API supports the `phase` field on assistant messages.

`phase` labels an assistant message as intermediate `commentary` or the `final_answer`. When the model supports it, OpenAI recommends preserving and sending it back unchanged on every assistant message in follow-up requests; dropping it can cause preambles to be interpreted as final answers and degrade behavior in long-running or tool-heavy flows.

Supported by `gpt-5.3-codex`, `gpt-5.4` and later mainline models. The official OpenAI Responses API silently ignores the field on older models, but defaults to `False` so we don't risk sending an unrecognized field to OpenAI-compatible APIs (vLLM, Bifrost, ...) that haven't been verified to accept it.

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `False`

##### openai\_chat\_supports\_document\_input

Whether the Chat Completions API supports document content parts (`type='file'`).

Some OpenAI-compatible providers (e.g. Azure) do not support document input via the Chat Completions API.

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `True`

### OpenAIJsonSchemaTransformer

**Bases:** `JsonSchemaTransformer`

Recursively handle the schema to make it compatible with OpenAI strict mode.

See [https://platform.openai.com/docs/guides/function-calling?api-mode=responses#strict-mode](https://platform.openai.com/docs/guides/function-calling?api-mode=responses#strict-mode) for more details, but this basically just requires:

-   `additionalProperties` must be set to false for each object in the parameters
-   all fields in properties must be marked as required

### openai\_model\_profile

```python
def openai_model_profile(model_name: str) -> ModelProfile
```

Get the model profile for an OpenAI model.

#### Returns

[`ModelProfile`](/docs/ai/api/pydantic-ai/profiles/#pydantic_ai.profiles.ModelProfile)

### OPENAI\_REASONING\_EFFORT\_MAP

Maps unified thinking values to OpenAI reasoning\_effort strings.

**Type:** [`dict`](https://docs.python.org/3/reference/expressions.html#dict)\[`ThinkingLevel`, [`str`](https://docs.python.org/3/library/stdtypes.html#str)\] **Default:** `{True: 'medium', False: 'none', 'minimal': 'minimal', 'low': 'low', 'medium': 'medium', 'high': 'high', 'xhigh': 'xhigh'}`

### SAMPLING\_PARAMS

Sampling parameter names that are incompatible with reasoning.

These parameters are not supported when reasoning is enabled (reasoning\_effort != 'none'). See [https://platform.openai.com/docs/guides/reasoning](https://platform.openai.com/docs/guides/reasoning) for details.

**Default:** `('temperature', 'top_p', 'presence_penalty', 'frequency_penalty', 'logit_bias', 'openai_logprobs', 'openai_top_logprobs')`

### AnthropicModelProfile

**Bases:** [`ModelProfile`](/docs/ai/api/pydantic-ai/profiles/#pydantic_ai.profiles.ModelProfile)

Profile for models used with `AnthropicModel`.

ALL FIELDS MUST BE `anthropic_` PREFIXED SO YOU CAN MERGE THEM WITH OTHER MODELS.

#### Attributes

##### anthropic\_supports\_fast\_speed

Whether the model supports fast inference speed (`anthropic_speed='fast'`).

Currently Claude Opus 4.6, 4.7, and 4.8 support fast mode. See the Anthropic docs for the latest list.

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `False`

##### anthropic\_supports\_adaptive\_thinking

Whether the model supports adaptive thinking (Sonnet 4.6+, Opus 4.6+).

When True, unified `thinking` translates to `{'type': 'adaptive'}`. When False, it translates to `{'type': 'enabled', 'budget_tokens': N}`.

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `False`

##### anthropic\_supports\_effort

Whether the model supports the `effort` parameter in `output_config` (Opus 4.5+, Sonnet 4.6+).

When True and the unified thinking level is a string (e.g. 'high'), it is also mapped to `output_config.effort`.

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `False`

##### anthropic\_supports\_xhigh\_effort

Whether the model supports the `xhigh` effort value in `output_config`.

Claude Opus 4.7 and 4.8 accept `xhigh`; older Anthropic models should use `max` instead.

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `False`

##### anthropic\_disallows\_budget\_thinking

Whether the model rejects budget-based thinking settings.

Claude Opus 4.7 and 4.8 require adaptive thinking and return a 400 for `{'type': 'enabled', 'budget_tokens': ...}`.

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `False`

##### anthropic\_disallows\_sampling\_settings

Whether the model rejects sampling settings like `temperature` and `top_p`.

Claude Opus 4.7 and 4.8 require these settings to be omitted from request payloads.

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `False`

##### anthropic\_default\_code\_execution\_tool\_version

The Anthropic code execution tool version used when `anthropic_code_execution_tool_version='auto'`.

**Type:** `AnthropicCodeExecutionToolVersion` **Default:** `'20250825'`

##### anthropic\_supported\_code\_execution\_tool\_versions

The Anthropic code execution tool versions supported by the model.

**Type:** [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple)\[`AnthropicCodeExecutionToolVersion`, ...\] **Default:** `('20250825',)`

##### anthropic\_supports\_task\_budgets

Whether the model supports `output_config.task_budget`.

Anthropic currently documents task budgets as a Claude Opus 4.7 / 4.8 beta feature.

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `False`

### resolve\_anthropic\_effort

```python
def resolve_anthropic_effort(
    level: ThinkingEffort,
    supports_xhigh: bool,
) -> AnthropicEffort
```

Resolve a unified thinking effort level to the Anthropic `output_config.effort` value.

Shared between the direct Anthropic path and any provider that translates to the Anthropic `output_config` wire shape (e.g. Bedrock Converse for Anthropic models). Keeps `ANTHROPIC_THINKING_EFFORT_MAP` as the single source of truth for the base mapping, while letting the `xhigh` passthrough decision live in one place.

#### Returns

`AnthropicEffort`

### anthropic\_model\_profile

```python
def anthropic_model_profile(model_name: str) -> ModelProfile | None
```

Get the model profile for an Anthropic model.

#### Returns

[`ModelProfile`](/docs/ai/api/pydantic-ai/profiles/#pydantic_ai.profiles.ModelProfile) | [`None`](https://docs.python.org/3/library/constants.html#None)

### AnthropicCodeExecutionToolVersion

Concrete Anthropic code execution tool version to send for `CodeExecutionTool`.

**Type:** [`TypeAlias`](https://docs.python.org/3/library/typing.html#typing.TypeAlias) **Default:** `Literal['20250825', '20260120']`

### ANTHROPIC\_THINKING\_BUDGET\_MAP

Maps unified thinking values to Anthropic budget\_tokens for non-adaptive models.

**Type:** [`dict`](https://docs.python.org/3/reference/expressions.html#dict)\[`ThinkingLevel`, [`int`](https://docs.python.org/3/library/functions.html#int)\] **Default:** `{True: 10000, 'minimal': 1024, 'low': 2048, 'medium': 10000, 'high': 16384, 'xhigh': 32768}`

### AnthropicEffort

Effort values Anthropic accepts at `output_config.effort`.

**Type:** [`TypeAlias`](https://docs.python.org/3/library/typing.html#typing.TypeAlias) **Default:** `Literal['low', 'medium', 'high', 'xhigh', 'max']`

### ANTHROPIC\_THINKING\_EFFORT\_MAP

Maps unified thinking effort levels to Anthropic `output_config.effort`.

`xhigh` maps to `'max'` by default; callers that target a model with `anthropic_supports_xhigh_effort` should pass `supports_xhigh=True` to [`resolve_anthropic_effort`](/docs/ai/api/pydantic-ai/profiles/#pydantic_ai.profiles.anthropic.resolve_anthropic_effort) to preserve `xhigh` instead of downshifting.

**Type:** [`dict`](https://docs.python.org/3/reference/expressions.html#dict)\[`ThinkingEffort`, `AnthropicEffort`\] **Default:** `{'minimal': 'low', 'low': 'low', 'medium': 'medium', 'high': 'high', 'xhigh': 'max'}`

### GoogleModelProfile

**Bases:** [`ModelProfile`](/docs/ai/api/pydantic-ai/profiles/#pydantic_ai.profiles.ModelProfile)

Profile for models used with `GoogleModel`.

ALL FIELDS MUST BE `google_` PREFIXED SO YOU CAN MERGE THEM WITH OTHER MODELS.

#### Attributes

##### google\_supports\_tool\_combination

Whether the model supports combining function declarations with native tools and response\_schema.

Gemini 3+ supports all tool combinations:

-   function\_declarations + native\_tools
-   output\_tools (function declarations) + native\_tools
-   response\_schema (NativeOutput) + function\_declarations See [https://ai.google.dev/gemini-api/docs/tool-combination](https://ai.google.dev/gemini-api/docs/tool-combination)

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `False`

##### google\_supports\_server\_side\_tool\_invocations

Whether the model accepts the `include_server_side_tool_invocations` tool-config field.

When enabled, Gemini emits explicit `tool_call`/`tool_response` parts for server-side native tools (Google Search, URL Context, File Search) that we round-trip through [`NativeToolCallPart`](/docs/ai/api/pydantic-ai/messages/#pydantic_ai.messages.NativeToolCallPart) / [`NativeToolReturnPart`](/docs/ai/api/pydantic-ai/messages/#pydantic_ai.messages.NativeToolReturnPart). Pre-Gemini-3 models reject the field with `'Tool call context circulation is not enabled'`.

Distinct from [`google_supports_tool_combination`](/docs/ai/api/pydantic-ai/profiles/#pydantic_ai.profiles.google.GoogleModelProfile.google_supports_tool_combination) even though both currently flip on for Gemini 3+ -- the former gates the SDK request field, the latter gates which combinations of native / function / output tools are allowed in the same request.

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `False`

##### google\_supports\_native\_output\_with\_builtin\_tools

Deprecated: use `google_supports_tool_combination` instead.

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) | [`None`](https://docs.python.org/3/library/constants.html#None) **Default:** `None`

##### google\_supported\_mime\_types\_in\_tool\_returns

MIME types supported in native FunctionResponseDict.parts. See [https://ai.google.dev/gemini-api/docs/function-calling#multimodal-function-responses](https://ai.google.dev/gemini-api/docs/function-calling#multimodal-function-responses)

**Type:** [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple)\[[`str`](https://docs.python.org/3/library/stdtypes.html#str), ...\] **Default:** `()`

##### google\_supports\_thinking\_level

Whether the model uses `thinking_level` (enum: LOW/MEDIUM/HIGH) instead of `thinking_budget` (int).

Gemini 3+ models use `thinking_level`; Gemini 2.5 uses `thinking_budget`.

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `False`

### GoogleJsonSchemaTransformer

**Bases:** `JsonSchemaTransformer`

Transforms the JSON Schema from Pydantic to be suitable for Gemini.

Gemini supports [a subset of OpenAPI v3.0.3](https://ai.google.dev/gemini-api/docs/function-calling#function_declarations).

### google\_model\_profile

```python
def google_model_profile(model_name: str) -> ModelProfile | None
```

Get the model profile for a Google model.

#### Returns

[`ModelProfile`](/docs/ai/api/pydantic-ai/profiles/#pydantic_ai.profiles.ModelProfile) | [`None`](https://docs.python.org/3/library/constants.html#None)

### meta\_model\_profile

```python
def meta_model_profile(model_name: str) -> ModelProfile | None
```

Get the model profile for a Meta model.

#### Returns

[`ModelProfile`](/docs/ai/api/pydantic-ai/profiles/#pydantic_ai.profiles.ModelProfile) | [`None`](https://docs.python.org/3/library/constants.html#None)

### amazon\_model\_profile

```python
def amazon_model_profile(model_name: str) -> ModelProfile | None
```

Get the model profile for an Amazon model.

#### Returns

[`ModelProfile`](/docs/ai/api/pydantic-ai/profiles/#pydantic_ai.profiles.ModelProfile) | [`None`](https://docs.python.org/3/library/constants.html#None)

### deepseek\_model\_profile

```python
def deepseek_model_profile(model_name: str) -> ModelProfile | None
```

Get the model profile for a DeepSeek model.

#### Returns

[`ModelProfile`](/docs/ai/api/pydantic-ai/profiles/#pydantic_ai.profiles.ModelProfile) | [`None`](https://docs.python.org/3/library/constants.html#None)

### GrokModelProfile

**Bases:** [`ModelProfile`](/docs/ai/api/pydantic-ai/profiles/#pydantic_ai.profiles.ModelProfile)

Profile for Grok models (used with both GrokProvider and XaiProvider).

ALL FIELDS MUST BE `grok_` PREFIXED SO YOU CAN MERGE THEM WITH OTHER MODELS.

#### Attributes

##### grok\_supports\_builtin\_tools

Whether the model supports builtin tools (web\_search, x\_search, code\_execution, mcp).

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `False`

##### grok\_supports\_tool\_choice\_required

Whether the provider accepts the value `tool_choice='required'` in the request payload.

**Type:** [`bool`](https://docs.python.org/3/library/functions.html#bool) **Default:** `True`

##### grok\_reasoning\_efforts

Native `reasoning_effort` values supported by the Grok model.

**Type:** [`frozenset`](https://docs.python.org/3/library/stdtypes.html#frozenset)\[`GrokReasoningEffort`\] **Default:** `frozenset()`

### grok\_model\_profile

```python
def grok_model_profile(model_name: str) -> ModelProfile | None
```

Get the model profile for a Grok model.

#### Returns

[`ModelProfile`](/docs/ai/api/pydantic-ai/profiles/#pydantic_ai.profiles.ModelProfile) | [`None`](https://docs.python.org/3/library/constants.html#None)

### GrokReasoningEffort

Native xAI `reasoning_effort` values.

**Type:** [`TypeAlias`](https://docs.python.org/3/library/typing.html#typing.TypeAlias) **Default:** `Literal['none', 'low', 'medium', 'high']`

### mistral\_model\_profile

```python
def mistral_model_profile(model_name: str) -> ModelProfile | None
```

Get the model profile for a Mistral model.

#### Returns

[`ModelProfile`](/docs/ai/api/pydantic-ai/profiles/#pydantic_ai.profiles.ModelProfile) | [`None`](https://docs.python.org/3/library/constants.html#None)

### qwen\_model\_profile

```python
def qwen_model_profile(model_name: str) -> ModelProfile | None
```

Get the model profile for a Qwen model.

#### Returns

[`ModelProfile`](/docs/ai/api/pydantic-ai/profiles/#pydantic_ai.profiles.ModelProfile) | [`None`](https://docs.python.org/3/library/constants.html#None)