mirror of
https://github.com/BerriAI/litellm.git
synced 2026-12-02 01:28:38 +00:00
* fix(responses): reject background on chat completions bridged to the Responses API A background run answers with a queued response and no output, so the chat bridge failed with a 500 after OpenAI had already started a billed run, and retries started more. The bridge now answers 400 UnsupportedParamsError before any upstream call, unless drop_params, litellm.drop_params, or additional_drop_params drops it, and it never sends background upstream. * fix(responses): keep background on streamed chat completions bridged to the Responses API OpenAI streams a background run's events and the chat bridge turns them into chunks, so a streamed request with background worked before. The background check now applies only to non-streamed requests, where the run's output never reaches the caller. * fix(responses): reject background on bridged chat completions unless the provider streams it live A faked stream (fake_stream, or a model without native streaming) still sends a non-streamed request upstream, so background there starts a run /chat/completions cannot retrieve. Treat it like a non-streamed call: drop under drop_params, answer 400 otherwise. * fix(responses): keep background on providers that strip it and send background false as set ChatGPT and Bedrock Runtime drop background before the upstream call, so the chat bridge now asks each provider's Responses config whether it forwards background and skips the check when it does not. background: false reaches the provider unchanged, extra_body stream decides whether the run streams live, and the 400 names additional_drop_params. * fix(responses): check background with the dispatch's own Responses config The guard now asks the same resolver the Responses dispatch uses, so a deployment that passes /v1/responses through is guarded and an azure_ai base that does not serve the OpenAI v1 API keeps its chat fallback * fix(responses): let providers that answer background inline keep it, and read faked streams from the dispatch config OpenRouter, refuseless, openinfer and zerogpu answer a background: true Responses call in the same reply, so bridged chat completions there keep sending it instead of getting a 400. The fake-stream check now resolves the same Responses config the dispatch uses, so a pass-through deployment on a model without native streaming is refused when it streams with background. * refactor(responses): run the background check inside the bridge params helper * fix(responses): check background on Eden AI only where its upstream starts a run * fix(responses): refuse background only on servers known to start a run The check now refuses a bridged chat completion with background only where the server is known to start a run, which is OpenAI and Azure hosts plus the providers that were seen to queue one. Any other server gets background as it did before. When such a server answers with an unfinished run, the call ends in one 400 after that single run, so the Router does not retry it into more. drop_params and additional_drop_params drop background on every bridged call that does not stream live. Streams are judged by the Responses config that serves the call, also when the call is bridged late for its tools, and the fake-stream timeout goes back to the behavior on main * fix(responses): judge background by the server a supplied OpenAI client points at A caller that passes client=OpenAI(base_url=...) sends the request to that base URL, so the background check now reads it instead of OpenAI's default host * fix(responses): count Azure cognitiveservices hosts as servers that start background runs An openai/ or custom_openai/ deployment on a *.cognitiveservices.azure.com Azure OpenAI v1 host started one billed run before the 400, so the check now knows that host too --------- Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| chat | ||
| embedding | ||
| messages | ||
| responses | ||
| __init__.py | ||
| test_abliteration_provider.py | ||
| test_aiand_provider.py | ||
| test_assemblyai_provider.py | ||
| test_charity_engine.py | ||
| test_cognition_provider.py | ||
| test_coralbricks_provider.py | ||
| test_cortecs_provider.py | ||
| test_dynamic_config.py | ||
| test_empiriolabs_provider.py | ||
| test_hostinger_router_provider.py | ||
| test_huawei_maas_provider.py | ||
| test_inferenceapis_provider.py | ||
| test_json_loader.py | ||
| test_json_providers.py | ||
| test_kyma_provider.py | ||
| test_libertai_provider.py | ||
| test_meta_provider.py | ||
| test_model_info.py | ||
| test_openinfer_provider.py | ||
| test_perplexity_orchestrator_provider.py | ||
| test_pinstripes_provider.py | ||
| test_prism_provider.py | ||
| test_provider_affinity_forwarding.py | ||
| test_refuseless_provider.py | ||
| test_reka_provider.py | ||
| test_resetdata_provider.py | ||
| test_sarvam_provider.py | ||
| test_scx_ai_provider.py | ||
| test_streamlake_provider.py | ||
| test_tensormesh_provider.py | ||
| test_vispark_provider.py | ||
| test_wally_provider.py | ||
| test_xiaomi_mimo.py | ||
| test_zerogpu_provider.py | ||