diff --git a/agent/auxiliary_client.py b/agent/auxiliary_client.py index 9c153a74da..264bab3f40 100644 --- a/agent/auxiliary_client.py +++ b/agent/auxiliary_client.py @@ -547,7 +547,7 @@ def resolve_provider_client( Args: provider: Provider identifier. One of: "openrouter", "nous", "openai-codex" (or "codex"), - "zai", "kimi-coding", "minimax", "minimax-cn", "nous-api", + "zai", "kimi-coding", "minimax", "minimax-cn", "custom" (OPENAI_BASE_URL + OPENAI_API_KEY), "auto" (full auto-detection chain). model: Model slug override. If None, uses the provider's default @@ -674,7 +674,7 @@ def resolve_provider_client( return resolve_provider_client("nous", model, async_mode) if provider == "openai-codex": return resolve_provider_client("openai-codex", model, async_mode) - # nous-api is api_key type so it's handled above + # Other OAuth providers not directly supported logger.warning("resolve_provider_client: OAuth provider %s not " "directly supported, try 'auto'", provider) return None, None diff --git a/hermes_cli/auth.py b/hermes_cli/auth.py index c90f779222..05d233f9ce 100644 --- a/hermes_cli/auth.py +++ b/hermes_cli/auth.py @@ -108,14 +108,6 @@ PROVIDER_REGISTRY: Dict[str, ProviderConfig] = { auth_type="oauth_external", inference_base_url=DEFAULT_CODEX_BASE_URL, ), - "nous-api": ProviderConfig( - id="nous-api", - name="Nous Portal (API Key)", - auth_type="api_key", - inference_base_url="https://inference-api.nousresearch.com/v1", - api_key_env_vars=("NOUS_API_KEY",), - base_url_env_var="NOUS_BASE_URL", - ), "zai": ProviderConfig( id="zai", name="Z.AI / GLM", @@ -521,7 +513,6 @@ def resolve_provider( # Normalize provider aliases _PROVIDER_ALIASES = { - "nous_api": "nous-api", "nousapi": "nous-api", "nous-portal-api": "nous-api", "glm": "zai", "z-ai": "zai", "z.ai": "zai", "zhipu": "zai", "kimi": "kimi-coding", "moonshot": "kimi-coding", "minimax-china": "minimax-cn", "minimax_cn": "minimax-cn", diff --git a/hermes_cli/config.py b/hermes_cli/config.py index 758118492f..677de678c0 100644 --- a/hermes_cli/config.py +++ b/hermes_cli/config.py @@ -242,14 +242,6 @@ REQUIRED_ENV_VARS = {} # Optional environment variables that enhance functionality OPTIONAL_ENV_VARS = { # ── Provider (handled in provider selection, not shown in checklists) ── - "NOUS_API_KEY": { - "description": "Nous Portal API key (direct API key access to Nous inference)", - "prompt": "Nous Portal API key", - "url": "https://portal.nousresearch.com", - "password": True, - "category": "provider", - "advanced": True, - }, "NOUS_BASE_URL": { "description": "Nous Portal base URL override", "prompt": "Nous Portal base URL (leave empty for default)", diff --git a/hermes_cli/setup.py b/hermes_cli/setup.py index c471b1b9d8..6b00952cf5 100644 --- a/hermes_cli/setup.py +++ b/hermes_cli/setup.py @@ -516,7 +516,6 @@ def setup_model_provider(config: dict): keep_label = None # No provider configured — don't show "Keep current" provider_choices = [ - "Nous Portal API key (direct API key access)", "Login with Nous Portal (Nous Research subscription — OAuth)", "Login with OpenAI Codex", "OpenRouter API key (100+ models, pay-per-use)", @@ -530,7 +529,7 @@ def setup_model_provider(config: dict): provider_choices.append(keep_label) # Default to "Keep current" if a provider exists, otherwise OpenRouter (most common) - default_provider = len(provider_choices) - 1 if has_any_provider else 3 + default_provider = len(provider_choices) - 1 if has_any_provider else 2 if not has_any_provider: print_warning("An inference provider is required for Hermes to work.") @@ -542,37 +541,7 @@ def setup_model_provider(config: dict): selected_provider = None # "nous", "openai-codex", "openrouter", "custom", or None (keep) nous_models = [] # populated if Nous login succeeds - if provider_idx == 0: # Nous Portal API Key (direct) - selected_provider = "nous-api" - print() - print_header("Nous Portal API Key") - print_info("Use a Nous Portal API key for direct access to Nous inference.") - print_info("Get your API key at: https://portal.nousresearch.com") - print() - - existing_key = get_env_value("NOUS_API_KEY") - if existing_key: - print_info(f"Current: {existing_key[:8]}... (configured)") - if prompt_yes_no("Update Nous API key?", False): - api_key = prompt(" Nous API key", password=True) - if api_key: - save_env_value("NOUS_API_KEY", api_key) - print_success("Nous API key updated") - else: - api_key = prompt(" Nous API key", password=True) - if api_key: - save_env_value("NOUS_API_KEY", api_key) - print_success("Nous API key saved") - else: - print_warning("Skipped - agent won't work without an API key") - - # Clear custom endpoint vars if switching - if existing_custom: - save_env_value("OPENAI_BASE_URL", "") - save_env_value("OPENAI_API_KEY", "") - _update_config_for_provider("nous-api", "https://inference-api.nousresearch.com/v1") - - elif provider_idx == 1: # Nous Portal + if provider_idx == 0: # Nous Portal (OAuth) selected_provider = "nous" print() print_header("Nous Portal Login") @@ -612,7 +581,7 @@ def setup_model_provider(config: dict): print_info("You can try again later with: hermes model") selected_provider = None - elif provider_idx == 2: # OpenAI Codex + elif provider_idx == 1: # OpenAI Codex selected_provider = "openai-codex" print() print_header("OpenAI Codex Login") @@ -636,7 +605,7 @@ def setup_model_provider(config: dict): print_info("You can try again later with: hermes model") selected_provider = None - elif provider_idx == 3: # OpenRouter + elif provider_idx == 2: # OpenRouter selected_provider = "openrouter" print() print_header("OpenRouter API Key") @@ -686,7 +655,7 @@ def setup_model_provider(config: dict): except Exception as e: logger.debug("Could not save provider to config.yaml: %s", e) - elif provider_idx == 4: # Custom endpoint + elif provider_idx == 3: # Custom endpoint selected_provider = "custom" print() print_header("Custom OpenAI-Compatible Endpoint") @@ -737,7 +706,7 @@ def setup_model_provider(config: dict): print_success("Custom endpoint configured") - elif provider_idx == 5: # Z.AI / GLM + elif provider_idx == 4: # Z.AI / GLM selected_provider = "zai" print() print_header("Z.AI / GLM API Key") @@ -791,7 +760,7 @@ def setup_model_provider(config: dict): save_env_value("OPENAI_API_KEY", "") _update_config_for_provider("zai", zai_base_url) - elif provider_idx == 6: # Kimi / Moonshot + elif provider_idx == 5: # Kimi / Moonshot selected_provider = "kimi-coding" print() print_header("Kimi / Moonshot API Key") @@ -823,7 +792,7 @@ def setup_model_provider(config: dict): save_env_value("OPENAI_API_KEY", "") _update_config_for_provider("kimi-coding", pconfig.inference_base_url) - elif provider_idx == 7: # MiniMax + elif provider_idx == 6: # MiniMax selected_provider = "minimax" print() print_header("MiniMax API Key") @@ -855,7 +824,7 @@ def setup_model_provider(config: dict): save_env_value("OPENAI_API_KEY", "") _update_config_for_provider("minimax", pconfig.inference_base_url) - elif provider_idx == 8: # MiniMax China + elif provider_idx == 7: # MiniMax China selected_provider = "minimax-cn" print() print_header("MiniMax China API Key") @@ -887,12 +856,12 @@ def setup_model_provider(config: dict): save_env_value("OPENAI_API_KEY", "") _update_config_for_provider("minimax-cn", pconfig.inference_base_url) - # else: provider_idx == 9 (Keep current) — only shown when a provider already exists + # else: provider_idx == 8 (Keep current) — only shown when a provider already exists # ── OpenRouter API Key for tools (if not already set) ── # Tools (vision, web, MoA) use OpenRouter independently of the main provider. # Prompt for OpenRouter key if not set and a non-OpenRouter provider was chosen. - if selected_provider in ("nous", "nous-api", "openai-codex", "custom", "zai", "kimi-coding", "minimax", "minimax-cn") and not get_env_value("OPENROUTER_API_KEY"): + if selected_provider in ("nous", "openai-codex", "custom", "zai", "kimi-coding", "minimax", "minimax-cn") and not get_env_value("OPENROUTER_API_KEY"): print() print_header("OpenRouter API Key (for tools)") print_info("Tools like vision analysis, web search, and MoA use OpenRouter") @@ -945,14 +914,6 @@ def setup_model_provider(config: dict): if custom: config['model'] = custom save_env_value("LLM_MODEL", custom) - elif selected_provider == "nous-api": - # Nous API key provider — prompt for model manually - print_info("Enter a model name available on Nous inference API.") - print_info("Examples: anthropic/claude-opus-4.6, deepseek/deepseek-r1") - custom = prompt(f" Model name (Enter to keep '{current_model}')") - if custom: - config['model'] = custom - save_env_value("LLM_MODEL", custom) elif selected_provider == "openai-codex": from hermes_cli.codex_models import get_codex_model_ids codex_models = get_codex_model_ids() diff --git a/tests/integration/test_web_tools.py b/tests/integration/test_web_tools.py index cd3de453af..fb2ea9da02 100644 --- a/tests/integration/test_web_tools.py +++ b/tests/integration/test_web_tools.py @@ -579,7 +579,7 @@ class WebToolsTester: "results": self.test_results, "environment": { "firecrawl_api_key": check_firecrawl_api_key(), - "nous_api_key": check_auxiliary_model(), + "auxiliary_model": check_auxiliary_model(), "debug_mode": get_debug_session_info()["enabled"] } } diff --git a/tests/test_runtime_provider_resolution.py b/tests/test_runtime_provider_resolution.py index 9ccd7c7ec6..9631591b86 100644 --- a/tests/test_runtime_provider_resolution.py +++ b/tests/test_runtime_provider_resolution.py @@ -158,29 +158,6 @@ def test_custom_endpoint_auto_provider_prefers_openai_key(monkeypatch): assert resolved["api_key"] == "sk-vllm-key" -def test_resolve_runtime_provider_nous_api(monkeypatch): - """Nous Portal API key provider resolves via the api_key path.""" - monkeypatch.setattr(rp, "resolve_provider", lambda *a, **k: "nous-api") - monkeypatch.setattr( - rp, - "resolve_api_key_provider_credentials", - lambda pid: { - "provider": "nous-api", - "api_key": "nous-test-key", - "base_url": "https://inference-api.nousresearch.com/v1", - "source": "NOUS_API_KEY", - }, - ) - - resolved = rp.resolve_runtime_provider(requested="nous-api") - - assert resolved["provider"] == "nous-api" - assert resolved["api_mode"] == "chat_completions" - assert resolved["base_url"] == "https://inference-api.nousresearch.com/v1" - assert resolved["api_key"] == "nous-test-key" - assert resolved["requested_provider"] == "nous-api" - - def test_explicit_openrouter_skips_openai_base_url(monkeypatch): """When the user explicitly requests openrouter, OPENAI_BASE_URL (which may point to a custom endpoint) must not override the