mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-14 23:21:35 +00:00
* fix(streaming): surface in-body error payloads on OpenAI-compatible streams
vLLM and sglang return HTTP 200 streams whose SSE body carries the error,
e.g. data: {"error": {"message": "...", "code": 400}}. The OpenAI-compatible
chunk parser had no detection for this shape: since #23931 the payload parsed
into an empty chunk (choices=[]) and the stream ended silently with 200,
losing the provider's error and never attempting configured fallbacks.
Detect the payload in OpenAIChatCompletionStreamingHandler.chunk_parser and
raise OpenAIError with the upstream message and status code. The existing
mid-stream gate then applies: 4xx surface directly to the client, 5xx wrap
into MidStreamFallbackError so the router can run configured fallbacks.
Fixes #25492
* fix(streaming): serialize messageless error payloads as JSON
Address review feedback: an error dict without a message field now
serializes via json.dumps instead of Python dict repr
|
||
|---|---|---|
| .. | ||
| chat | ||
| completion | ||
| embeddings/guardrail_translation | ||
| evals | ||
| image_generation | ||
| realtime | ||
| responses | ||
| speech | ||
| transcriptions | ||
| vector_store_files | ||
| vector_stores | ||
| videos | ||
| test_data_residency.py | ||
| test_gpt5_transformation.py | ||
| test_is_model_gpt_5_model.py | ||
| test_o_series_transformation.py | ||
| test_openai_common_utils.py | ||
| test_openai_empty_response.py | ||
| test_openai_file_content_streaming.py | ||
| test_openai_image_edit_transformation.py | ||
| test_use_chat_completions_api_no_leak.py | ||