Skip to content

feat: add api_mode selection to custom endpoint setup#6210

Closed
chinaboard wants to merge 1 commit into
NousResearch:mainfrom
chinaboard:feat/custom-provider-api-mode-selection
Closed

feat: add api_mode selection to custom endpoint setup#6210
chinaboard wants to merge 1 commit into
NousResearch:mainfrom
chinaboard:feat/custom-provider-api-mode-selection

Conversation

@chinaboard

Copy link
Copy Markdown

Summary

Adds an API protocol (api_mode) selection step to the custom endpoint setup flow. Closes #6209.

Problem

Custom endpoint setup collects URL, API key, model, and context length — but never asks which API protocol to use. Auto-detection works for most URLs, but breaks with proxies/gateways that serve multiple protocols on the same URL, or endpoints where the URL gives no hints about the protocol.

Solution

Add a lightweight prompt after the context-length step:

API protocol [chat_completions] (Enter to accept, ? to choose):
  • Enter → accept auto-detected default (zero friction for 90% of users)
  • ? → show menu with all options:
    1. OpenAI Chat Completions
    2. Anthropic Messages
    3. OpenAI Responses (Codex)
    4. Auto-detect from URL

Changes

Function Change
_prompt_api_mode_selection() New helper — Enter-to-accept UX with ? to expand choices
_model_flow_custom() Prompt for api_mode; save to config and custom_providers
_model_flow_named_custom() Read saved api_mode from provider; prompt if not saved
_save_custom_provider() Accept and persist api_mode parameter
_custom_provider_map Include api_mode field from custom_providers entries

Testing

  • Syntax verified (ast.parse)
  • All referenced functions exist (_detect_api_mode_for_url in runtime_provider.py, _curses_prompt_choice in setup.py)
  • No changes to auto-detection logic — only adds an explicit override path

When configuring a custom endpoint, prompt the user to choose the API
protocol (chat_completions, anthropic_messages, codex_responses, or
auto-detect). Default is Enter-to-accept auto-detection; type '?' to
see all options.

Changes:
- Add _prompt_api_mode_selection() helper with Enter-to-accept UX
- _model_flow_custom(): prompt for api_mode after context length
- _model_flow_named_custom(): read/apply saved api_mode from provider
- _save_custom_provider(): persist api_mode in custom_providers entries
- _custom_provider_map: include api_mode field

Closes NousResearch#6209
@chinaboard chinaboard force-pushed the feat/custom-provider-api-mode-selection branch from bd7237a to 8719cc4 Compare April 9, 2026 03:00
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard area/config Config system, migrations, profiles labels Apr 30, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Closing as already fixed on main.

Triage notes (high confidence):
api_mode selection already implemented on main via _prompt_custom_api_mode_selection at hermes_cli/main.py:3659 with api_mode stored on model config.

If you still see this on the latest version, please reopen with reproduction steps.

(Bulk-closed during a CLI triage sweep.)

@teknium1 teknium1 closed this May 24, 2026
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 P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Custom endpoint setup should let users choose API protocol (api_mode)

3 participants