mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-11 03:38:38 +00:00
fix(router): stop ttft_timeout/stream_idle_timeout leaking to provider API
When set in a deployment's litellm_params, ttft_timeout and stream_idle_timeout were assembled into input_kwargs and forwarded to litellm.acompletion. Because neither key was in all_litellm_params, the provider param filtering treated them as model-specific extras and passed them to the upstream API, which 400s on unknown fields; this broke the exact per-deployment configuration the feature documents. Add both keys to all_litellm_params alongside stream_timeout so filter_out_litellm_params strips them before the provider call, while the router still resolves their values from litellm_params. Regression test asserts they are filtered out while genuine provider params (temperature) are kept.
This commit is contained in:
parent
15bd7fb804
commit
f45f71b2d3
2 changed files with 22 additions and 0 deletions
|
|
@ -3196,6 +3196,8 @@ all_litellm_params = (
|
|||
"no-log",
|
||||
"base_model",
|
||||
"stream_timeout",
|
||||
"ttft_timeout",
|
||||
"stream_idle_timeout",
|
||||
"supports_system_message",
|
||||
"region_name",
|
||||
"allowed_model_region",
|
||||
|
|
|
|||
|
|
@ -34,3 +34,23 @@ def test_filter_out_litellm_params():
|
|||
assert "litellm_trace_id" not in filtered
|
||||
assert "proxy_server_request" not in filtered
|
||||
assert "secret_fields" not in filtered
|
||||
|
||||
|
||||
def test_filter_out_router_timeout_params_not_forwarded_to_provider():
|
||||
"""ttft_timeout / stream_idle_timeout are router-internal params; they must be filtered
|
||||
out so they are never forwarded to the upstream provider API (where they would 400),
|
||||
while genuine provider params are kept. Regression for the params leaking via
|
||||
per-deployment litellm_params."""
|
||||
kwargs = {
|
||||
"ttft_timeout": 8.0,
|
||||
"stream_idle_timeout": 30.0,
|
||||
"stream_timeout": 60.0,
|
||||
"temperature": 0.5,
|
||||
}
|
||||
|
||||
filtered = filter_out_litellm_params(kwargs=kwargs)
|
||||
|
||||
assert "ttft_timeout" not in filtered
|
||||
assert "stream_idle_timeout" not in filtered
|
||||
assert "stream_timeout" not in filtered
|
||||
assert filtered["temperature"] == 0.5
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue