Repository navigation
Add LiteLLM provider into responses_api_models - #990
Merged
Merged
Conversation
imxj
force-pushed
the
feat/support_litellm_responses
branch
2 times, most recently
from
April 1, 2026 00:42
805aaef to
f0558e5
Compare
LiteLLM proxies may return chat.completion format or hybrid response objects when called via /v1/responses. This normalizes those responses to the expected Responses API shape so downstream NeMoGymResponse validation succeeds. Also fixes reasoning.effort="none" validation error for native Responses API responses. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Jin Xu <jinx@nvidia.com>
Revert openai_model/app.py to its clean state and move the LiteLLM response normalization logic into a new responses_api_models/litellm_model that extends SimpleModelServer. This keeps proxy-specific workarounds (reasoning.effort="none" fix, chat.completion->response normalization) isolated from the native OpenAI model server. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Jin Xu <jinx@nvidia.com>
imxj
force-pushed
the
feat/support_litellm_responses
branch
from
April 7, 2026 01:52
105e7c6 to
307b580
Compare
3 tasks
kajalj22
self-requested a review
June 23, 2026 18:10
kajalj22
requested changes
Jun 23, 2026
kajalj22
left a comment
Contributor
There was a problem hiding this comment.
The tests are fully mocked so they never hit a real LiteLLM proxy, but runtime security is untested/potentially impacted with server url (could use any version).
- Worth adding a startup version check (e.g. GET /health on the proxy) to enforce >= v1.83.0, since v1.82.7 and v1.82.8 were supply-chain compromised (https://docs.litellm.ai/blog/security-update-march-2026 ).
The risk is on the proxy server side, if it ran a compromised version, the API keys it uses to call upstream LLMs may have been exfiltrated.
Adds a startup HTTP check against the LiteLLM proxy's /health endpoint to detect and hard-fail on v1.82.7 and v1.82.8, which contained credential-harvesting malware (supply chain incident, March 2026). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Kajal Jain <kajalj@nvidia.com>
This was referenced Jun 23, 2026
/health/readiness/details is the correct endpoint that exposes litellm_version — verified against v1.89.3. /health does not include version info. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Kajal Jain <kajalj@nvidia.com>
- Add TestVersionCheck with three cases: compromised version blocks startup, safe version passes, unreachable proxy only warns - Add mock_safe_version fixture auto-applied to all server integration tests so they don't make real HTTP calls during the startup check Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Kajal Jain <kajalj@nvidia.com>
Contributor
|
Raised a PR addressing my comment here: imxj#1 |
Contributor
Author
|
Thanks. I merged the follow up fixes into this pr branch |
kajalj22
previously approved these changes
Jun 26, 2026
Signed-off-by: Jin Xu <jin.xu999@gmail.com>
…ersion check errors - Add x-litellm-key to _SENSITIVE_HEADER_RE so the newly introduced auth header is redacted alongside Authorization in all error paths - Wrap the exception interpolation in _check_proxy_version with _sanitize_error() so API keys cannot leak into RuntimeError messages if aiohttp surfaces request headers in the exception Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Kajal Jain <kajalj@nvidia.com>
feat(litellm): block compromised proxy versions on startup
Signed-off-by: Jin Xu <jin.xu999@gmail.com>
imxj
force-pushed
the
feat/support_litellm_responses
branch
from
August 1, 2026 16:46
f5c4df1 to
f376b31
Compare
…m_responses Signed-off-by: Jin Xu <jin.xu999@gmail.com>
Contributor
Author
|
Since the dismissed approval: fixed the ruff-format issue in |
…m_responses Signed-off-by: Jin Xu <jin.xu999@gmail.com>
ffrujeri
previously approved these changes
Aug 10, 2026
setup_webserver() on main now installs model-call capture from server_client.global_config_dict; mirror the openai_model test setup. Signed-off-by: Jin Xu <jin.xu999@gmail.com>
ffrujeri
self-requested a review
August 10, 2026 21:27
ffrujeri
approved these changes
Aug 10, 2026
This was referenced Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
responses_api_models/litellm_modelserver for LiteLLM proxy endpointsLiteLLMModelServerextendsopenai_model'sSimpleModelServer, overriding onlyresponses()to normalize LiteLLM proxy quirkschat.completionhybrid responses to standard Responses API format (LiteLLM may downgrade/v1/responsesinternally)reasoning.effort="none"(string) tonullPydantic validation error for native Responses API responsesopenai_modelremains clean -- no proxy-specific workaroundsTest