(feat) use regex pattern matching for wildcard routing (#6150)

* use pattern matching for llm deployments

* code quality fix

* fix linting

* add types to PatternMatchRouter

* docs add example config for regex patterns
This commit is contained in:
Ishaan Jaff 2024-10-10 18:24:16 +05:30 committed by GitHub
parent 69544ebe08
commit 6b5f19299b
6 changed files with 169 additions and 40 deletions

View file

@ -109,7 +109,7 @@ async def route_request(
return getattr(litellm, f"{route_type}")(**data)
elif (
llm_router.default_deployment is not None
or len(llm_router.provider_default_deployments) > 0
or len(llm_router.pattern_router.patterns) > 0
):
return getattr(llm_router, f"{route_type}")(**data)