feat(custom-endpoint): support Anthropic Messages protocol for custom endpoints - #17391
Closed
JanCong wants to merge 1 commit into
Closed
feat(custom-endpoint): support Anthropic Messages protocol for custom endpoints#17391JanCong wants to merge 1 commit into
JanCong wants to merge 1 commit into
Conversation
… endpoints The custom endpoint setup wizard only supported OpenAI-compatible endpoints. Users who needed Anthropic Messages protocol (e.g. MiniMax, LiteLLM proxies, custom gateways) had to manually edit config.yaml. Changes: - Add API protocol selection step in `hermes model` custom endpoint setup (auto-detects from URL, falls back to manual choice) - Persist `api_mode` in `custom_providers` config entries - Read `api_mode` from custom_providers in `resolve_custom_provider()` instead of hardcoding `openai_chat` transport - Generalize `/v1` stripping for Anthropic protocol to all providers (previously only applied to OpenCode); the Anthropic SDK appends `/v1/messages` automatically, so a base_url ending in `/v1` would produce `.../v1/v1/messages` (404) Closes NousResearch#12137, closes NousResearch#6209 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
|
Closing as superseded by #25068. Triage notes (high confidence): Thanks for the contribution — the underlying problem this PR addresses has been resolved by the linked PR on current main. If you believe this was closed in error, please comment and we'll reopen. (Bulk-closed during a CLI PR triage sweep.) |
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.
Summary
hermes modelcustom endpoint setup wizard, with auto-detection from URL patterns (e.g./anthropicsuffix)api_modeincustom_providersconfig entries so the protocol choice survives across sessionsapi_modefromcustom_providersinresolve_custom_provider()instead of hardcodingopenai_chattransport/v1auto-stripping for Anthropic protocol to all providers (previously only applied to OpenCode) — the Anthropic SDK appends/v1/messagesautomatically, so a base_url ending in/v1would produce.../v1/v1/messages(HTTP 404)Motivation
The custom endpoint setup wizard only offered "OpenAI-compatible" endpoints. Users who needed the Anthropic Messages protocol (e.g. MiniMax
/anthropic, LiteLLM proxies, custom gateways) had to manually editconfig.yamlto addapi_mode: anthropic_messages. This PR makes that a first-class option in the interactive setup flow.Closes #12137, closes #6209
Test plan
hermes model→ Custom endpoint → enter an Anthropic-protocol URL (e.g.https://api.minimaxi.com/anthropic) → verify auto-detection prompts "Anthropic Messages"hermes model→ Custom endpoint → enter a plain URL → verify manual protocol selection appears/v1-suffixed URL → verify/v1is auto-stripped with a note printed~/.hermes/config.yaml→custom_providersentry hasapi_mode: anthropic_messagesmodel.api_modeis correctly set in config/modelin-chat switch to a custom Anthropic endpoint → verify no/v1/v1/messages404🤖 Generated with Claude Code