Skip to content

πŸ™Œ OpenHands: AI-Driven Development

fix: llm is_local function logic error (#1961)

Shimada666da8369c4d2d4
diff --git a/opendevin/llm/llm.py b/opendevin/llm/llm.py
index a3209aba68..da938823b7 100644
--- a/opendevin/llm/llm.py
+++ b/opendevin/llm/llm.py
@@ -220,12 +220,9 @@ class LLM:
boolean: True if executing a local model.
"""
if self.base_url is not None:
- if (
- 'localhost' not in self.base_url
- and '127.0.0.1' not in self.base_url
- and '0.0.0.0' not in self.base_url
- ):
- return True
+ for substring in ['localhost', '127.0.0.1' '0.0.0.0']:
+ if substring in self.base_url:
+ return True
elif self.model_name is not None:
if self.model_name.startswith('ollama'):
return True