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
+3 -2
View File
@@ -43,12 +43,13 @@ class CustomProfile(ProviderProfile):
self,
*,
api_key: str | None = None,
base_url: str | None = None,
timeout: float = 8.0,
) -> list[str] | None:
"""Custom/Ollama: base_url is user-configured; fetch if set."""
if not self.base_url:
if not (base_url or self.base_url):
return None
return super().fetch_models(api_key=api_key, timeout=timeout)
return super().fetch_models(api_key=api_key, base_url=base_url, timeout=timeout)
custom = CustomProfile(