Together Image Agent
Describe an image from a URL with a current Together vision model.
Together retired the source's meta-llama/Llama-Vision-Free serverless model. Select a current vision model from the Together serverless catalog before running. See Together vision inputs.
"""
Together Image Agent
====================
Cookbook example for `together/image_agent.py`.
"""
from agno.agent import Agent
from agno.media import Image
from agno.models.together import Together
# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------
agent = Agent(
model=Together(id="meta-llama/Llama-Vision-Free"),
markdown=True,
)
agent.print_response(
"Tell me about this image",
images=[
Image(
url="https://upload.wikimedia.org/wikipedia/commons/0/0c/GoldenGateBridge-001.jpg"
)
],
stream=True,
)
# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------
if __name__ == "__main__":
passRun the Example
Set up your virtual environment
uv venv --python 3.12
source .venv/bin/activateInstall dependencies
uv pip install -U agno openaiExport environment variables
export TOGETHER_API_KEY="your_together_api_key_here"
export TOGETHER_VISION_MODEL_ID="your_current_together_vision_model_id_here"Use the selected vision model
Add import os, then replace Together(id="meta-llama/Llama-Vision-Free") with Together(id=os.environ["TOGETHER_VISION_MODEL_ID"]) in the saved file.
Run the example
Save the code above as image_agent.py, then run:
python image_agent.pyFull source: cookbook/90_models/together/image_agent.py