mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 19:24:27 +00:00
first commit
This commit is contained in:
parent
3ff1aa6c4e
commit
672cd09e3f
1 changed files with 2 additions and 2 deletions
|
@ -109,14 +109,14 @@ class Router:
|
||||||
if len(self.healthy_deployments) > 0:
|
if len(self.healthy_deployments) > 0:
|
||||||
for item in self.healthy_deployments:
|
for item in self.healthy_deployments:
|
||||||
if item[0]["model_name"] == model: # first one in queue will be the one with the most availability
|
if item[0]["model_name"] == model: # first one in queue will be the one with the most availability
|
||||||
return item
|
return item or item[0]
|
||||||
else:
|
else:
|
||||||
potential_deployments = []
|
potential_deployments = []
|
||||||
for item in self.model_list:
|
for item in self.model_list:
|
||||||
if item["model_name"] == model:
|
if item["model_name"] == model:
|
||||||
potential_deployments.append(item)
|
potential_deployments.append(item)
|
||||||
item = random.choice(potential_deployments)
|
item = random.choice(potential_deployments)
|
||||||
return item
|
return item or item[0]
|
||||||
|
|
||||||
raise ValueError("No models available.")
|
raise ValueError("No models available.")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue