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
| Parameter | Type | Default | Description |
|---|---|---|---|
id | str | "gpt-4o" | The id of the model to use |
name | str | "AzureAIFoundry" | The name of the model |
provider | str | "Azure" | The provider of the model |
temperature | Optional[float] | None | Controls randomness in the model's output (0.0 to 2.0) |
max_tokens | Optional[int] | None | Maximum number of tokens to generate in the response |
frequency_penalty | Optional[float] | None | Penalizes new tokens based on their frequency in the text so far (-2.0 to 2.0) |
presence_penalty | Optional[float] | None | Penalizes new tokens based on whether they appear in the text so far (-2.0 to 2.0) |
top_p | Optional[float] | None | Controls diversity via nucleus sampling (0.0 to 1.0) |
stop | Optional[Union[str, List[str]]] | None | Up to 4 sequences where the API will stop generating further tokens |
seed | Optional[int] | None | Random seed for deterministic sampling |
model_extras | Optional[Dict[str, Any]] | None | Additional model-specific parameters |
strict_output | bool | True | Included in the Pydantic response-format construction, which currently fails due to the tuple limitation below. |
request_params | Optional[Dict[str, Any]] | None | Additional parameters to include in the request |
api_key | Optional[str] | None | The API key for Azure AI Foundry (defaults to AZURE_API_KEY env var) |
api_version | Optional[str] | None | The API version to use (defaults to AZURE_API_VERSION env var, then "2024-05-01-preview") |
azure_endpoint | Optional[str] | None | The Azure endpoint URL (defaults to AZURE_ENDPOINT env var) |
timeout | Optional[float] | None | Declared but currently not forwarded when constructing the SDK clients. Configure client_params with SDK-specific options or inject a configured client. |
max_retries | Optional[int] | None | Declared but currently not forwarded when constructing the SDK clients. Configure client_params with SDK-specific options or inject a configured client. |
http_client | Optional[httpx.Client] | None | Declared but currently not forwarded when constructing the SDK clients. Configure client_params with SDK-specific options or inject a configured client. |
client_params | Optional[Dict[str, Any]] | None | Additional parameters for client configuration |
client | Optional[ChatCompletionsClient] | None | Pre-configured Azure AI client |
async_client | Optional[AsyncChatCompletionsClient] | None | Pre-configured async Azure AI client |
model_type | ModelType | ModelType.MODEL | Functional role of this model (e.g. MODEL, OUTPUT_MODEL, PARSER_MODEL). Set by the agent |
supports_native_structured_outputs | bool | False | Whether the model supports structured outputs natively |
supports_json_schema_outputs | bool | False | Whether the model uses JSON schema for structured outputs |
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 of tool messages |
assistant_message_role | str | "assistant" | Role of assistant messages |
cache_response | bool | False | Cache model responses to avoid redundant API calls during development |
cache_ttl | Optional[int] | None | Time-to-live for cached responses, in seconds |
cache_dir | Optional[str] | None | Directory for the response cache. Defaults to ~/.agno/cache/model_responses |
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 a failed model invocation once with a guidance message appended |
retry_with_guidance_limit | int | 1 | Number 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.