Skip to content

πŸ™Œ OpenHands: AI-Driven Development

chore: temporary fix to get sonnet 3.7 working again (#7140)

Xingyao Wangb146b63380c7
diff --git a/openhands/llm/llm.py b/openhands/llm/llm.py
index b55bbab33a..c392060c25 100644
--- a/openhands/llm/llm.py
+++ b/openhands/llm/llm.py
@@ -418,6 +418,8 @@ class LLM(RetryMixin, DebugMixin):
self.model_info['max_tokens'], int
):
self.config.max_output_tokens = self.model_info['max_tokens']
+ if 'claude-3-7-sonnet' in self.config.model:
+ self.config.max_output_tokens = 64000 # litellm set max to 128k, but that requires a header to be set
# Initialize function calling capability
# Check if model name is in our supported list