Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions hermes_cli/model_switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -1958,8 +1958,14 @@ def _has_aws_sdk_creds_for_listing(slug: str) -> bool:
models_list.append(m)
elif isinstance(cfg_models, list):
for m in cfg_models:
if m and m not in models_list:
models_list.append(m)
# List entries are normally plain id strings, but hand-edited
# configs sometimes use {id|model|name: ..., label: ...} dicts.
# Extract the id so models_list stays a list[str]: every
# downstream consumer (inventory dedup, capabilities, pricing)
# assumes string ids and calls .lower() / uses them as keys.
mid = (m.get("id") or m.get("model") or m.get("name") or "") if isinstance(m, dict) else m
if mid and mid not in models_list:
models_list.append(mid)

# Official OpenAI API rows in providers: often have base_url but no
# explicit models: dict — avoid a misleading zero count in /model.
Expand Down