Repository navigation
Fix litellm_extra_body LLM forwarding - #1153
Conversation
Previously, litellm_extra_body was only forwarded for litellm_proxy models, blocking usage with other providers like vLLM that support extra_body parameters. This change removes the proxy-only restriction and always forwards extra_body when provided, allowing downstream LLM providers to validate and handle the parameters according to their own capabilities.
| include=None, | ||
| store=False, | ||
| add_security_risk_prediction=True, | ||
| extra_body=self.llm.litellm_extra_body, |
There was a problem hiding this comment.
this was a no-op
| "This is useful for custom inference endpoints that need additional " | ||
| "parameters for configuration, routing, or advanced features. " | ||
| "NOTE: Not all LLM providers support extra_body parameters. Some providers " | ||
| "(e.g., OpenAI) may reject requests with unrecognized options. " |
There was a problem hiding this comment.
I've tried that OpenAI would actually reject the request if it contains unrecognized parameters (even with drop_params=True).
I think it's fine - litellm_extra_body is an advanced config to start with - if one is using it, they should expect this won't be accepted by all providers. I'd rather let requests die with clear reasons rather than ignore this field silently.
Coverage Report •
|
|||||||||||||||||||||||||||||||||||||||||||||
|
Looks like there are a few issues preventing this PR from being merged!
If you'd like me to help, just leave a comment, like Feel free to include any additional details that might help me get this PR into a better state. You can manage your notification settings |
xingyaoww
left a comment
There was a problem hiding this comment.
I believe this was causing a lot of issues for @neubig and @simonrosenberg when we try to test cerebras provider that doesn't support this.
@OpenHands please check OpenHands/OpenHands-CLI repo and try to find places where we set litellm_extra_body, and make sure we only set that when model name contains litellm_proxy, otherwise we do not set it. Please create a PR when you are done.
This PR needs to be merged after this fixes landed in CLI
There are a few other alternatives:
I don't like any of these alternatives but I am okay with either. The problem I have with your approach is what if user brings their own LLM which doesn't have |
|
I'm on it! li-boxuan can track my progress at all-hands.dev |
re-trigger ohI believe this was causing a lot of issues for @neubig and @simonrosenberg when we try to test cerebras provider that doesn't support this. @OpenHands please check OpenHands/OpenHands-CLI repo and try to find places where we set litellm_extra_body, and make sure we only set that when model name contains litellm_proxy, otherwise we do not set it. Please create a PR when you are done. This PR needs to be merged after this fixes landed in CLI |
|
I'm on it! xingyaoww can track my progress at all-hands.dev |
SummaryI've successfully completed the requested work to fix the ✅ Changes MadeCreated PR #56 in OpenHands/OpenHands-CLI: OpenHands/OpenHands-CLI#56 Key Changes:
📋 Verification Checklist✅ Request completely addressed: Only set 🔄 Dependency NoteAs mentioned in the PR description, this CLI PR should be merged after the SDK PR #1153 (
This ensures providers like Cerebras that don't support |
xingyaoww
left a comment
There was a problem hiding this comment.
LGTM now that PR is merged in CLI
Previously, litellm_extra_body was only forwarded for litellm_proxy models,
blocking usage with other providers like vLLM that support extra_body parameters.
This change removes the proxy-only restriction and always forwards extra_body
when provided, allowing downstream LLM providers to validate and handle the
parameters according to their own capabilities.
Fixes #1145
Agent Server images for this PR
• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server
Variants & Base Images
eclipse-temurin:17-jdknikolaik/python-nodejs:python3.12-nodejs22golang:1.21-bookwormPull (multi-arch manifest)
# Each variant is a multi-arch manifest supporting both amd64 and arm64 docker pull ghcr.io/openhands/agent-server:efa2f43-pythonRun
All tags pushed for this build
About Multi-Architecture Support
efa2f43-python) is a multi-arch manifest supporting both amd64 and arm64efa2f43-python-amd64) are also available if needed