mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-29 06:31:32 +00:00
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:`
This commit is contained in:
parent
8bf09455dc
commit
6f50c26b2a
1 changed files with 5 additions and 1 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue