Azure Image Agent Bytes
Migrate an Azure AI Foundry image-bytes agent from retired Llama 3.2 Vision to Llama 4 Scout.
The source-fidelity code uses a retired Azure AI Foundry model. Replace it with Llama 4 Scout before running the example.
Microsoft retired Llama-3.2-11B-Vision-Instruct on June 13, 2026. Deploy Llama-4-Scout-17B-16E-Instruct, point AZURE_ENDPOINT at that deployment, and replace the model ID before running. See the Azure model retirement schedule.
This source uses Agno's classic AzureAIFoundry adapter and the azure-ai-inference package, which Microsoft retired on August 26, 2026. Existing endpoint availability is separate from SDK retirement. For a new integration, use the current Foundry API setup with a compatible deployment. The classic setup below applies only to an existing compatible endpoint unless a current adaptation is explicitly provided.
"""
Azure Image Agent Bytes
=======================
Cookbook example for `azure/ai_foundry/image_agent_bytes.py`.
"""
from pathlib import Path
from agno.agent import Agent
from agno.media import Image
from agno.models.azure import AzureAIFoundry
from agno.utils.media import download_image
# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------
agent = Agent(
model=AzureAIFoundry(id="Llama-3.2-11B-Vision-Instruct"),
markdown=True,
)
image_path = Path(__file__).parent.joinpath("sample.jpg")
download_image(
url="https://upload.wikimedia.org/wikipedia/commons/0/0c/GoldenGateBridge-001.jpg",
output_path=str(image_path),
)
# Read the image file content as bytes
image_bytes = image_path.read_bytes()
agent.print_response(
"Tell me about this image.",
images=[
Image(content=image_bytes),
],
stream=True,
)
# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------
if __name__ == "__main__":
passRun the Classic Example
Set up your virtual environment
uv venv --python 3.12
source .venv/bin/activateInstall dependencies
uv pip install -U agno aiohttp azure-ai-inferenceExport environment variables
export AZURE_API_KEY="your_azure_api_key_here"
export AZURE_ENDPOINT="your_azure_endpoint_here"Use Llama 4 Scout
Deploy Llama-4-Scout-17B-16E-Instruct, update AZURE_ENDPOINT, and replace Llama-3.2-11B-Vision-Instruct in the saved file.
Run the example
Save the code above as image_agent_bytes.py, then run:
python image_agent_bytes.pyFull source: cookbook/90_models/azure/ai_foundry/image_agent_bytes.py