mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-20 05:04:24 +00:00
The weighted-routing guard checked only healthy_deployments[0] for each metric (weight/rpm/tpm). If the first deployment lacked the field, the entire metric was skipped even when later deployments had it, causing silent fallback to uniform random.choice. Fix: replace the single-element probe with any(...) over all healthy deployments so the metric is activated whenever at least one deployment carries it. The existing zero-total-weight guard already handles the case where the first-element value is 0 (numeric falsy) correctly. Add four unit tests covering: - weight present only on second deployment (was broken) - same after reversing the list (was broken in opposite order) - no weights -> falls through to uniform pick - all weights present -> weighted pick (regression) Signed-off-by: Aloys Jehwin <aloys.jehwin@sap.com> |
||
|---|---|---|
| .. | ||
| conftest.py | ||
| create_mock_standard_logging_payload.py | ||
| gettysburg.wav | ||
| README.md | ||
| test_completion_no_copy.py | ||
| test_default_deployment_copy.py | ||
| test_get_model_list_alias_optimization.py | ||
| test_pre_call_checks_optimization.py | ||
| test_prompt_management_check.py | ||
| test_router_acancel_batch.py | ||
| test_router_adding_deployments.py | ||
| test_router_aresponses_streaming_fallback.py | ||
| test_router_batch_utils.py | ||
| test_router_cooldown_utils.py | ||
| test_router_embedding_headers.py | ||
| test_router_embedding_integration.py | ||
| test_router_endpoints.py | ||
| test_router_handle_error.py | ||
| test_router_helper_utils.py | ||
| test_router_index_management.py | ||
| test_router_prompt_caching.py | ||
| test_simple_shuffle.py | ||
Router component unit tests.
Please name all files with the word 'router' in them.
This is used to ensure all functions in the router are tested.