Your lightweight open-source personal agent.
Python agent-frameworkai-agentai-agentschatbotchatopsdiscord-botllm-agentsllmslocal-llmmcpmodel-context-protocolmulti-agentopenai-compatibleopenclawpersonal-ai-assistantpythonself-hostedtelegram-bot-ai-assistantwebuiworkflow-automation
fix(openrouter): remove litellm_prefix to prevent double-prefixed model names
Xubin Ren350d110fb93c
diff --git a/nanobot/providers/registry.py b/nanobot/providers/registry.pyindex 8d1cfbe5f..e5ffe6c28 100644--- a/nanobot/providers/registry.py+++ b/nanobot/providers/registry.py@@ -98,7 +98,7 @@ PROVIDERS: tuple[ProviderSpec, ...] = (keywords=("openrouter",),env_key="OPENROUTER_API_KEY",display_name="OpenRouter",- litellm_prefix="openrouter", # claude-3 → openrouter/claude-3+ litellm_prefix="", # routing handled by custom_llm_provider kwarg; no prefix neededskip_prefixes=(),env_extras=(),is_gateway=True,diff --git a/tests/test_litellm_kwargs.py b/tests/test_litellm_kwargs.pyindex 19b753b3e..2d0ca015c 100644--- a/tests/test_litellm_kwargs.py+++ b/tests/test_litellm_kwargs.py@@ -45,6 +45,9 @@ async def test_openrouter_injects_litellm_kwargs() -> None:assert call_kwargs.get("custom_llm_provider") == "openrouter", ("OpenRouter gateway should pass custom_llm_provider='openrouter' to acompletion")+ assert call_kwargs["model"] == "anthropic/claude-sonnet-4-5", (+ "Model name must NOT get an 'openrouter/' prefix — routing is via custom_llm_provider"+ )@pytest.mark.asyncio@@ -110,3 +113,6 @@ async def test_openrouter_autodetect_by_key_prefix() -> None:assert call_kwargs.get("custom_llm_provider") == "openrouter", ("Auto-detected OpenRouter (by sk-or- prefix) should still inject custom_llm_provider")+ assert call_kwargs["model"] == "anthropic/claude-sonnet-4-5", (+ "Auto-detected OpenRouter must preserve native model name without openrouter/ prefix"+ )