mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 03:34:10 +00:00
(fix) router - allow user to call 1 deployment
This commit is contained in:
parent
c01b15af17
commit
8c6103259b
1 changed files with 7 additions and 0 deletions
|
@ -1064,6 +1064,13 @@ class Router:
|
||||||
healthy_deployments.remove(deployment)
|
healthy_deployments.remove(deployment)
|
||||||
self.print_verbose(f"healthy deployments: length {len(healthy_deployments)} {healthy_deployments}")
|
self.print_verbose(f"healthy deployments: length {len(healthy_deployments)} {healthy_deployments}")
|
||||||
if len(healthy_deployments) == 0:
|
if len(healthy_deployments) == 0:
|
||||||
|
# users can also specify a specific deployment name. At this point we should check if they are just trying to call a specific deployment
|
||||||
|
for deployment in self.model_list:
|
||||||
|
cleaned_model = litellm.utils.remove_model_id(deployment.get("litellm_params").get("model"))
|
||||||
|
if cleaned_model == model:
|
||||||
|
# User Passed a specific deployment name on their config.yaml, example azure/chat-gpt-v-2
|
||||||
|
# return the first deployment where the `model` matches the specificed deployment name
|
||||||
|
return deployment
|
||||||
raise ValueError("No models available")
|
raise ValueError("No models available")
|
||||||
if litellm.model_alias_map and model in litellm.model_alias_map:
|
if litellm.model_alias_map and model in litellm.model_alias_map:
|
||||||
model = litellm.model_alias_map[
|
model = litellm.model_alias_map[
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue