diff --git a/README.md b/README.md index 4a26a2f..1da4a41 100644 --- a/README.md +++ b/README.md @@ -582,6 +582,7 @@ Config file: `~/.nanobot/config.json` > [!TIP] > - **Groq** provides free voice transcription via Whisper. If configured, Telegram voice messages will be automatically transcribed. > - **Zhipu Coding Plan**: If you're on Zhipu's coding plan, set `"apiBase": "https://open.bigmodel.cn/api/coding/paas/v4"` in your zhipu provider config. +> - **MiniMax (Mainland China)**: If your API key is from MiniMax's mainland China platform (minimaxi.com), set `"apiBase": "https://api.minimaxi.com/v1"` in your minimax provider config. | Provider | Purpose | Get API Key | |----------|---------|-------------| @@ -591,6 +592,7 @@ Config file: `~/.nanobot/config.json` | `deepseek` | LLM (DeepSeek direct) | [platform.deepseek.com](https://platform.deepseek.com) | | `groq` | LLM + **Voice transcription** (Whisper) | [console.groq.com](https://console.groq.com) | | `gemini` | LLM (Gemini direct) | [aistudio.google.com](https://aistudio.google.com) | +| `minimax` | LLM (MiniMax direct) | [platform.minimax.io](https://platform.minimax.io) | | `aihubmix` | LLM (API gateway, access to all models) | [aihubmix.com](https://aihubmix.com) | | `dashscope` | LLM (Qwen) | [dashscope.console.aliyun.com](https://dashscope.console.aliyun.com) | | `moonshot` | LLM (Moonshot/Kimi) | [platform.moonshot.cn](https://platform.moonshot.cn) | diff --git a/nanobot/config/schema.py b/nanobot/config/schema.py index c9bdb02..f6c861d 100644 --- a/nanobot/config/schema.py +++ b/nanobot/config/schema.py @@ -187,6 +187,7 @@ class ProvidersConfig(BaseModel): vllm: ProviderConfig = Field(default_factory=ProviderConfig) gemini: ProviderConfig = Field(default_factory=ProviderConfig) moonshot: ProviderConfig = Field(default_factory=ProviderConfig) + minimax: ProviderConfig = Field(default_factory=ProviderConfig) aihubmix: ProviderConfig = Field(default_factory=ProviderConfig) # AiHubMix API gateway diff --git a/nanobot/providers/litellm_provider.py b/nanobot/providers/litellm_provider.py index dd50ed9..7865139 100644 --- a/nanobot/providers/litellm_provider.py +++ b/nanobot/providers/litellm_provider.py @@ -15,7 +15,7 @@ class LiteLLMProvider(LLMProvider): """ LLM provider using LiteLLM for multi-provider support. - Supports OpenRouter, Anthropic, OpenAI, Gemini, and many other providers through + Supports OpenRouter, Anthropic, OpenAI, Gemini, MiniMax, and many other providers through a unified interface. Provider-specific logic is driven by the registry (see providers/registry.py) — no if-elif chains needed here. """ diff --git a/nanobot/providers/registry.py b/nanobot/providers/registry.py index 57db4dd..fdd036e 100644 --- a/nanobot/providers/registry.py +++ b/nanobot/providers/registry.py @@ -241,6 +241,25 @@ PROVIDERS: tuple[ProviderSpec, ...] = ( ), ), + # MiniMax: needs "minimax/" prefix for LiteLLM routing. + # Uses OpenAI-compatible API at api.minimax.io/v1. + ProviderSpec( + name="minimax", + keywords=("minimax",), + env_key="MINIMAX_API_KEY", + display_name="MiniMax", + litellm_prefix="minimax", # MiniMax-M2.1 → minimax/MiniMax-M2.1 + skip_prefixes=("minimax/", "openrouter/"), + env_extras=(), + is_gateway=False, + is_local=False, + detect_by_key_prefix="", + detect_by_base_keyword="", + default_api_base="https://api.minimax.io/v1", + strip_model_prefix=False, + model_overrides=(), + ), + # === Local deployment (matched by config key, NOT by api_base) ========= # vLLM / any OpenAI-compatible local server.