hermes - 💡(How to fix) Fix Make `providers` the single source of truth for model registry [1 participants]

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…
GitHub stats
NousResearch/hermes-agent#16622Fetched 2026-04-28 06:52:09
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×4

Code Example

providers:
  deepseek:
    api_key_env: DEEPSEEK_API_KEY
    base_url: DEEPSEEK_BASE_URL
    models:
      deepseek-v4-pro:
        name: deepseek-v4-pro
        provider: deepseek
      deepseek-v4-flash:
        name: deepseek-v4-flash
        provider: deepseek
RAW_BUFFERClick to expand / collapse

Problem

hermes model and /model tab completion use completely different data sources, creating a fragmented UX:

StepCurrent behaviorExpected behavior
hermes modelWrites model.default (single value, overwrites)Should append to providers.<slug>.models (list, cumulative)
/model tabReads hardcoded MODEL_ALIASES + external models.dev catalogShould read from providers in config.yaml
Model switchingOverwrites model.default, previously selected models "disappear"model.default points into providers, nothing is lost

Details

  1. _save_model_choice() (hermes_cli/auth.py:3815) only writes config["model"]["default"] = model_id. It never touches the providers section.

  2. _model_flow_api_key_provider() (hermes_cli/main.py:4489-4501) only writes model["provider"] and model["base_url"]. Again, providers is never updated.

  3. Tab completion reads from MODEL_ALIASES (hardcoded dict in hermes_cli/model_switch.py:105-154) and falls back to models.dev catalog. It does not read the user's providers config at all.

  4. The providers section in config.yaml (which supports api_key_env, base_url, models) is effectively a second-class citizen — only useful if manually edited.

Proposed Solution

Make providers the single source of truth for model registry:

1. hermes model should write to providers

When a user selects a model through hermes model:

  • API key → .env (already works ✅)
  • Base URL → .env (already works ✅)
  • Model entry → providers.<slug>.models (new — currently only writes model.default)

Example result after running hermes model twice for the same provider:

providers:
  deepseek:
    api_key_env: DEEPSEEK_API_KEY
    base_url: DEEPSEEK_BASE_URL
    models:
      deepseek-v4-pro:
        name: deepseek-v4-pro
        provider: deepseek
      deepseek-v4-flash:
        name: deepseek-v4-flash
        provider: deepseek

2. /model tab completion should read from providers

Tab completion should list all models from providers in config.yaml first, then fall back to catalog/aliases for models not yet configured.

3. Keep MODEL_ALIASES as fallback only

The hardcoded aliases are still useful for first-time setup or providers not yet in config.yaml. They should serve as suggestions, not the primary data source.

Benefits

  • Unified mental model: "models in providers are what I can use"
  • No lost models: previously selected models accumulate in providers, not overwritten
  • Config portability: providers + .env fully describes all available models
  • Minimal code change: mainly _save_model_choice() and tab completion data source

Affected Files

  • hermes_cli/auth.py_save_model_choice() should also update providers
  • hermes_cli/main.py_model_flow_api_key_provider() post-save logic
  • hermes_cli/model_switch.py — tab completion should read providers first
  • hermes_cli/model_switch.pyMODEL_ALIASES becomes fallback, not primary

extent analysis

TL;DR

Update _save_model_choice() to append the selected model to providers.<slug>.models instead of overwriting model.default.

Guidance

  • Modify _save_model_choice() in hermes_cli/auth.py to update the providers section in config.yaml by appending the selected model to the list of models for the corresponding provider.
  • Update tab completion in hermes_cli/model_switch.py to read models from providers in config.yaml first, and then fall back to MODEL_ALIASES and the external models.dev catalog.
  • Review the changes to _model_flow_api_key_provider() in hermes_cli/main.py to ensure it correctly updates the providers section after saving the model choice.
  • Verify that the updated code correctly accumulates models in providers without overwriting previously selected models.

Example

# In _save_model_choice(), update providers instead of model.default
config["providers"][provider_slug]["models"].append(model_id)

Notes

The proposed solution aims to make providers the single source of truth for model registry, which should unify the mental model and prevent lost models. However, the implementation details may vary depending on the specific requirements and constraints of the project.

Recommendation

Apply the proposed workaround by updating _save_model_choice() and tab completion to use providers as the primary data source, as it provides a unified mental model and prevents lost models.

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 Make `providers` the single source of truth for model registry [1 participants]