diff --git a/docs/configuration.md b/docs/configuration.md index f309f5376..e4fbe83eb 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -148,7 +148,7 @@ ANTHROPIC_API_KEY="$(bw get password api/anthropic)" nanobot agent | `gemini` | LLM (Gemini direct) | [aistudio.google.com](https://aistudio.google.com) | | `aihubmix` | LLM (API gateway, access to all models) | [aihubmix.com](https://aihubmix.com) | | `siliconflow` | LLM (SiliconFlow/硅基流动) | [siliconflow.cn](https://siliconflow.cn) | -| `novita` | LLM (NovitaAI Model API: 200+ models on an AI-native cloud for builders and agents) | [novita.ai](https://novita.ai) | +| `novita` | LLM (Novita AI OpenAI-compatible gateway) | [novita.ai](https://novita.ai) | | `dashscope` | LLM (Qwen) | [dashscope.console.aliyun.com](https://dashscope.console.aliyun.com) | | `moonshot` | LLM (Moonshot/Kimi) | [platform.moonshot.cn](https://platform.moonshot.cn) | | `zhipu` | LLM (Zhipu GLM) | [open.bigmodel.cn](https://open.bigmodel.cn) | diff --git a/nanobot/providers/registry.py b/nanobot/providers/registry.py index 04a3d3757..ab7e2cf1e 100644 --- a/nanobot/providers/registry.py +++ b/nanobot/providers/registry.py @@ -199,8 +199,7 @@ PROVIDERS: tuple[ProviderSpec, ...] = ( default_api_base="https://api.siliconflow.cn/v1", ), - # NovitaAI: AI-native cloud for builders and agents. Model API exposes - # 200+ models through an OpenAI-compatible gateway. + # Novita AI: OpenAI-compatible gateway for hosted model APIs. ProviderSpec( name="novita", keywords=("novita",), diff --git a/tests/providers/test_novita_provider.py b/tests/providers/test_novita_provider.py index 820529e34..0b1e8ec12 100644 --- a/tests/providers/test_novita_provider.py +++ b/tests/providers/test_novita_provider.py @@ -54,6 +54,25 @@ def test_novita_forced_provider_uses_default_api_base() -> None: assert config.get_api_base("deepseek-v4-pro") == "https://api.novita.ai/openai" +def test_novita_gateway_routes_unprefixed_models_when_configured() -> None: + config = Config.model_validate({ + "providers": { + "novita": { + "apiKey": "novita-key", + }, + }, + "agents": { + "defaults": { + "model": "deepseek-v4-pro", + }, + }, + }) + + assert config.get_provider_name("deepseek-v4-pro") == "novita" + assert config.get_api_key("deepseek-v4-pro") == "novita-key" + assert config.get_api_base("deepseek-v4-pro") == "https://api.novita.ai/openai" + + def test_novita_preserves_model_api_id() -> None: spec = find_by_name("novita") with patch("nanobot.providers.openai_compat_provider.AsyncOpenAI"):