Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
343ef87
fix: correct amazon.titan-embed-text-v2 input price to $0.02/1M token…
Srivatsa03 Jun 22, 2026
45b4dca
fix(sensitive_data_masker): fully mask secrets at or below the reveal…
Srivatsa03 Jun 22, 2026
2b29b92
refactor(fireworks_ai): remove deprecated audio transcriptions endpoi…
shzdehmd Jun 22, 2026
19450bd
feat: add darkbloom provider (#30876)
jychp Jun 22, 2026
488f787
fix: fail fast for non-Postgres database URLs (#30883)
krishvsoni Jun 22, 2026
67c0183
fix(bedrock): surface modeled HTTP status for mid-stream error events…
kingdoooo Jun 22, 2026
0a359ce
fix(mcp): re-land native tool preservation with typed annotations (#3…
ayushh0110 Jun 22, 2026
e5ce7ab
fix(sambanova): return embeddings supported params instead of droppin…
hoangsonww Jun 22, 2026
7fa04db
fix(router): send fallback metadata when streaming (#30914)
talmar-island Jun 22, 2026
37a2a32
fix(mistral): drop output-only reasoning fields from input messages (…
hemant1026 Jun 22, 2026
8f4a2bc
fix(perplexity): bill search queries at the per-request price, not 1/…
devYRPauli Jun 22, 2026
ad2b395
fix: include model_access_groups when expanding all-team-models in ge…
factnn Jun 22, 2026
da85887
fix(fireworks_ai): return None for transcription in get_supported_ope…
Sameerlite Jun 22, 2026
e7ff3e1
fix(proxy): gate include_fallback_errors behind expose_fallback_error…
Sameerlite Jun 22, 2026
db2bc49
test(proxy): opt in to expose_fallback_errors_to_caller in streaming …
Sameerlite Jun 22, 2026
0a82e13
test(prompt_templates): make test_convert_url hermetic instead of hit…
mateo-berri Jun 22, 2026
5663bcf
fix(interactions): drop role from Interaction response to match Googl…
mateo-berri Jun 22, 2026
d093dc2
fix: align all-team-models sentinel access
cursoragent Jun 22, 2026
dc6611b
fix(router): forward include_fallback_errors through multi-hop fallbacks
mateo-berri Jun 22, 2026
0159f7a
fix(router): stop fallback lookups from mutating the router fallbacks…
Vedant-Agarwal Jun 22, 2026
a45a30c
Merge branch 'litellm_oss_staging' into fix-fallback-model-group-list…
Sameerlite Jun 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion litellm/router_utils/fallback_event_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def get_fallback_model_group(
elif list(item.keys())[0] == "*": # check generic fallback
generic_fallback_idx = idx
elif isinstance(item, str):
fallback_model_group = [fallbacks.pop(idx)] # returns single-item list
fallback_model_group = [item]
## if none, check for generic fallback
if fallback_model_group is None:
if stripped_model_fallback is not None:
Expand Down
18 changes: 17 additions & 1 deletion tests/test_litellm/router_utils/test_fallback_event_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

import pytest

from litellm.router_utils.fallback_event_handlers import run_async_fallback
from litellm.router_utils.fallback_event_handlers import (
get_fallback_model_group,
run_async_fallback,
)


class StreamingWrapper:
Expand Down Expand Up @@ -137,3 +140,16 @@ async def test_run_async_fallback_skips_original_model_group():
)

assert response._hidden_params["additional_headers"]["x-litellm-attempted-fallbacks"] == 1


def test_get_fallback_model_group_does_not_mutate_fallbacks():
"""A string fallback must be resolved without mutating the caller's
fallbacks list, which is the live router config shared across requests."""
fallbacks = [{"gpt-3.5-turbo": ["claude-3-haiku"]}, "gpt-4o-mini"]

fallback_model_group, _ = get_fallback_model_group(
fallbacks=fallbacks, model_group="unmatched-model"
)

assert fallback_model_group == ["gpt-4o-mini"]
assert fallbacks == [{"gpt-3.5-turbo": ["claude-3-haiku"]}, "gpt-4o-mini"]
Loading