> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Image Agent

> Pass raw image bytes to an IBM WatsonX vision model.

## Code

```python image_agent_bytes.py theme={null}
from pathlib import Path

from agno.agent import Agent
from agno.media import Image
from agno.models.ibm import WatsonX

agent = Agent(
    model=WatsonX(id="meta-llama/llama-3-2-11b-vision-instruct"),
    markdown=True,
)

image_path = Path(__file__).parent.joinpath("sample.jpg")

# Read the image file content as bytes
image_bytes = image_path.read_bytes()

agent.print_response(
    "Tell me about this image and give me the latest news about it.",
    images=[
        Image(content=image_bytes),
    ],
    stream=True,
)
```

## Usage

<Snippet file="create-venv-step.mdx" />

**1. Set your API key**

```bash theme={null}
export IBM_WATSONX_API_KEY=xxx
export IBM_WATSONX_PROJECT_ID=xxx
```

**2. Install dependencies**

```bash theme={null}
uv pip install -U ibm-watsonx-ai agno
```

**3. Add sample image**

Place a sample image named "sample.jpg" in the same directory as the script.

**4. Run Agent**

Save the code above as `image_agent_bytes.py`, then run:

```bash theme={null}
python image_agent_bytes.py
```

The example loads an image from a file and passes it to an IBM WatsonX vision model along with a prompt.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.