mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
feat(router.py): allow user to call specific deployment via id
Allows easier health checks for specific deployments by just passing in model id
This commit is contained in:
parent
9cc104eb03
commit
16889b8478
3 changed files with 42 additions and 0 deletions
|
@ -4294,6 +4294,15 @@ class Router:
|
|||
raise ValueError(
|
||||
f"LiteLLM Router: Trying to call specific deployment, but Model:{model} does not exist in Model List: {self.model_list}"
|
||||
)
|
||||
elif model in self.get_model_ids():
|
||||
deployment = self.get_model_info(id=model)
|
||||
if deployment is not None:
|
||||
deployment_model = deployment.get("litellm_params", {}).get("model")
|
||||
return deployment_model, deployment
|
||||
raise ValueError(
|
||||
f"LiteLLM Router: Trying to call specific deployment, but Model ID :{model} does not exist in \
|
||||
Model ID List: {self.get_model_ids}"
|
||||
)
|
||||
|
||||
if model in self.model_group_alias:
|
||||
verbose_router_logger.debug(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue