mirror of
https://github.com/BerriAI/litellm.git
synced 2026-12-02 01:28:38 +00:00
* fix(proxy): bill full provider usage on interrupted /chat/completions streams When a client disconnects mid-stream the proxy now keeps reading the provider stream in a detached task until its final usage chunk and bills that, as /v1/messages already does. Drains are capped and time-limited. Ports #49715 onto current main. Co-authored-by: nuernber <benjamin.nuernberger@jpl.nasa.gov> * fix(proxy): bill drains stopped at shutdown on the chunks read, type the new test helpers * fix(proxy): count drained streams on the router, bound the shutdown wait, always close the provider stream * fix(proxy): count a drain that yields nothing on the router, give shutdown billing a minimum wait * fix(proxy): read a drained stream's usage off its chunks when the drain yields nothing * test(proxy): an abandoned queued stream bills the whole provider reply * fix(proxy): a drain stopped early counts its billed tokens on the router Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(proxy): only drain a disconnected chat stream for providers that keep generating A provider that stops generating when the connection closes would generate and bill the rest of the reply only because the proxy kept reading. The drain now runs for Bedrock by default, and CHAT_COMPLETIONS_DISCONNECT_DRAIN_PROVIDERS opts other providers in. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(proxy): drain a disconnected chat stream only for Bedrock The issue reports Bedrock, so the drain is limited to it and the setting that opted other providers in is removed. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: nuernber <benjamin.nuernberger@jpl.nasa.gov> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| test_api_docs.py | ||
| test_circular_imports.py | ||
| test_env_keys.py | ||
| test_exception_types.py | ||
| test_general_setting_keys.py | ||
| test_optional_params.py | ||
| test_readme_providers.py | ||
| test_requests_lib_usage.py | ||
| test_router_settings.py | ||
| test_standard_logging_payload.py | ||