feat: Add OPENHANDS_FORCE_VISION env var to override vision capability detection (#10255)

Co-authored-by: mamoodi <mamoodiha@gmail.com>
Co-authored-by: Engel Nyst <engel.nyst@gmail.com>
This commit is contained in:
danieljbruntz 2025-08-25 12:05:58 -07:00 committed by GitHub
parent 408af4e012
commit c9d96038c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -515,6 +515,16 @@ class LLM(RetryMixin, DebugMixin):
Returns:
bool: True if model is vision capable. Return False if model not supported by litellm.
"""
# Allow manual override via environment variable
if os.getenv('OPENHANDS_FORCE_VISION', '').lower() in (
'1',
'true',
'yes',
'on',
):
return True
# litellm.supports_vision currently returns False for 'openai/gpt-...' or 'anthropic/claude-...' (with prefixes)
# but model_info will have the correct value for some reason.
# we can go with it, but we will need to keep an eye if model_info is correct for Vertex or other providers