From b69022c202b51219b4bb32a076f243759f40c48d Mon Sep 17 00:00:00 2001 From: liuhao1024 Date: Tue, 9 Jun 2026 09:13:53 +0800 Subject: [PATCH] fix(cli): raise model picker cap from 50 to 200 to surface all provider models MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Providers like NVIDIA NIM expose 100+ models but the picker hard-capped at 50 entries via max_models=50 in three call sites. Users could only see the first 50 (alphabetical) models, hiding the rest. Raise the cap to 200 across all picker entry points: - list_authenticated_providers() default: 8 → 200 - list_picker_providers() default: 8 → 200 - build_models_payload() default: 50 → 200 - prewarm_picker_cache_async(): 50 → 200 - web_server /api/model/options: 50 → 200 - web_server build_models_payload: 50 → 200 The total_models field already reports the real count so the UI can show 'showing 200 of N' when a provider has more models. Fixes #42270 --- hermes_cli/inventory.py | 2 +- hermes_cli/model_switch.py | 6 +++--- hermes_cli/web_server.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hermes_cli/inventory.py b/hermes_cli/inventory.py index 48fc4e928d18..d29c1df8b37b 100644 --- a/hermes_cli/inventory.py +++ b/hermes_cli/inventory.py @@ -117,7 +117,7 @@ def build_models_payload( pricing: bool = False, capabilities: bool = False, force_fresh_nous_tier: bool = False, - max_models: int = 50, + max_models: int = 200, ) -> dict: """Build the ``{providers, model, provider}`` shape every consumer needs from a single substrate call. diff --git a/hermes_cli/model_switch.py b/hermes_cli/model_switch.py index 61a58d8754e7..eab7da809d22 100644 --- a/hermes_cli/model_switch.py +++ b/hermes_cli/model_switch.py @@ -1162,7 +1162,7 @@ def _warm() -> None: current_model=ctx.current_model, user_providers=ctx.user_providers, custom_providers=ctx.custom_providers, - max_models=50, + max_models=200, ) except Exception: # Best-effort warmup — never surface errors into the session. @@ -1180,7 +1180,7 @@ def list_authenticated_providers( custom_providers: list | None = None, *, force_fresh_nous_tier: bool = False, - max_models: int = 8, + max_models: int = 200, current_model: str = "", ) -> List[dict]: """Detect which providers have credentials and list their curated models. @@ -1968,7 +1968,7 @@ def list_picker_providers( current_base_url: str = "", user_providers: dict = None, custom_providers: list | None = None, - max_models: int = 8, + max_models: int = 200, current_model: str = "", ) -> List[dict]: """Interactive-picker variant of :func:`list_authenticated_providers`. diff --git a/hermes_cli/web_server.py b/hermes_cli/web_server.py index 2b4034b2ec5e..fb4adb93429b 100644 --- a/hermes_cli/web_server.py +++ b/hermes_cli/web_server.py @@ -2298,7 +2298,7 @@ def get_model_options(): # affordance instead of hiding the provider entirely. return build_models_payload( load_picker_context(), - max_models=50, + max_models=200, include_unconfigured=True, picker_hints=True, canonical_order=True, @@ -2371,7 +2371,7 @@ def get_recommended_default_model(provider: str = ""): try: from hermes_cli.inventory import build_models_payload, load_picker_context - payload = build_models_payload(load_picker_context(), max_models=50) + payload = build_models_payload(load_picker_context(), max_models=200) for row in payload.get("providers", []): if str(row.get("slug", "")).lower() == slug: models = row.get("models") or []