> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2-service-account.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Model

The Model class is the base class for all models in Agno. It provides common functionality and parameters that are inherited by specific model implementations like OpenAIChat, Claude, etc. Sampling and request parameters (`temperature`, `max_tokens`, `top_p`, `seed`, `request_params`, and similar) are defined on the provider classes, not on the base Model.

## Parameters

| Parameter                            | Type                  | Default           | Description                                                                                                        |
| ------------------------------------ | --------------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------ |
| `id`                                 | `str`                 | Required          | The id/name of the model to use                                                                                    |
| `name`                               | `Optional[str]`       | `None`            | The display name of the model                                                                                      |
| `provider`                           | `Optional[str]`       | `None`            | The provider of the model                                                                                          |
| `model_type`                         | `ModelType`           | `ModelType.MODEL` | Functional role of this model (`MODEL`, `OUTPUT_MODEL`, or `PARSER_MODEL`). Set by the agent during initialization |
| `supports_native_structured_outputs` | `bool`                | `False`           | True if the model supports structured outputs natively (e.g. OpenAI). Set by the provider class                    |
| `supports_json_schema_outputs`       | `bool`                | `False`           | True if the model requires a JSON schema for structured outputs. Set by the provider class                         |
| `system_prompt`                      | `Optional[str]`       | `None`            | System prompt from the model added to the Agent                                                                    |
| `instructions`                       | `Optional[List[str]]` | `None`            | Instructions from the model added to the Agent                                                                     |
| `tool_message_role`                  | `str`                 | `"tool"`          | Role used for tool messages                                                                                        |
| `assistant_message_role`             | `str`                 | `"assistant"`     | Role used for assistant messages                                                                                   |
| `cache_response`                     | `bool`                | `False`           | Enable caching of model responses to avoid redundant API calls                                                     |
| `cache_ttl`                          | `Optional[int]`       | `None`            | Time-to-live for cached model responses, in seconds. If None, cache never expires                                  |
| `cache_dir`                          | `Optional[str]`       | `None`            | Directory path for storing cached model responses. If None, uses default cache location                            |
| `retries`                            | `int`                 | `0`               | Number of retries to attempt before raising a ModelProviderError                                                   |
| `delay_between_retries`              | `int`                 | `1`               | Delay between retries, in seconds                                                                                  |
| `exponential_backoff`                | `bool`                | `False`           | If True, the delay between retries is doubled each time                                                            |
| `retry_with_guidance`                | `bool`                | `True`            | Retry the model invocation with a guidance message for known errors avoidable with extra instructions              |
| `retry_with_guidance_limit`          | `int`                 | `1`               | Number of times to retry the model invocation with guidance                                                        |
