feat: improve model version handling in endpoint selection
Add logic to only append ":latest" suffix to models without existing version suffixes, preventing duplicate version tags and ensuring correct endpoint selection for models following Ollama naming conventions.
This commit is contained in:
parent
3ccaf78e5d
commit
5eb5490d16
1 changed files with 4 additions and 2 deletions
|
|
@ -687,7 +687,7 @@ async def choose_endpoint(model: str) -> str:
|
|||
if model in models
|
||||
]
|
||||
|
||||
# 6️⃣
|
||||
# 6️⃣
|
||||
if not candidate_endpoints:
|
||||
if ":latest" in model: #ollama naming convention not applicable to openai
|
||||
model_without_latest = model.split(":latest")[0]
|
||||
|
|
@ -696,7 +696,9 @@ async def choose_endpoint(model: str) -> str:
|
|||
if model_without_latest in models and is_ext_openai_endpoint(ep)
|
||||
]
|
||||
if not candidate_endpoints:
|
||||
model = model + ":latest"
|
||||
# Only add :latest suffix if model doesn't already have a version suffix
|
||||
if ":" not in model:
|
||||
model = model + ":latest"
|
||||
candidate_endpoints = [
|
||||
ep for ep, models in zip(config.endpoints, advertised_sets)
|
||||
if model in models
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue