From 34d2a332ef82dea66503fa5ad2c45d799a31d0c0 Mon Sep 17 00:00:00 2001 From: Teknium Date: Wed, 15 Apr 2026 03:49:16 -0700 Subject: [PATCH] fix(models): use curated list for Nous in provider_model_ids() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit provider_model_ids('nous') was calling fetch_nous_models() which returns the FULL live Nous API catalog (382 models including image generators, rerankers, and non-agentic models). This caused the /model picker fallback to dump hundreds of models into the list, making it unusable. PR #10146 fixed the /model picker to prefer the curated list first, but the fallback still called provider_model_ids() which returned 382 models. On WSL2 environments where stale .pyc caches prevented the #10146 fix from taking effect, users saw the full catalog. Fix: Return the curated _PROVIDER_MODELS['nous'] list (29 models) directly, matching the pattern used by hermes model, the gateway picker, and the OpenRouter flow (which also uses curated lists cross-referenced against the live API rather than raw live data). Before: provider_model_ids('nous') → 382 models (live API) After: provider_model_ids('nous') → 29 models (curated) --- hermes_cli/models.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/hermes_cli/models.py b/hermes_cli/models.py index 18f29c6cd3..3dba3acdf0 100644 --- a/hermes_cli/models.py +++ b/hermes_cli/models.py @@ -1237,16 +1237,12 @@ def provider_model_ids(provider: Optional[str], *, force_refresh: bool = False) if normalized == "copilot-acp": return list(_PROVIDER_MODELS.get("copilot", [])) if normalized == "nous": - # Try live Nous Portal /models endpoint - try: - from hermes_cli.auth import fetch_nous_models, resolve_nous_runtime_credentials - creds = resolve_nous_runtime_credentials() - if creds: - live = fetch_nous_models(api_key=creds.get("api_key", ""), inference_base_url=creds.get("base_url", "")) - if live: - return live - except Exception: - pass + # Use curated list — the live /models endpoint returns 300+ models + # (including non-agentic ones like image generators and rerankers). + # The curated list matches the `hermes model` and gateway pickers. + curated = _PROVIDER_MODELS.get("nous", []) + if curated: + return list(curated) if normalized == "anthropic": live = _fetch_anthropic_models() if live: