Mistral

Configure MistralChat, Agno's model class for Mistral's language models.

The Mistral model provides access to Mistral's language models.

Parameters

ParameterTypeDefaultDescription
idstr"mistral-large-latest"The id of the Mistral model to use
namestr"MistralChat"The name of the model
providerstr"Mistral"The provider of the model
temperatureOptional[float]NoneControls randomness in the model's output
max_tokensOptional[int]NoneMaximum number of tokens to generate
top_pOptional[float]NoneControls diversity via nucleus sampling
random_seedOptional[int]NoneRandom seed for deterministic sampling
frequency_penaltyOptional[float]NonePenalizes repeated token frequencies; support depends on the selected model.
presence_penaltyOptional[float]NonePenalizes tokens already present; support depends on the selected model.
stopOptional[Union[str, List[str]]]NoneStop sequence or sequences forwarded to the API.
safe_modeboolFalseLegacy Agno field. Current Mistral APIs use safe_prompt and reject safe_mode
safe_promptboolFalseInject Mistral's deprecated safety prompt. Mistral recommends custom guardrails
request_paramsOptional[Dict[str, Any]]NoneAdditional parameters to include in the request
api_keyOptional[str]NoneThe API key for Mistral (defaults to MISTRAL_API_KEY env var)
endpointOptional[str]NoneDeclared but rejected by the current Mistral client constructor when set; leave None.
max_retriesOptional[int]NoneDeclared but rejected by the current Mistral client constructor when set; leave None.
timeoutOptional[int]NoneDeclared but rejected by the current Mistral client constructor when set; leave None.
client_paramsOptional[Dict[str, Any]]NoneAdditional parameters for client configuration
mistral_clientOptional[Mistral]NonePre-configured Mistral client
model_typeModelTypeModelType.MODELFunctional role of this model (e.g. MODEL, OUTPUT_MODEL, PARSER_MODEL). Set by the agent
supports_native_structured_outputsboolTrueWhether the model supports structured outputs natively
supports_json_schema_outputsboolFalseWhether the model uses JSON schema for structured outputs
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 of tool messages
assistant_message_rolestr"assistant"Role of assistant messages
cache_responseboolFalseCache model responses to avoid redundant API calls during development
cache_ttlOptional[int]NoneTime-to-live for cached responses, in seconds
cache_dirOptional[str]NoneDirectory for the response cache. Defaults to ~/.agno/cache/model_responses
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 a failed model invocation once with a guidance message appended
retry_with_guidance_limitint1Number of times to retry the model invocation with guidance

For the current Mistral Python SDK, configure client_params with server_url, timeout_ms (milliseconds), and an SDK RetryConfig as retry_config, or provide mistral_client. Keep endpoint, timeout, and max_retries unset; their Agno names are not translated to these SDK options.