Skip to content

fix(model_switch): live model discovery for custom_providers in /model picker#19072

Closed
0oAstro wants to merge 1 commit into
NousResearch:mainfrom
0oAstro:fix/custom-providers-live-models
Closed

fix(model_switch): live model discovery for custom_providers in /model picker#19072
0oAstro wants to merge 1 commit into
NousResearch:mainfrom
0oAstro:fix/custom-providers-live-models

Conversation

@0oAstro

@0oAstro 0oAstro commented May 3, 2026

Copy link
Copy Markdown
Contributor

Closes #19071

Problem

custom_providers entries in config.yaml only showed the statically-configured models: dict in the /model picker, ignoring the live /v1/models endpoint. Gateways like Bifrost that expose hundreds of models were limited to whatever handful the user had explicitly listed.

Root cause

list_authenticated_providers() section 4 (custom_providers processing) only read the static models: dict. Section 3 (user providers: entries) already had live discovery via fetch_api_models() — this PR adds the same pattern to section 4.

Changes

  • hermes_cli/model_switch.py: Added live model discovery for custom_providers entries with api_key + base_url, matching section 3 behavior.
  • tests/hermes_cli/test_model_switch_custom_providers.py: Added test_custom_providers_uses_live_models_for_multi_model_endpoint to verify the live list replaces the static subset.

Testing

# All model_switch tests pass
pytest tests/hermes_cli/test_model_switch_custom_providers.py \
       tests/hermes_cli/test_custom_provider_model_switch.py \
       tests/hermes_cli/test_user_providers_model_switch.py \
       tests/hermes_cli/test_apply_model_switch_result_context.py \
       tests/hermes_cli/test_model_switch_context_display.py
# 68 passed

…l picker

custom_providers entries (section 4 of list_authenticated_providers) only
read the static models: dict from config.yaml, ignoring the live /v1/models
endpoint.  This means gateways like Bifrost that expose hundreds of models
only show the handful explicitly listed in config.

Add live discovery via fetch_api_models() for custom_providers entries
that have api_key + base_url, matching the existing behavior for user
providers: entries (section 3).  When the endpoint is reachable and
returns models, the live list replaces the static subset.

Fixes: /model picker showing only 9 models from a Bifrost gateway that
actually exposes 581.
@0oAstro 0oAstro force-pushed the fix/custom-providers-live-models branch from 145bf4a to 6df7314 Compare May 3, 2026 04:25
@0oAstro

0oAstro commented May 3, 2026

Copy link
Copy Markdown
Contributor Author

removed the unnecessary formatting edits caused by ruff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

custom_providers: /model picker ignores live /v1/models endpoint, shows stale static subset

2 participants