Skip to content

Send images per message in Ollama chat requests - #199

Merged
mattt merged 1 commit into
huggingface:mainfrom
james-333i:fix/167-ollama-vision-images
Sep 2, 2026
Merged

Send images per message in Ollama chat requests#199
mattt merged 1 commit into
huggingface:mainfrom
james-333i:fix/167-ollama-vision-images

Conversation

@james-333i

Copy link
Copy Markdown
Contributor

OllamaLanguageModel attached base64 images at the top level of the /api/chat request body, but the endpoint only reads images from the messages themselves, so image input was silently dropped and vision models responded as if no image was provided.

Move images onto OllamaMessage and drop the unused top-level field. Adds request-encoding tests that run without a live Ollama server.

Fixes #167

Resubmitted after an accidental force push closed #183.

OllamaLanguageModel attached base64 images at the top level of the
/api/chat request body, but the endpoint only reads images from the
messages themselves, so image input was silently dropped and vision
models responded as if no image was provided.

Move images onto OllamaMessage and drop the unused top-level field.
Adds request-encoding tests that run without a live Ollama server.

Fixes huggingface#167
@mattt

mattt commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Merging now. Thanks, @james-333i!

@mattt
mattt merged commit d6b5216 into huggingface:main Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OllamaLanguageModel: vision images sent at request top level, ignored by /api/chat

2 participants