Remove hardcoded vision-model allowlist in OllamaModel#28
Merged
rcjackson merged 1 commit intoJul 10, 2026
Merged
Conversation
The OllamaModel.chat() method gated image sending on supports_vision(), which matched model_name against a hardcoded allowlist (llava, bakllava, etc.). Vision-capable models not on the list (e.g. llama3.2-vision) had their images silently dropped and were routed to the text-only chat endpoint, producing labels with no image input. Send images whenever they are provided and remove the unused supports_vision() method and its allowlist. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
OllamaModel.chat()gated image sending onsupports_vision(), which matchedmodel_nameagainst a hardcoded allowlist (llava,bakllava,moondream,minicpm-v,llava-llama2,llava-llama3,llama4:scout).Any vision-capable model not on that list — e.g.
llama3.2-vision— had its images silently dropped and was routed to the text-only/api/chatendpoint, producing labels generated with no image input and no error.Changes
/api/generateendpoint whenever they are provided, regardless of model name.supports_vision()method and its allowlist.Notes
Ollama already errors clearly if a model genuinely cannot accept images, so the client-side allowlist added no safety — only false negatives for newer vision models.
🤖 Generated with Claude Code