hermes - 💡(How to fix) Fix Bug: /model picker skips live model fetch for all api_key providers (Nvidia, StepFun, GMI, Zai, etc.) [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

list_authenticated_providers() in hermes_cli/model_switch.py uses a hardcoded curated list (_PROVIDER_MODELS) for most providers instead of calling provider_model_ids(), which performs live discovery via the provider's /v1/models endpoint.

The infrastructure for live model discovery already exists and worksprovider_model_ids()ProviderProfile.fetch_models() successfully returns 136 models from https://integrate.api.nvidia.com/v1/models. But the gateway /model picker never invokes it for non-Copilot providers.

Root Cause

In list_authenticated_providers() at lines 1345-1361 of hermes_cli/model_switch.py:

if hermes_slug in {"copilot", "copilot-acp"}:
    model_ids = provider_model_ids(hermes_slug)  # ✓ live fetch
elif overlay.auth_type == "aws_sdk":
    # bedrock special case
else:
    model_ids = curated.get(hermes_slug, []) or curated.get(pid, [])  # ✗ hardcoded list

The else branch should call provider_model_ids() for all providers. The function already has the full fallback chain built in (lines 1942-2094 of hermes_cli/models.py):

  1. Live API fetch via ProviderProfile (line 2082: _p.fetch_models(api_key=api_key))
  2. Fallback to ProviderProfile.fallback_models (line 2086)
  3. Fallback to _PROVIDER_MODELS (line 2091)
  4. models.dev merge for preferred providers (line 2092)

The function is production-ready — it's just never called from the picker codepath.

Fix Action

Fixed

Code Example

if hermes_slug in {"copilot", "copilot-acp"}:
    model_ids = provider_model_ids(hermes_slug)  # ✓ live fetch
elif overlay.auth_type == "aws_sdk":
    # bedrock special case
else:
    model_ids = curated.get(hermes_slug, []) or curated.get(pid, [])  # ✗ hardcoded list

---

else:
-            model_ids = curated.get(hermes_slug, []) or curated.get(pid, [])
+            model_ids = provider_model_ids(hermes_slug)
-            # Merge with models.dev for preferred providers (same rationale as above).
-            if hermes_slug in _MODELS_DEV_PREFERRED:
-                model_ids = _merge_with_models_dev(hermes_slug, model_ids)
RAW_BUFFERClick to expand / collapse

Summary

list_authenticated_providers() in hermes_cli/model_switch.py uses a hardcoded curated list (_PROVIDER_MODELS) for most providers instead of calling provider_model_ids(), which performs live discovery via the provider's /v1/models endpoint.

The infrastructure for live model discovery already exists and worksprovider_model_ids()ProviderProfile.fetch_models() successfully returns 136 models from https://integrate.api.nvidia.com/v1/models. But the gateway /model picker never invokes it for non-Copilot providers.

Affected providers

This affects every api_key provider that exposes a /v1/models endpoint and is not copilot or copilot-acp:

  • nvidia — 136 models available via API, picker shows 9 curated
  • stepfun — has live fetch in provider_model_ids() but picker skips it
  • gmi — same
  • zai — same
  • Any new provider added via ProviderProfile — automatically broken

Root cause

In list_authenticated_providers() at lines 1345-1361 of hermes_cli/model_switch.py:

if hermes_slug in {"copilot", "copilot-acp"}:
    model_ids = provider_model_ids(hermes_slug)  # ✓ live fetch
elif overlay.auth_type == "aws_sdk":
    # bedrock special case
else:
    model_ids = curated.get(hermes_slug, []) or curated.get(pid, [])  # ✗ hardcoded list

The else branch should call provider_model_ids() for all providers. The function already has the full fallback chain built in (lines 1942-2094 of hermes_cli/models.py):

  1. Live API fetch via ProviderProfile (line 2082: _p.fetch_models(api_key=api_key))
  2. Fallback to ProviderProfile.fallback_models (line 2086)
  3. Fallback to _PROVIDER_MODELS (line 2091)
  4. models.dev merge for preferred providers (line 2092)

The function is production-ready — it's just never called from the picker codepath.

Proposed fix

        else:
-            model_ids = curated.get(hermes_slug, []) or curated.get(pid, [])
+            model_ids = provider_model_ids(hermes_slug)
-            # Merge with models.dev for preferred providers (same rationale as above).
-            if hermes_slug in _MODELS_DEV_PREFERRED:
-                model_ids = _merge_with_models_dev(hermes_slug, model_ids)

The models.dev merge is already handled inside provider_model_ids(), so those two lines become redundant.

Verification

Tested live: curl https://integrate.api.nvidia.com/v1/models with a valid NVIDIA_API_KEY returns 136 models. provider_model_ids("nvidia") successfully calls _p.fetch_models() and returns all 136. The picker just never invokes it.

Related

  • #16699 — same bug pattern for xAI, closed after specific fix to _PROVIDER_MODELS
  • #22990 — same bug pattern for Copilot, still open
  • #23359 — tracking issue for broader provider/model inventory problems

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING