Skip to content

fix: live model discovery for custom providers in /model picker#20763

Closed
hamletmachine wants to merge 1 commit into
NousResearch:mainfrom
hamletmachine:fix/custom-provider-model-picker-v2
Closed

fix: live model discovery for custom providers in /model picker#20763
hamletmachine wants to merge 1 commit into
NousResearch:mainfrom
hamletmachine:fix/custom-provider-model-picker-v2

Conversation

@hamletmachine

Copy link
Copy Markdown

Problem

list_authenticated_providers() Section 4 (custom_providers) only reads the static model: and models: fields from config.yaml when building the model list for the /model picker. Any custom provider hosting multiple models on its /v1/models endpoint shows only the single model configured under the model: field.

Section 3 (user-defined providers: entries) already fetches the live model list via fetch_api_models(). This PR adds the same behavior to Section 4.

Changes

  • Store api_key in the group dict so the fetch call can access it
  • Add live /v1/models discovery for custom provider endpoints when api_url and api_key are configured
  • Merge live model list with any statically configured models
  • Graceful fallback to static config list on any error (network, auth, timeout)

Fix for

Closes #20582

Provider-agnostic

Works for any OpenAI-compatible endpoint that exposes /v1/models. No provider-specific code.

Section 4 of list_authenticated_providers() builds the model list for
custom_providers entries from the static model: and models: config fields
only. This means any custom provider endpoint with multiple models on its
/v1/models API shows only the single model configured under the model:
field.

Section 3 already fetches the live /v1/models list for providers: entries
(via fetch_api_models). Add the same live model discovery for
custom_providers: entries so the interactive /model picker shows all
models the endpoint exposes.

- Store api_key in the group dict so the fetch call can access it
- Call fetch_api_models() when api_url and api_key are configured
- Merge live models with any statically configured models
- Graceful fallback to static config on any error (network, auth, timeout)

Closes NousResearch#20582
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard labels May 6, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #19072 which implements the same fix (live /v1/models discovery for custom_providers section). Both target #20582/#19071.

@teknium1

Copy link
Copy Markdown
Contributor

Closing as already fixed on main.

Triage notes (high confidence):
Main hermes_cli/model_switch.py:1688-1718 already performs live model discovery via fetch_api_models for grouped custom providers (Section 4), with richer policy than PR's smaller patch.

If you still see this on the latest version, please reopen with reproduction steps.

(Bulk-closed during a CLI triage sweep.)

@teknium1 teknium1 closed this May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Model picker only shows one model for custom providers

3 participants