From 6f50c26b2a0254275e8f79a30e8c950cece81ed5 Mon Sep 17 00:00:00 2001 From: lemassykoi <16377344+lemassykoi@users.noreply.github.com> Date: Sat, 16 May 2026 23:02:46 -0700 Subject: [PATCH] fix(model-switch): probe /models for custom providers without api_key The Telegram/Discord model picker skipped live model discovery for custom providers (llama.cpp, Ollama) unless an api_key was configured. Local providers typically don't require auth on the /models endpoint. The CLI always probes /models, so this brings the gateway picker into parity. Change: `if api_url and api_key:` -> `if api_url:` --- hermes_cli/model_switch.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hermes_cli/model_switch.py b/hermes_cli/model_switch.py index fec1f33d092..a5d299165fc 100644 --- a/hermes_cli/model_switch.py +++ b/hermes_cli/model_switch.py @@ -1688,7 +1688,11 @@ def list_authenticated_providers( continue # Live model discovery from custom provider endpoints (matches # Section 3 behavior for user ``providers:`` entries). - if api_url and api_key: + # Also probes when no api_key is set (e.g. local llama.cpp / + # Ollama servers) — the /models endpoint often works without + # auth. The CLI's _model_flow_named_custom always probes, so + # the Telegram/Discord picker should do the same for parity. + if api_url: try: from hermes_cli.models import fetch_api_models