Add OpenHands provider for LLM through OH Cloud (#9526)

Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
Xingyao Wang
2025-07-14 13:44:49 -04:00
committed by GitHub
parent 127220dc39
commit 6e25d4bbb6
18 changed files with 738 additions and 246 deletions

View File

@@ -173,6 +173,15 @@ class LLM(RetryMixin, DebugMixin):
# litellm will handle it a bit differently than the openai-compatible params
kwargs['top_k'] = self.config.top_k
# Handle OpenHands provider - rewrite to litellm_proxy
if self.config.model.startswith('openhands/'):
model_name = self.config.model.removeprefix('openhands/')
self.config.model = f'litellm_proxy/{model_name}'
self.config.base_url = 'https://llm-proxy.app.all-hands.dev/'
logger.debug(
f'Rewrote openhands/{model_name} to {self.config.model} with base URL {self.config.base_url}'
)
if (
self.config.model.lower() in REASONING_EFFORT_SUPPORTED_MODELS
or self.config.model.split('/')[-1] in REASONING_EFFORT_SUPPORTED_MODELS