(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

@ -5553,7 +5553,7 @@ async def anthropic_response(
and data["model"] not in router_model_names
and (
llm_router.default_deployment is not None
or len(llm_router.provider_default_deployments) > 0
or len(llm_router.pattern_router.patterns) > 0
)
): # model in router deployments, calling a specific deployment on the router
llm_response = asyncio.create_task(llm_router.aadapter_completion(**data))