Skip to content
Closed
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion agent/model_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,10 @@ def _strip_provider_prefix(model: str) -> str:
# https://platform.minimax.io/docs/api-reference/text-chat-openai
"minimax-m3": 1000000,
"minimax": 204800,
# GLM
# GLM — GLM-5.2 ships with 1M context; GLM-5 and GLM-5.1 are 200K.
# Substring matching is longest-first, so "glm-5.2" wins over the
# generic "glm" catch-all for that slug.
"glm-5.2": 1_000_000,
"glm": 202752,
# xAI Grok — xAI /v1/models does not return context_length metadata,
# so these hardcoded fallbacks prevent Hermes from probing-down to
Expand Down
16 changes: 15 additions & 1 deletion hermes_cli/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ def _xai_curated_models() -> list[str]:
"gemini-3.5-flash",
],
"zai": [
"glm-5.2",
"glm-5.1",
"glm-5",
"glm-5v-turbo",
Expand All @@ -280,6 +281,7 @@ def _xai_curated_models() -> list[str]:
"openai/gpt-oss-120b",
],
"kimi-coding": [
"kimi-k2.7-code",
"kimi-k2.6",
"kimi-k2.5",
"kimi-for-coding",
Expand Down Expand Up @@ -2330,7 +2332,19 @@ def provider_model_ids(provider: Optional[str], *, force_refresh: bool = False)
if api_key:
live = _p.fetch_models(api_key=api_key)
if live:
return live
# Merge curated entries with live results so models that
# are reachable for inference before they appear in
# /v1/models survive the live fetch (same pattern as the
# Anthropic path above). Curated go first to preserve the
# recommended ordering in the /model picker.
curated = list(_PROVIDER_MODELS.get(normalized, []))
merged = list(curated)
merged_lower = {m.lower() for m in curated}
for m in live:
if m.lower() not in merged_lower:
merged.append(m)
merged_lower.add(m.lower())
return merged
# Use profile's fallback_models if defined
if _p.fallback_models:
return list(_p.fallback_models)
Expand Down