Images
Send pictures to the models that read them.
Models whose Reads column on Models says images take pictures. Send the image as a URL or a base64 data URL in the message content.
Python:
import base64
img = base64.b64encode(open("photo.png", "rb").read()).decode()
r = client.chat.completions.create(
model="gemma4-26b",
messages=[{"role": "user", "content": [
{"type": "text", "text": "What is in this picture?"},
{"type": "image_url", "image_url": {"url": f"data:image/png;base64,{img}"}},
]}],
)
print(r.choices[0].message.content)