mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-18 09:45:23 +00:00
fix(router): filter model_alias_map as router-only kwargs
This commit is contained in:
parent
6762d65eb8
commit
d2da41c775
2 changed files with 17 additions and 1 deletions
|
|
@ -28,7 +28,9 @@ from litellm.types.utils import LlmProviders, ProviderSpecificModelInfo
|
|||
_V = TypeVar("_V")
|
||||
|
||||
MID_STREAM_CONTINUATION_KWARG: Final = "_mid_stream_continuation"
|
||||
ROUTER_ONLY_CALL_KWARGS: Final = frozenset({"silent_model", "include_fallback_errors", MID_STREAM_CONTINUATION_KWARG})
|
||||
ROUTER_ONLY_CALL_KWARGS: Final = frozenset(
|
||||
{"model_alias_map", "silent_model", "include_fallback_errors", MID_STREAM_CONTINUATION_KWARG}
|
||||
)
|
||||
_OBJECT_MAPPING_ADAPTER: Final[TypeAdapter[Mapping[object, object]]] = TypeAdapter(Mapping[object, object])
|
||||
|
||||
|
||||
|
|
|
|||
14
tests/unit/router_utils/test_router_only_kwargs.py
Normal file
14
tests/unit/router_utils/test_router_only_kwargs.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
from litellm.router_utils.common_utils import without_router_only_kwargs
|
||||
|
||||
|
||||
def test_without_router_only_kwargs_removes_model_alias_map():
|
||||
kwargs = {
|
||||
"model": "gpt-4o",
|
||||
"model_alias_map": {"alias": "gpt-4o"},
|
||||
"silent_model": "shadow-model",
|
||||
"include_fallback_errors": True,
|
||||
"_mid_stream_continuation": True,
|
||||
}
|
||||
|
||||
assert without_router_only_kwargs(kwargs) == {"model": "gpt-4o"}
|
||||
assert kwargs["model_alias_map"] == {"alias": "gpt-4o"}
|
||||
Loading…
Add table
Reference in a new issue