π OpenHands: AI-Driven Development
Make drop_params default in llm_config (#4012)
Graham Neubig73ded7de1091
diff --git a/openhands/core/config/llm_config.py b/openhands/core/config/llm_config.pyindex 3a0c942c42..af766045ea 100644--- a/openhands/core/config/llm_config.py+++ b/openhands/core/config/llm_config.py@@ -64,7 +64,7 @@ class LLMConfig:input_cost_per_token: float | None = Noneoutput_cost_per_token: float | None = Noneollama_base_url: str | None = None- drop_params: bool | None = None+ drop_params: bool = Truedisable_vision: bool | None = Nonecaching_prompt: bool = Falselog_completions: bool = Falsediff --git a/openhands/llm/llm.py b/openhands/llm/llm.pyindex 89b9d33e7d..9e4c00399f 100644--- a/openhands/llm/llm.py+++ b/openhands/llm/llm.py@@ -132,9 +132,6 @@ class LLM:):self.config.max_output_tokens = self.model_info['max_tokens']- if self.config.drop_params:- litellm.drop_params = self.config.drop_params-# This only seems to work with Google as the provider, not with OpenRouter!gemini_safety_settings = ([@@ -170,6 +167,7 @@ class LLM:timeout=self.config.timeout,temperature=self.config.temperature,top_p=self.config.top_p,+ drop_params=self.config.drop_params,**({'safety_settings': gemini_safety_settings}if gemini_safety_settings is not None@@ -298,7 +296,7 @@ class LLM:timeout=self.config.timeout,temperature=self.config.temperature,top_p=self.config.top_p,- drop_params=True,+ drop_params=self.config.drop_params,**({'safety_settings': gemini_safety_settings}if gemini_safety_settings is not None