Model

Parameters on the base Model class shared by every Agno model provider, including caching and retry behavior.

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

ParameterTypeDefaultDescription
idstrRequiredThe id/name of the model to use
nameOptional[str]NoneThe display name of the model
providerOptional[str]NoneThe provider of the model
model_typeModelTypeModelType.MODELFunctional role of this model, a ModelType value such as MODEL, OUTPUT_MODEL, or PARSER_MODEL. Set by the agent during initialization
supports_native_structured_outputsboolFalseTrue if the model supports structured outputs natively (e.g. OpenAI). Set by the provider class
supports_json_schema_outputsboolFalseTrue if the model requires a JSON schema for structured outputs. Set by the provider class
system_promptOptional[str]NoneSystem prompt from the model added to the Agent
instructionsOptional[List[str]]NoneInstructions from the model added to the Agent
tool_message_rolestr"tool"Role used for tool messages
assistant_message_rolestr"assistant"Role used for assistant messages
cache_responseboolFalseEnable caching of model responses to avoid redundant API calls
cache_ttlOptional[int]NoneTime-to-live for cached model responses, in seconds. If None, cache never expires
cache_dirOptional[str]NoneDirectory path for storing cached model responses. If None, uses default cache location
retriesint0Number of retries to attempt before raising a ModelProviderError
delay_between_retriesint1Delay between retries, in seconds
exponential_backoffboolFalseIf True, the delay between retries is doubled each time
retry_with_guidanceboolTrueRetry the model invocation with a guidance message for known errors avoidable with extra instructions
retry_with_guidance_limitint1Number of times to retry the model invocation with guidance