Ykeremy/fix router pass empty redis password (#143)

This commit is contained in:
Kerem Yilmaz
2024-04-01 16:28:46 -07:00
committed by GitHub
parent f175545399
commit 3cc07c9d20
4 changed files with 35 additions and 2 deletions

View File

@@ -35,6 +35,7 @@ class LLMAPIHandlerFactory:
model_list=[dataclasses.asdict(model) for model in llm_config.model_list],
redis_host=llm_config.redis_host,
redis_port=llm_config.redis_port,
redis_password=llm_config.redis_password,
routing_strategy=llm_config.routing_strategy,
fallbacks=[{llm_config.main_model_group: llm_config.fallback_model_group}]
if llm_config.fallback_model_group

View File

@@ -33,8 +33,10 @@ class LLMRouterModelConfig:
@dataclass(frozen=True)
class LLMRouterConfig(LLMConfig):
model_list: list[LLMRouterModelConfig]
# All three redis parameters are required. Even if there isn't a password, it should be an empty string.
redis_host: str
redis_port: int
redis_password: str
main_model_group: str
fallback_model_group: str | None = None
routing_strategy: Literal[
@@ -45,7 +47,7 @@ class LLMRouterConfig(LLMConfig):
] = "usage-based-routing"
num_retries: int = 2
retry_delay_seconds: int = 15
set_verbose: bool = True
set_verbose: bool = False
class LLMAPIHandler(Protocol):