From c9d96038c1f7992452a2ac88b6210227ac287dd8 Mon Sep 17 00:00:00 2001 From: danieljbruntz Date: Mon, 25 Aug 2025 12:05:58 -0700 Subject: [PATCH] feat: Add OPENHANDS_FORCE_VISION env var to override vision capability detection (#10255) Co-authored-by: mamoodi Co-authored-by: Engel Nyst --- openhands/llm/llm.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/openhands/llm/llm.py b/openhands/llm/llm.py index 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