fix(model_switch): live model discovery for custom_providers in /model picker#19072
Closed
0oAstro wants to merge 1 commit into
Closed
fix(model_switch): live model discovery for custom_providers in /model picker#190720oAstro wants to merge 1 commit into
0oAstro wants to merge 1 commit into
Conversation
…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.
145bf4a to
6df7314
Compare
Contributor
Author
|
removed the unnecessary formatting edits caused by ruff. |
This was referenced May 6, 2026
19 tasks
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #19071
Problem
custom_providersentries inconfig.yamlonly showed the statically-configuredmodels:dict in the/modelpicker, ignoring the live/v1/modelsendpoint. 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 staticmodels:dict. Section 3 (userproviders:entries) already had live discovery viafetch_api_models()— this PR adds the same pattern to section 4.Changes
hermes_cli/model_switch.py: Added live model discovery forcustom_providersentries withapi_key+base_url, matching section 3 behavior.tests/hermes_cli/test_model_switch_custom_providers.py: Addedtest_custom_providers_uses_live_models_for_multi_model_endpointto verify the live list replaces the static subset.Testing