Skip to main content
The source-fidelity code uses deprecated pixtral-12b-2409. Replace it with ministral-14b-2512 and add sample.jpeg before running the example.
image_file_input_agent.py

Run the Example

1

Set up your virtual environment

2

Install dependencies

3

Export your Mistral API key

4

Add the sample image

Place a JPEG named sample.jpeg in the same directory as the code file.
5

Update the model

When saving the code, replace pixtral-12b-2409 with ministral-14b-2512.
6

Run the example

Save the code above as image_file_input_agent.py, then run:
Full source: cookbook/90_models/mistral/image_file_input_agent.py