Merge pull request #891 from NousResearch/hermes/hermes-b0162f8d
fix: sort Nous Portal model list (opus first, sonnet lower)
This commit is contained in:
commit
a35c37a2f9
1 changed files with 13 additions and 0 deletions
|
|
@ -1103,6 +1103,19 @@ def fetch_nous_models(
|
||||||
continue
|
continue
|
||||||
model_ids.append(mid)
|
model_ids.append(mid)
|
||||||
|
|
||||||
|
# Sort: prefer opus > pro > haiku/flash > sonnet (sonnet is cheap/fast,
|
||||||
|
# users who want the best model should see opus first).
|
||||||
|
def _model_priority(mid: str) -> tuple:
|
||||||
|
low = mid.lower()
|
||||||
|
if "opus" in low:
|
||||||
|
return (0, mid)
|
||||||
|
if "pro" in low and "sonnet" not in low:
|
||||||
|
return (1, mid)
|
||||||
|
if "sonnet" in low:
|
||||||
|
return (3, mid)
|
||||||
|
return (2, mid)
|
||||||
|
|
||||||
|
model_ids.sort(key=_model_priority)
|
||||||
return list(dict.fromkeys(model_ids))
|
return list(dict.fromkeys(model_ids))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue