fix(cli): show custom providers in /provider and support auto-matching#2580
Closed
francip wants to merge 2 commits into
Closed
fix(cli): show custom providers in /provider and support auto-matching#2580francip wants to merge 2 commits into
francip wants to merge 2 commits into
Conversation
Closed
8 tasks
c1a32ea to
8e0f729
Compare
8bd0529 to
4edb708
Compare
e1c396b to
831083b
Compare
5fbcf9b to
a87d730
Compare
a87d730 to
2386496
Compare
…atching Custom providers defined in config.yaml custom_providers were not displayed in /model output, and there was no way to switch to them via /model syntax. - Display named custom providers with their configured models in /model - Support /model provider-name (auto-selects sole model) - Support /model provider-name:model-name (explicit selection) - Support /model model-name (auto-detects owning custom provider) - Refuse ambiguous matches when model exists in multiple custom providers - Fix _get_custom_base_url() leaking non-custom provider URLs into [custom] - Fix named custom providers reporting provider as "openrouter" at runtime - Fix pre-existing test expecting OpenRouter slug remap for catalog model
Port the custom provider display logic from cli.py to the gateway /provider command so named custom providers list their models. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2386496 to
f0831c8
Compare
Contributor
Author
|
Closing — both commits target /model and /provider slash commands, which were removed in upstream commits 9783c9d (#3080) and b2e124d (#15047). Custom-provider display surface no longer exists in this form. If custom providers need the same fix in the new model/provider UX, will reopen as a fresh PR. |
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.
Note: This PR was authored and tested by Avery — a Hermes agent, with guidance from @francip.
What Changed
Custom providers defined in
config.yamlcustom_providerswere not displayed in/modeloutput, and there was no way to switch to them via/modelsyntax. Additionally, the generic[custom]entry was falsely showing as authenticated using the active provider's base_url. The gateway/providercommand had the same gap — custom providers appeared as flat lines with no model listing.Files:
cli.py,hermes_cli/models.py,hermes_cli/runtime_provider.py,gateway/run.py,tests/test_cli_model_command.py,tests/test_runtime_provider_resolution.pyChanges
/modeloutput with their configured model names/provider(gateway) output with their model names_get_custom_base_url()no longer leaks non-custom provider URLs into the generic[custom]display"openrouter"/modelinput:/model sparky-qwen-35b— bare provider name auto-selects sole model/model sparky-qwen-35b:model-name— explicit provider:model selection/model model-name— finds which custom provider owns the modelWhy
Users who configure custom providers (local vLLM servers, custom endpoints) had no way to see or switch to them from
/modelor/provider. The only path was the interactive setup menu inhermes setup. The generic[custom]entry also falsely appeared as authenticated by reading the active provider's (e.g. zai) base_url.Screenshots
Before —
/modelonly shows generic[custom]with wrong endpoint:After —
/modelshows each named custom provider with its models:How to Test
Add custom providers to
~/.hermes/config.yaml:Then test each switching method:
Validation
Automated:
source venv/bin/activate python -m pytest tests/test_cli_model_command.py tests/test_runtime_provider_resolution.py tests/hermes_cli/test_models.py -vResult:
60 passed(1 pre-existing flaky xdist test intermittently fails on main too)Manual:
/model/provider(gateway)[custom]no longer shows non-custom provider URLsPlatforms Tested
✅ macOS CLI
Backward Compatibility
✅ Backward compatible
[custom]endpoint still works for users who configure it directlycustom_providersis configured