hermes - 💡(How to fix) Fix [Feature]: Dynamic Model Discovery and Filtering for Built-in Providers

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

  1. Using providers: (Keyed schema): The entry is silently ignored because the linear loading logic in list_authenticated_providers identifies the slug as already "seen" (due to the built-in provider), causing the user's custom model list to be skipped entirely.
  2. Using custom_providers: (List schema): Due to the custom: prefix added by custom_provider_slug, the deduplication check is bypassed. This results in duplicate entries in the /model picker (e.g., one "NVIDIA" with curated models and one "Nvidia" with user models), which is confusing and cluttered.

Code Example

providers:
  nvidia:
    filter_models: ["nemotron-4-reasoning", "llama-3.3"] # Only these models from live API will be added to the picker

---
RAW_BUFFERClick to expand / collapse

Problem or Use Case

Currently, the /model picker relies on a hardcoded curated list (hermes_cli/models.py) for built-in providers (e.g., NVIDIA NIM、Gemini/Google AI Studio/Openrouter). This creates a significant limitation for users who wish to use models offered by the provider that are not included in the static curated list.

The current architecture makes it nearly impossible to extend built-in providers via config.yaml without compromising UX:

  1. Using providers: (Keyed schema): The entry is silently ignored because the linear loading logic in list_authenticated_providers identifies the slug as already "seen" (due to the built-in provider), causing the user's custom model list to be skipped entirely.
  2. Using custom_providers: (List schema): Due to the custom: prefix added by custom_provider_slug, the deduplication check is bypassed. This results in duplicate entries in the /model picker (e.g., one "NVIDIA" with curated models and one "Nvidia" with user models), which is confusing and cluttered.

As seen in the context of Issue #9545 and PR #10599, the current "fix" for deduplication only addresses the symptoms (preventing triple entries) but does not solve the fundamental problem: built-in providers are immutable and cannot be extended by the user via configuration.

Proposed Solution

Implement a dynamic model discovery and filtering mechanism for built-in providers.

Instead of relying solely on a hardcoded list, the agent should:

  1. Dynamic Fetching: Upon successful API key authentication, the agent should optionally query the provider's /v1/models endpoint to retrieve the real-time list of available models.
  2. User-Defined Filtering: Allow users to define a filter (e.g., regex or a list of keywords) in config.yaml for a built-in provider.
  3. Merged Model List: The /model picker should merge the curated list with the models that pass the user's filter from the live API response.

Example config entry for NVIDIA:

providers:
  nvidia:
    filter_models: ["nemotron-4-reasoning", "llama-3.3"] # Only these models from live API will be added to the picker

This approach would allow users to seamlessly integrate new models into the same provider category in the la /model picker, maintaining a clean UI and providing flexibility.

Alternatives Considered

• Adding models manually via custom_providers:: This leads to the "Duplicate Provider" problem analyzed in PR #10599, requiring users to give the provider an alias (e.g., nvidia-custom), which is a poor UX. • Hardcoding more models in models.py: This is unsustainable for maintainers and cannot keep up with the rapid release cycle of new models. • Updating list_authenticated_providers to merge results: While possible, it would require a significant refactor of the logic to allow "upward" modification of results that have already been appended to the list.

The proposed solution is better because it shifts the focus from static curated lists to dynamic discovery, which is more aligned with how modern LLM APIs are designed.

Feature Type

Configuration option

Scope

None

Contribution

  • I'd like to implement this myself and submit a PR

Debug Report (optional)

extent analysis

TL;DR

Implement a dynamic model discovery and filtering mechanism for built-in providers to allow users to extend the model list via configuration.

Guidance

  • Identify the hardcoded list in hermes_cli/models.py and consider replacing it with a dynamic fetching mechanism that queries the provider's API endpoint.
  • Introduce a user-defined filtering system in config.yaml to allow users to specify which models to include from the live API response.
  • Merge the curated list with the filtered models from the API response to display a unified list in the /model picker.
  • Consider updating the list_authenticated_providers logic to accommodate the dynamic model discovery and filtering mechanism.

Example

providers:
  nvidia:
    filter_models: ["nemotron-4-reasoning", "llama-3.3"]

This example shows how a user can define a filter for the NVIDIA provider to include specific models in the /model picker.

Notes

The proposed solution requires significant changes to the existing architecture, and careful consideration should be given to the implementation details to ensure a seamless user experience.

Recommendation

Apply the proposed workaround by implementing a dynamic model discovery and filtering mechanism, as it provides a more flexible and scalable solution for users to extend the model list.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix [Feature]: Dynamic Model Discovery and Filtering for Built-in Providers