Azure AI Foundry

Configure AzureAIFoundry, Agno's model class for Azure AI Foundry-hosted models.

This is the reference for the legacy AzureAIFoundry adapter using azure-ai-inference. Microsoft retired that SDK on August 26, 2026. For new integrations, use the current Foundry OpenAI/v1 guide. The table below preserves the adapter's actual defaults.

Parameters

ParameterTypeDefaultDescription
idstr"gpt-4o"The id of the model to use
namestr"AzureAIFoundry"The name of the model
providerstr"Azure"The provider of the model
temperatureOptional[float]NoneControls randomness in the model's output (0.0 to 2.0)
max_tokensOptional[int]NoneMaximum number of tokens to generate in the response
frequency_penaltyOptional[float]NonePenalizes new tokens based on their frequency in the text so far (-2.0 to 2.0)
presence_penaltyOptional[float]NonePenalizes new tokens based on whether they appear in the text so far (-2.0 to 2.0)
top_pOptional[float]NoneControls diversity via nucleus sampling (0.0 to 1.0)
stopOptional[Union[str, List[str]]]NoneUp to 4 sequences where the API will stop generating further tokens
seedOptional[int]NoneRandom seed for deterministic sampling
model_extrasOptional[Dict[str, Any]]NoneAdditional model-specific parameters
strict_outputboolTrueIncluded in the Pydantic response-format construction, which currently fails due to the tuple limitation below.
request_paramsOptional[Dict[str, Any]]NoneAdditional parameters to include in the request
api_keyOptional[str]NoneThe API key for Azure AI Foundry (defaults to AZURE_API_KEY env var)
api_versionOptional[str]NoneThe API version to use (defaults to AZURE_API_VERSION env var, then "2024-05-01-preview")
azure_endpointOptional[str]NoneThe Azure endpoint URL (defaults to AZURE_ENDPOINT env var)
timeoutOptional[float]NoneDeclared but currently not forwarded when constructing the SDK clients. Configure client_params with SDK-specific options or inject a configured client.
max_retriesOptional[int]NoneDeclared but currently not forwarded when constructing the SDK clients. Configure client_params with SDK-specific options or inject a configured client.
http_clientOptional[httpx.Client]NoneDeclared but currently not forwarded when constructing the SDK clients. Configure client_params with SDK-specific options or inject a configured client.
client_paramsOptional[Dict[str, Any]]NoneAdditional parameters for client configuration
clientOptional[ChatCompletionsClient]NonePre-configured Azure AI client
async_clientOptional[AsyncChatCompletionsClient]NonePre-configured async Azure AI client
model_typeModelTypeModelType.MODELFunctional role of this model (e.g. MODEL, OUTPUT_MODEL, PARSER_MODEL). Set by the agent
supports_native_structured_outputsboolFalseWhether 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

The current Pydantic structured-output path creates a one-item tuple instead of a JsonSchemaFormat. The Azure inference SDK rejects it before sending the request. Use the current OpenAI/v1 integration for structured output; setting strict_output does not fix this adapter path.