fix(models): pass model.base_url to fetch_models in /model picker

The /model interactive picker resolved a base_url from user credentials
but never passed it to ProviderProfile.fetch_models(), causing the
picker to always query the provider's hardcoded default endpoint
instead of the user's custom URL (e.g. a company litellm proxy).

- providers/base.py: add optional base_url parameter to fetch_models()
- hermes_cli/models.py: pass resolved base_url to fetch_models()
- Update all subclass overrides for signature compatibility
- Add 6 regression tests covering override, fallback, and integration
This commit is contained in:
liuhao1024
2026-06-16 13:09:40 -07:00
committed by Teknium
parent 9137b86a52
commit 1b962f001e
8 changed files with 155 additions and 7 deletions
+1 -1
View File
@@ -2371,7 +2371,7 @@ def provider_model_ids(provider: Optional[str], *, force_refresh: bool = False)
if not base_url:
base_url = _p.base_url
if api_key:
live = _p.fetch_models(api_key=api_key)
live = _p.fetch_models(api_key=api_key, base_url=base_url or None)
if live:
# Merge static curated list with live API results so
# models that the live endpoint omits (stale cache,