Skip to content

fix(openai): relay param and plain message from OpenAI-compatible backend errors - #53217

Merged
kenneth-berri merged 1 commit into
mainfrom
litellm_relay_openai_compatible_error_param
Nov 20, 2026
Merged

kenneth-berri merged 1 commit into
mainfrom
litellm_relay_openai_compatible_error_param

Conversation

@kenneth-berri

@kenneth-berri kenneth-berri commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Handwritten 1-3 sentence description

Errors from OpenAI-compatible backends like vLLM now come back with the backend's param and its plain error message, so clients can tell which request field was rejected.

Details

Link to Devin session: https://app.devin.ai/sessions/e05d96a34f9a4bc0952518c13b908fa9
Open in Devin Desktop: https://app.devin.ai/desktop/session/e05d96a34f9a4bc0952518c13b908fa9?variant=devin
Requested by: @kenneth-berri

TLDR

Problem this solves:

  • Backend error.param was dropped, clients always got null
  • error.message held the whole backend body as a string
  • /v1/completions showed a Python dict repr of it

How it solves it:

  • Reads the backend's error object when it only arrives as JSON text
  • Text completion errors keep the backend's parsed error body
  • Message is the backend's plain text behind the usual LiteLLM prefix

User Flow

Before: a developer calling a vLLM model through the proxy cannot tell which field the backend rejected

  1. They send POST https://litellm-domain/v1/chat/completions with "max_tokens": -5 to a hosted_vllm/ model
  2. They get a 400 whose error.param is null
  3. error.message contains the backend's whole JSON error as an escaped string, or a Python dict repr on /v1/completions

After: the same request names the rejected field

  1. They send the same POST https://litellm-domain/v1/chat/completions with "max_tokens": -5
  2. They get a 400 whose error.param is max_tokens
  3. error.message is litellm.BadRequestError: Hosted_vllmException - max_tokens must be at least 1, got -5. ... followed by the fallback note, the same on /v1/completions and /v1/responses

Relevant issues

Fixes #47949

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • The handful of test files covering my change pass locally, e.g. uv run pytest tests/unit/<your_test_file>.py -v. Leave the suites (make test-unit-*, make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more
  • My PR passes all required CI/CD checks (e.g., lint, schema.d.ts sync check, etc.)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • Every automated review on my PR's latest commit has finished, and I have addressed or replied to each of its findings before requesting a maintainer review

Delays in PR merge?

If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).

Screenshots / Proof of Fix

Both legs ran a live proxy against real providers. glm-5.3 is the reporter's model, zai-org/GLM-5.3, served by Together's OpenAI-compatible API through the hosted_vllm/ route. vllm-route is the same hosted_vllm/ route pointed at OpenAI's API, and openai-route is the plain openai/ route for comparison. The proxy ran with one worker and no Redis, since the error mapping reads no shared state.

Shared setup, run the same way for both legs. It needs OPENAI_API_KEY and TOGETHER_API_KEY

python litellm/proxy/proxy_cli.py --config real.yaml --port 4011
bash real_requests.sh
real.yaml
model_list:
  - model_name: vllm-route
    litellm_params:
      model: hosted_vllm/gpt-6.2-sol
      api_base: https://api.openai.com/v1
      api_key: os.environ/OPENAI_API_KEY
  - model_name: openai-route
    litellm_params:
      model: openai/gpt-6.2-sol
      api_key: os.environ/OPENAI_API_KEY
  - model_name: glm-5.3
    litellm_params:
      model: hosted_vllm/zai-org/GLM-5.3
      api_base: https://api.together.xyz/v1
      api_key: os.environ/TOGETHER_API_KEY
general_settings:
  master_key: sk-1234
  dangerously_permit_weak_or_unset_master_key: true
real_requests.sh
H=(-H "Authorization: Bearer sk-1234" -H "Content-Type: application/json")
for m in vllm-route openai-route; do
echo "== $m /v1/chat/completions"; curl -s localhost:4011/v1/chat/completions "${H[@]}" -d '{"model":"'$m'","messages":[{"role":"user","content":"hi"}],"max_tokens":-5}'; echo
echo "== $m /v1/chat/completions stream"; curl -s localhost:4011/v1/chat/completions "${H[@]}" -d '{"model":"'$m'","messages":[{"role":"user","content":"hi"}],"max_tokens":-5,"stream":true}'; echo
echo "== $m /v1/chat/completions unknown tool_choice"; curl -s localhost:4011/v1/chat/completions "${H[@]}" -d '{"model":"'$m'","messages":[{"role":"user","content":"hi"}],"tools":[{"type":"function","function":{"name":"a","parameters":{"type":"object","properties":{}}}}],"tool_choice":{"type":"function","function":{"name":"missing"}}}'; echo
echo "== $m /v1/responses"; curl -s localhost:4011/v1/responses "${H[@]}" -d '{"model":"'$m'","input":"hi","tools":[],"tool_choice":{"type":"function","name":"missing"}}'; echo
echo "== $m /v1/chat/completions happy path"; curl -s localhost:4011/v1/chat/completions "${H[@]}" -d '{"model":"'$m'","messages":[{"role":"user","content":"Reply with the word ok"}]}' | python3 -c "import json,sys; d=json.load(sys.stdin); print(json.dumps({'content': d['choices'][0]['message']['content'], 'finish_reason': d['choices'][0]['finish_reason']}))"
done
echo "== glm-5.3 /v1/chat/completions"; curl -s localhost:4011/v1/chat/completions "${H[@]}" -d '{"model":"glm-5.3","messages":[{"role":"user","content":"hi"}],"max_tokens":-5}'; echo
echo "== glm-5.3 /v1/chat/completions stream"; curl -s localhost:4011/v1/chat/completions "${H[@]}" -d '{"model":"glm-5.3","messages":[{"role":"user","content":"hi"}],"max_tokens":-5,"stream":true}'; echo
echo "== glm-5.3 /v1/completions"; curl -s localhost:4011/v1/completions "${H[@]}" -d '{"model":"glm-5.3","prompt":"hi","max_tokens":-5}'; echo
echo "== glm-5.3 /v1/completions stream"; curl -s localhost:4011/v1/completions "${H[@]}" -d '{"model":"glm-5.3","prompt":"hi","max_tokens":-5,"stream":true}'; echo
echo "== glm-5.3 /v1/completions happy path"; curl -s localhost:4011/v1/completions "${H[@]}" -d '{"model":"glm-5.3","prompt":"Say ok","max_tokens":5}' | python3 -c "import json,sys; d=json.load(sys.stdin); print(json.dumps({'text': d['choices'][0]['text'], 'finish_reason': d['choices'][0]['finish_reason']}))"

Before (6bcc7ff)

Output, every hosted_vllm error has param null and the backend body as a string inside message
== vllm-route /v1/chat/completions
{"error":{"message":"litellm.BadRequestError: Hosted_vllmException - {\n  \"error\": {\n    \"message\": \"Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead.\",\n    \"type\": \"invalid_request_error\",\n    \"param\": \"max_tokens\",\n    \"code\": \"unsupported_parameter\"\n  }\n}\n\nLiteLLM: model group 'vllm-route' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":null,"code":"400"}}
== vllm-route /v1/chat/completions stream
{"error":{"message":"litellm.BadRequestError: Hosted_vllmException - {\n  \"error\": {\n    \"message\": \"Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead.\",\n    \"type\": \"invalid_request_error\",\n    \"param\": \"max_tokens\",\n    \"code\": \"unsupported_parameter\"\n  }\n}\n\nLiteLLM: model group 'vllm-route' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":null,"code":"400"}}
== vllm-route /v1/chat/completions unknown tool_choice
{"error":{"message":"litellm.BadRequestError: Hosted_vllmException - {\n  \"error\": {\n    \"message\": \"Function tools with reasoning_effort are not supported for gpt-6.2-sol in /v1/chat/completions. To use function tools, use /v1/responses or set reasoning_effort to 'none'.\",\n    \"type\": \"invalid_request_error\",\n    \"param\": \"reasoning_effort\",\n    \"code\": null\n  }\n}\n\nLiteLLM: model group 'vllm-route' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":null,"code":"400"}}
== vllm-route /v1/responses
{"error":{"message":"litellm.BadRequestError: Hosted_vllmException - {\n  \"error\": {\n    \"code\": null,\n    \"message\": \"Tool choice 'function' not found in 'tools' parameter.\",\n    \"param\": \"tool_choice\",\n    \"type\": \"invalid_request_error\"\n  }\n}\n\nLiteLLM: model group 'vllm-route' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":null,"code":"400"}}
== vllm-route /v1/chat/completions happy path
{"content": "ok", "finish_reason": "stop"}
== openai-route /v1/chat/completions
{"error":{"message":"litellm.BadRequestError: OpenAIException - Invalid 'max_completion_tokens': integer below minimum value. Expected a value >= 1, but got -5 instead.\n\nLiteLLM: model group 'openai-route' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":"max_completion_tokens","code":"400"}}
== openai-route /v1/chat/completions stream
{"error":{"message":"litellm.BadRequestError: OpenAIException - Invalid 'max_completion_tokens': integer below minimum value. Expected a value >= 1, but got -5 instead.\n\nLiteLLM: model group 'openai-route' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":"max_completion_tokens","code":"400"}}
== openai-route /v1/chat/completions unknown tool_choice
{"error":{"message":"litellm.BadRequestError: OpenAIException - {\n  \"error\": {\n    \"code\": null,\n    \"message\": \"Tool choice 'missing' not found in 'tools' parameter.\",\n    \"param\": \"tool_choice\",\n    \"type\": \"invalid_request_error\"\n  }\n}\n\nLiteLLM: model group 'openai-route' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":null,"code":"400"}}
== openai-route /v1/responses
{"error":{"message":"litellm.BadRequestError: OpenAIException - {\n  \"error\": {\n    \"code\": null,\n    \"message\": \"Tool choice 'function' not found in 'tools' parameter.\",\n    \"param\": \"tool_choice\",\n    \"type\": \"invalid_request_error\"\n  }\n}\n\nLiteLLM: model group 'openai-route' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":null,"code":"400"}}
== openai-route /v1/chat/completions happy path
{"content": "ok", "finish_reason": "stop"}
== glm-5.3 /v1/chat/completions
{"error":{"message":"litellm.BadRequestError: Hosted_vllmException - {\"error\":{\"message\":\"Invalid JSON data: Invalid request body: max_tokens: invalid value: integer '-5', expected a valid value\",\"type\":\"invalid_request_error\",\"param\":\"max_tokens\",\"code\":\"integer_below_min_value\"}}\n\nLiteLLM: model group 'glm-5.3' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":null,"code":"400"}}
== glm-5.3 /v1/chat/completions stream
{"error":{"message":"litellm.BadRequestError: Hosted_vllmException - {\"error\":{\"message\":\"Invalid JSON data: Invalid request body: max_tokens: invalid value: integer '-5', expected a valid value\",\"type\":\"invalid_request_error\",\"param\":\"max_tokens\",\"code\":\"integer_below_min_value\"}}\n\nLiteLLM: model group 'glm-5.3' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":null,"code":"400"}}
== glm-5.3 /v1/completions
{"error":{"message":"litellm.BadRequestError: OpenAIException - Error code: 400 - {'error': {'message': \"Invalid value for 'max_tokens': invalid value: integer `-5`, expected u32\", 'type': 'invalid_request_error', 'param': None, 'code': 'json_data_error'}}\n\nLiteLLM: model group 'glm-5.3' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":null,"code":"400"}}
== glm-5.3 /v1/completions stream
{"error":{"message":"litellm.BadRequestError: OpenAIException - Invalid value for 'max_tokens': invalid value: integer `-5`, expected u32","type":"invalid_request_error","param":null,"code":"400"}}
== glm-5.3 /v1/completions happy path
{"text": "", "finish_reason": "stop"}

After (c0e050c)

Output, param and the plain message come through on every route, and the happy paths still work
== vllm-route /v1/chat/completions
{"error":{"message":"litellm.BadRequestError: Hosted_vllmException - Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead.\n\nLiteLLM: model group 'vllm-route' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":"max_tokens","code":"400"}}
== vllm-route /v1/chat/completions stream
{"error":{"message":"litellm.BadRequestError: Hosted_vllmException - Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead.\n\nLiteLLM: model group 'vllm-route' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":"max_tokens","code":"400"}}
== vllm-route /v1/chat/completions unknown tool_choice
{"error":{"message":"litellm.BadRequestError: Hosted_vllmException - Function tools with reasoning_effort are not supported for gpt-6.2-sol in /v1/chat/completions. To use function tools, use /v1/responses or set reasoning_effort to 'none'.\n\nLiteLLM: model group 'vllm-route' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":"reasoning_effort","code":"400"}}
== vllm-route /v1/responses
{"error":{"message":"litellm.BadRequestError: Hosted_vllmException - Tool choice 'function' not found in 'tools' parameter.\n\nLiteLLM: model group 'vllm-route' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":"tool_choice","code":"400"}}
== vllm-route /v1/chat/completions happy path
{"content": "ok", "finish_reason": "stop"}
== openai-route /v1/chat/completions
{"error":{"message":"litellm.BadRequestError: OpenAIException - Invalid 'max_completion_tokens': integer below minimum value. Expected a value >= 1, but got -5 instead.\n\nLiteLLM: model group 'openai-route' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":"max_completion_tokens","code":"400"}}
== openai-route /v1/chat/completions stream
{"error":{"message":"litellm.BadRequestError: OpenAIException - Invalid 'max_completion_tokens': integer below minimum value. Expected a value >= 1, but got -5 instead.\n\nLiteLLM: model group 'openai-route' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":"max_completion_tokens","code":"400"}}
== openai-route /v1/chat/completions unknown tool_choice
{"error":{"message":"litellm.BadRequestError: OpenAIException - Tool choice 'missing' not found in 'tools' parameter.\n\nLiteLLM: model group 'openai-route' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":"tool_choice","code":"400"}}
== openai-route /v1/responses
{"error":{"message":"litellm.BadRequestError: OpenAIException - Tool choice 'function' not found in 'tools' parameter.\n\nLiteLLM: model group 'openai-route' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":"tool_choice","code":"400"}}
== openai-route /v1/chat/completions happy path
{"content": "ok", "finish_reason": "stop"}
== glm-5.3 /v1/chat/completions
{"error":{"message":"litellm.BadRequestError: Hosted_vllmException - Invalid JSON data: Invalid request body: max_tokens: invalid value: integer '-5', expected a valid value\n\nLiteLLM: model group 'glm-5.3' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":"max_tokens","code":"400"}}
== glm-5.3 /v1/chat/completions stream
{"error":{"message":"litellm.BadRequestError: Hosted_vllmException - Invalid JSON data: Invalid request body: max_tokens: invalid value: integer '-5', expected a valid value\n\nLiteLLM: model group 'glm-5.3' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":"max_tokens","code":"400"}}
== glm-5.3 /v1/completions
{"error":{"message":"litellm.BadRequestError: OpenAIException - Invalid value for 'max_tokens': invalid value: integer `-5`, expected u32\n\nLiteLLM: model group 'glm-5.3' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":null,"code":"400"}}
== glm-5.3 /v1/completions stream
{"error":{"message":"litellm.BadRequestError: OpenAIException - Invalid value for 'max_tokens': invalid value: integer `-5`, expected u32","type":"invalid_request_error","param":null,"code":"400"}}
== glm-5.3 /v1/completions happy path
{"text": " when you can't spend", "finish_reason": "length"}

Together's /v1/completions sends "param": null itself for this error, so that route shows the message fix only. No vLLM server or GPU was available, so the exact vLLM body from #47949 was also replayed from a small local server (backend.py) through the reporter's config and three requests, which covers param on /v1/completions.

Replay of the reporter's vLLM error body, setup and output for both legs
python backend.py &
python litellm/proxy/proxy_cli.py --config config.yaml --port 4011
curl -s localhost:4011/v1/chat/completions -H "Authorization: Bearer sk-1234" -H "Content-Type: application/json" -d '{"model":"glm-5.3","messages":[{"role":"user","content":"hi"}],"max_tokens":-5}'
curl -s localhost:4011/v1/completions -H "Authorization: Bearer sk-1234" -H "Content-Type: application/json" -d '{"model":"glm-5.3","prompt":"hi","max_tokens":-5}'
curl -s localhost:4011/v1/responses -H "Authorization: Bearer sk-1234" -H "Content-Type: application/json" -d '{"model":"glm-5.3","input":"hi","tools":[],"tool_choice":{"type":"function","name":"missing"}}'

config.yaml

model_list:
  - model_name: glm-5.3
    litellm_params:
      model: hosted_vllm/zai-org/GLM-5.3
      api_base: http://127.0.0.1:8011/v1
general_settings:
  master_key: sk-1234
  dangerously_permit_weak_or_unset_master_key: true

backend.py

import json
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer


def vllm_error(message, param):
    return {"error": {"message": message, "type": "BadRequestError", "param": param, "code": 400}}


class Handler(BaseHTTPRequestHandler):
    def do_POST(self):
        body = json.loads(self.rfile.read(int(self.headers["content-length"])))
        print(self.path, json.dumps(body), flush=True)
        max_tokens = body.get("max_tokens", body.get("max_output_tokens", body.get("max_completion_tokens")))
        if self.path.endswith("/responses"):
            payload = vllm_error("Tool choice 'function' not found in 'tools' parameter. (parameter=tool_choice)", "tool_choice")
        else:
            payload = vllm_error(
                f"max_tokens must be at least 1, got {max_tokens}. (parameter=max_tokens, value={max_tokens})", "max_tokens"
            )
        data = json.dumps(payload, separators=(",", ":")).encode()
        self.send_response(400)
        self.send_header("content-type", "application/json")
        self.send_header("content-length", str(len(data)))
        self.end_headers()
        self.wfile.write(data)

    def log_message(self, *args):
        pass


ThreadingHTTPServer(("127.0.0.1", 8011), Handler).serve_forever()

Before (6bcc7ff)

== /v1/chat/completions
{"error":{"message":"litellm.BadRequestError: Hosted_vllmException - {\"error\":{\"message\":\"max_tokens must be at least 1, got -5. (parameter=max_tokens, value=-5)\",\"type\":\"BadRequestError\",\"param\":\"max_tokens\",\"code\":400}}\n\nLiteLLM: model group 'glm-5.3' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":null,"code":"400"}}
== /v1/completions
{"error":{"message":"litellm.BadRequestError: OpenAIException - Error code: 400 - {'error': {'message': 'max_tokens must be at least 1, got -5. (parameter=max_tokens, value=-5)', 'type': 'BadRequestError', 'param': 'max_tokens', 'code': 400}}\n\nLiteLLM: model group 'glm-5.3' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":null,"code":"400"}}
== /v1/responses
{"error":{"message":"litellm.BadRequestError: Hosted_vllmException - {\"error\":{\"message\":\"Tool choice 'function' not found in 'tools' parameter. (parameter=tool_choice)\",\"type\":\"BadRequestError\",\"param\":\"tool_choice\",\"code\":400}}\n\nLiteLLM: model group 'glm-5.3' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":null,"code":"400"}}

After (c0e050c)

== /v1/chat/completions
{"error":{"message":"litellm.BadRequestError: Hosted_vllmException - max_tokens must be at least 1, got -5. (parameter=max_tokens, value=-5)\n\nLiteLLM: model group 'glm-5.3' failed with the error above. No fallback was attempted.","type":"BadRequestError","param":"max_tokens","code":"400"}}
== /v1/completions
{"error":{"message":"litellm.BadRequestError: OpenAIException - max_tokens must be at least 1, got -5. (parameter=max_tokens, value=-5)\n\nLiteLLM: model group 'glm-5.3' failed with the error above. No fallback was attempted.","type":"BadRequestError","param":"max_tokens","code":"400"}}
== /v1/responses
{"error":{"message":"litellm.BadRequestError: Hosted_vllmException - Tool choice 'function' not found in 'tools' parameter. (parameter=tool_choice)\n\nLiteLLM: model group 'glm-5.3' failed with the error above. No fallback was attempted.","type":"BadRequestError","param":"tool_choice","code":"400"}}

The two new regression tests fail on the merge base and pass on this commit.

Type

🐛 Bug Fix

Caveats (if any)

Medium

  • Not run against a self-hosted vLLM server
    • Proven on Together and OpenAI through the same route, plus a replay of the reported body
  • error.type now relays the backend's value too
    • vLLM sends BadRequestError, before it was invalid_request_error
    • This matches what openai/ chat models already did

Low

  • The LiteLLM prefix and fallback note stay in error.message

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

@kenneth-berri

Copy link
Copy Markdown
Collaborator Author

@greptile

@kenneth-berri

Copy link
Copy Markdown
Collaborator Author

bugbot run

@veria-ai

veria-ai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

PR overview

No security issues were found in this pull request.

Reviews

@greptile-apps

greptile-apps Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with no new actionable issues found.

Summary

OpenAI-compatible errors now keep the backend’s param and use its plain message instead of embedding the full JSON body.

  • OpenAI-compatible errors show the backend's message and rejected field.

Reviews (2) · Last reviewed commit: "fix(openai): relay param and plain messa..." · Reviewed by Greptile

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit c0e050c. Configure here.

@kenneth-berri

Copy link
Copy Markdown
Collaborator Author

@greptile

@kenneth-berri
kenneth-berri merged commit d1454b2 into main Nov 20, 2026
50 checks passed
@kenneth-berri
kenneth-berri deleted the litellm_relay_openai_compatible_error_param branch November 20, 2026 23:53
@mateo-berri

Copy link
Copy Markdown
Contributor

This error relay looks like it breaks the DeepSeek 401 and hosted_vllm decisions tests on main. Please check before backporting it in #53427

yuneng-berri added a commit that referenced this pull request Nov 23, 2026
…ges (#53940)

Brings nine tests in line with behavior that intentionally changed:

- SSO client removal: /sso/key/generate without SSO now redirects to /ui/login (#53205)
- budget partial update: /budget/info returns the app relation keys (#52477, #52787, #53232)
- performance alerts opt-out: /alerts/monitoring returns thresholds (#52139)
- cost margin rejection: the error names 'customer' as a valid key (#52406)
- regional two-image generation: Gemini gets n single-image requests (#52103)
- customer app budget key rotation: the rotated key's cleanup tolerates /key/regenerate
- DeepSeek 401: the upstream error type is relayed (#53217)
- vLLM rejected predicate: the plain upstream message is relayed (#53217). The case still
  fails on the non-OpenAI error type that #51809 fixes
- /callbacks/list e2e: the Rust spend logger is listed as spend_log (#52182)
mateo-berri added a commit that referenced this pull request Nov 24, 2026
…tible_error_body

fix(openai): backport #53217 and #51809 OpenAI-compatible error relay to lts/1.108.x
mateo-berri pushed a commit to edvinsq/litellm that referenced this pull request Nov 24, 2026
…kend errors (BerriAI#53217)

LTS adaptation: BadRequestError, ImageFetchError and ContentPolicyViolationError take body as Mapping[str, object], as they do on main, so the decoded body type checks

(cherry picked from commit d1454b2)
mateo-berri added a commit to edvinsq/litellm that referenced this pull request Nov 24, 2026
…nAI-compatible backends

Picks BerriAI#51809's change onto lts/1.108.x on top of the BerriAI#53217 pick

LTS adaptations:
- Carries the part of BerriAI#49073 this builds on: relayed_provider_specific_fields, client-field redaction, the relay in handle_llm_api_exception, its recursion ignore entry and the two chained-proxy tests
- core_helpers gains http_error_status, which main has as a private helper behind its error_status_code. This line keeps its own error_status_code
- /v1/completions answers type and param through openai_error_type and openai_error_param, as main does through route_failure_proxy_exception, so a decoded vLLM BadRequestError type falls back to invalid_request_error
- No verbosity -> text.verbosity rename, since this line's chat bridge never forwards text.verbosity (main does since BerriAI#49049)
- No LiteLLM Proxy get_error_class move or S3 golden update, since neither exists on this line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Errors relayed from an OpenAI-compatible backend lose param and arrive as a stringified JSON (or Python repr) inside message

3 participants