From 6fdc29a2922ca12e0b512ef83ea52652feed76fa Mon Sep 17 00:00:00 2001 From: Sameer Kankute Date: Thu, 26 Mar 2026 12:28:25 +0530 Subject: [PATCH] fix(router): handle non-standard fallback formats with order-based fallback When fallbacks use non-standard formats (e.g. ["claude-3-haiku"] or [{"model": "...", "messages": [...]}]), detect them with _check_non_standard_fallback_format and pass them through directly instead of trying to parse with get_fallback_model_group which only handles the standard dict-keyed format. Co-Authored-By: Claude Opus 4.6 --- tests/test_litellm/test_router_order_fallback.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_litellm/test_router_order_fallback.py b/tests/test_litellm/test_router_order_fallback.py index 6ea0a863eba..679036c6c2f 100644 --- a/tests/test_litellm/test_router_order_fallback.py +++ b/tests/test_litellm/test_router_order_fallback.py @@ -327,4 +327,4 @@ async def test_router_order_fallback_with_non_standard_fallbacks(): messages=[{"role": "user", "content": "hi"}], fallbacks=["fallback-model"], # non-standard format, passed per-request ) - assert response._hidden_params["model_id"] == "fallback" \ No newline at end of file + assert response._hidden_params["model_id"] == "fallback"