From 7ea7331f26b35a35f91950f3cc9a7a2473c48c5a Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 15 Apr 2026 07:42:12 +0000 Subject: [PATCH] fix: show custom_providers models regardless of active provider (#515 #519) When a user has custom_providers configured in config.yaml, their custom models should appear in the model picker even if active_provider is set to a different provider (e.g. openrouter). Previously, the custom provider was always discarded from detected_providers when active_provider != 'custom', making custom models invisible. Fix: only discard 'custom' if there are no custom_providers entries. Co-authored-by: cloudyun888 Co-authored-by: shruggr --- api/config.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/api/config.py b/api/config.py index 55df1af..39101d6 100644 --- a/api/config.py +++ b/api/config.py @@ -949,8 +949,11 @@ def get_available_models() -> dict: # THAT provider, not to a separate "Custom" group. hermes_cli reports # 'custom' as authenticated whenever base_url is set, which would otherwise # build a phantom "Custom" bucket next to the real provider's group. Drop - # it unless the user explicitly chose 'custom' as their active provider. - if active_provider and active_provider != "custom": + # it unless (a) the user explicitly chose 'custom' as their active provider, + # or (b) the user has custom_providers entries in config.yaml (those models + # were already added above and should still be shown). + _has_custom_providers = isinstance(_custom_providers_cfg, list) and len(_custom_providers_cfg) > 0 + if active_provider and active_provider != "custom" and not _has_custom_providers: detected_providers.discard("custom") # 5. Build model groups