From dee2a03d077f3bebec522f7179afa4f754f9e7d1 Mon Sep 17 00:00:00 2001 From: 0xallam Date: Mon, 8 Jun 2026 00:11:49 +0300 Subject: [PATCH] Hint at provider prefix when bare model 401s against OpenAI A bare model name without a provider prefix routes through the SDK's default OpenAI provider, so configuring STRIX_LLM=deepseek-v4-pro with LLM_API_KEY= sends that key to api.openai.com and surfaces a confusing "Incorrect API key" error pointing at the OpenAI dashboard. When warm-up fails with an OpenAI-shaped error AND the configured model is still unprefixed after normalize_model_name, append a hint that points the user at the '/' form with concrete examples. --- strix/interface/main.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/strix/interface/main.py b/strix/interface/main.py index 76d36cf..9bb86ae 100644 --- a/strix/interface/main.py +++ b/strix/interface/main.py @@ -5,6 +5,7 @@ Strix Agent Interface import argparse import asyncio +import contextlib import shutil import sys from datetime import UTC, datetime @@ -242,6 +243,24 @@ async def warm_up_llm() -> None: error_text.append("Please check your configuration and try again.\n", style="white") error_text.append(f"\nError: {e}", style="dim white") + raw_model = "" + resolved = "" + with contextlib.suppress(Exception): + raw_model = (load_settings().llm.model or "").strip() + resolved = normalize_model_name(raw_model) + err_lc = str(e).lower() + unprefixed = bool(resolved) and "/" not in resolved + looks_openai = "platform.openai.com" in err_lc or "openai" in err_lc + if unprefixed and looks_openai: + error_text.append( + f"\n\nHint: '{raw_model}' has no provider prefix, so the SDK " + f"routed it through OpenAI by default. For non-OpenAI providers " + f"use the '/' form, e.g. " + f"'deepseek/deepseek-chat', 'groq/llama-3.1-70b', " + f"'anthropic/claude-3-5-sonnet'.", + style="yellow", + ) + panel = Panel( error_text, title="[bold white]STRIX",