| Name | Type | Description |
|---|---|---|
model_spec | str | None | Default: NoneModel specification in |
extra_kwargs | dict[str, Any] | None | Default: NoneAdditional kwargs to pass to the model constructor. These take highest priority, overriding values from the config file, except that provider-owned retry loops are disabled when known. The provider's own retry-count kwarg ( |
profile_overrides | dict[str, Any] | None | Default: None |
cli_max_retries | int | None | Default: None |
bind_preserved_thinking | bool | Default: True |
Create a chat model.
Uses init_chat_model for standard providers, or imports a custom
BaseChatModel subclass when the provider has a class_path in config.
Supports provider:model format (e.g., 'openai:gpt-5.5')
for explicit provider selection, or bare model names for auto-detection.
Extra profile fields from --profile-override.
Merged on top of config file profile overrides (dcode wins).
Explicit --max-retries value. When absent, the
provider-specific or global config value applies.
Whether to apply the Anthropic
preserved-thinking defaults (see
_apply_anthropic_thinking_binding).
Pass False for a single-shot model that never replays thinking
blocks across a prompt prefix change. Such a model gains nothing
from the binding, and the injected thinking would push
with_structured_output onto its unforced tool-call path.