Skip to content

fix(runtime_provider): resolve named providers from config.yaml providers: dict (v12+)#5956

Closed
mfgering wants to merge 4 commits into
NousResearch:mainfrom
mfgering:fix/runtime-provider-providers-dict
Closed

fix(runtime_provider): resolve named providers from config.yaml providers: dict (v12+)#5956
mfgering wants to merge 4 commits into
NousResearch:mainfrom
mfgering:fix/runtime-provider-providers-dict

Conversation

@mfgering

@mfgering mfgering commented Apr 7, 2026

Copy link
Copy Markdown

Problem

_get_named_custom_provider() in hermes_cli/runtime_provider.py only reads the legacy custom_providers list format. Since config v12, the migration in _run_migration() moves all custom provider entries to a providers: dict with a different field schema (api instead of base_url, transport instead of api_mode).

This meant any named local provider (e.g. llama-server, lmstudio) configured via the v12 providers: dict was silently unresolvable — the only workaround was to hardcode it as an alias in auth.py _PROVIDER_ALIASES.

Fix

Check the providers: dict first in _get_named_custom_provider(), matching on both the dict key and the optional name display field. Supports both field naming conventions (api/base_url and transport/api_mode). Falls through to the legacy custom_providers list for backward compatibility.

Both bare name (llama-server) and explicit menu key (custom:llama-server) forms resolve correctly.

Example config.yaml

providers:
  llama-server:
    api: http://localhost:8088/v1
    name: llama-server
    transport: chat_completions

With this fix, --provider llama-server or provider: llama-server in a cron job now resolves without needing a hardcoded alias.

… dict (v12+)

_get_named_custom_provider() previously only read the legacy
custom_providers list format. Since config v12, providers are stored
as a dict under the 'providers:' key (with 'api' for URL and
'transport' for api_mode). This meant named local providers like
llama-server could only be resolved by hardcoding them as aliases in
auth.py.

Now _get_named_custom_provider() first checks the providers: dict,
matching on the dict key or the optional display name field. Falls
through to the legacy list for backward compatibility.

Reverts the llama-server/llama_server aliases from auth.py — they are
no longer needed since the provider entry in config.yaml handles it.
…ders: dict (v12+)

_get_named_custom_provider() only read the legacy custom_providers list.
Since config v12, providers are stored as a dict under the 'providers:'
key (migrated by _run_migration()). Local endpoints configured there
(e.g. llama-server, lmstudio) were silently unresolvable without adding
them as hardcoded aliases in auth.py _PROVIDER_ALIASES.

Fix: check the providers: dict first (matching on dict key or display
name, supporting both 'api'/'base_url' and 'transport'/'api_mode' field
names), then fall through to the legacy list for backward compatibility.

Both bare name ('llama-server') and explicit menu key ('custom:llama-server')
forms now resolve correctly from config.
@blasai1739217-cmyk

Copy link
Copy Markdown

Friendly bump on this PR in case it fell through the cracks \u2014 would love a review when someone has a minute. Thanks!

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the report and the fix, @mfgering! This exact bug — _get_named_custom_provider() not checking the providers: dict — was independently caught and resolved on main.

Automated hermes-sweeper review

  • The providers: dict lookup you describe is already present in hermes_cli/runtime_provider.py at lines 351–398, added in commit 76eecf381 (fix(model): Support providers: dict for custom endpoints in /model).
  • That commit shipped in release v2026.4.13 (April 13, 2026).
  • The landed implementation also supports the url field alias and key_env resolution, so it covers the same cases your PR targets.

Closing as already implemented on main.

@teknium1 teknium1 closed this Apr 27, 2026
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cli CLI entry point, hermes_cli/, setup wizard area/config Config system, migrations, profiles labels Apr 30, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related to merged #17901 which fixes the transport field issue. This PR goes further to also resolve the named provider lookup itself from the v12+ providers: dict.

@alt-glitch

Copy link
Copy Markdown
Collaborator

Related to merged #17901 which fixes transport field. This PR resolves the broader named provider lookup from v12+ providers: dict.

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.

5 participants