π OpenHands: AI-Driven Development
feat: Add OPENHANDS_FORCE_VISION env var to override vision capability detection (#10255)
danieljbruntzc9d96038c1f7
diff --git a/openhands/llm/llm.py b/openhands/llm/llm.pyindex f81162c82f..0d90889b3c 100644--- a/openhands/llm/llm.py+++ b/openhands/llm/llm.py@@ -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