From 80cbd2e663a12f05dff6a7f18d37d304f7a69376 Mon Sep 17 00:00:00 2001 From: rfschubert Date: Sun, 22 Feb 2026 08:08:41 -0300 Subject: [PATCH] feat: add MiniMax provider support via OpenAI-compatible endpoint Register MiniMax as an OpenAI-compatible provider using the official API at https://api.minimax.io/v1 with MiniMax-M2.5 as default model. Changes across config, factory, migration, defaults, and docs. --- README.md | 2 ++ config/config.example.json | 6 ++++++ pkg/config/config.go | 4 +++- pkg/config/defaults.go | 8 ++++++++ pkg/config/migration.go | 17 +++++++++++++++++ pkg/providers/factory_provider.go | 4 +++- pkg/providers/openai_compat/provider.go | 2 +- 7 files changed, 40 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c1ef72141..6f2f9eb94 100644 --- a/README.md +++ b/README.md @@ -924,6 +924,7 @@ The subagent has access to tools (message, web_search, etc.) and can communicate | `qwen` | LLM (Qwen direct) | [dashscope.console.aliyun.com](https://dashscope.console.aliyun.com) | | `groq` | LLM + **Voice transcription** (Whisper) | [console.groq.com](https://console.groq.com) | | `cerebras` | LLM (Cerebras direct) | [cerebras.ai](https://cerebras.ai) | +| `minimax` | LLM (MiniMax direct) | [platform.minimax.io](https://platform.minimax.io) | ### Model Configuration (model_list) @@ -956,6 +957,7 @@ This design also enables **multi-agent support** with flexible provider selectio | **Cerebras** | `cerebras/` | `https://api.cerebras.ai/v1` | OpenAI | [Get Key](https://cerebras.ai) | | **火山引擎** | `volcengine/` | `https://ark.cn-beijing.volces.com/api/v3` | OpenAI | [Get Key](https://console.volcengine.com) | | **神算云** | `shengsuanyun/` | `https://router.shengsuanyun.com/api/v1` | OpenAI | - | +| **MiniMax** | `minimax/` | `https://api.minimax.io/v1` | OpenAI | [Get Key](https://platform.minimax.io) | | **Antigravity** | `antigravity/` | Google Cloud | Custom | OAuth only | | **GitHub Copilot** | `github-copilot/` | `localhost:4321` | gRPC | - | diff --git a/config/config.example.json b/config/config.example.json index ef1bf3eda..dc167540e 100644 --- a/config/config.example.json +++ b/config/config.example.json @@ -46,6 +46,12 @@ "model": "openai/gpt-5.2", "api_key": "sk-key2", "api_base": "https://api2.example.com/v1" + }, + { + "model_name": "minimax-m2.5", + "model": "minimax/MiniMax-M2.5", + "api_key": "sk-your-minimax-key", + "api_base": "https://api.minimax.io/v1" } ], "channels": { diff --git a/pkg/config/config.go b/pkg/config/config.go index 0ee3acfe0..54adf511b 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -432,6 +432,7 @@ type ProvidersConfig struct { Qwen ProviderConfig `json:"qwen"` Mistral ProviderConfig `json:"mistral"` Avian ProviderConfig `json:"avian"` + Minimax ProviderConfig `json:"minimax"` } // IsEmpty checks if all provider configs are empty (no API keys or API bases set) @@ -456,7 +457,8 @@ func (p ProvidersConfig) IsEmpty() bool { p.Antigravity.APIKey == "" && p.Antigravity.APIBase == "" && p.Qwen.APIKey == "" && p.Qwen.APIBase == "" && p.Mistral.APIKey == "" && p.Mistral.APIBase == "" && - p.Avian.APIKey == "" && p.Avian.APIBase == "" + p.Avian.APIKey == "" && p.Avian.APIBase == "" && + p.Minimax.APIKey == "" && p.Minimax.APIBase == "" } // MarshalJSON implements custom JSON marshaling for ProvidersConfig diff --git a/pkg/config/defaults.go b/pkg/config/defaults.go index 488590e28..df49801c4 100644 --- a/pkg/config/defaults.go +++ b/pkg/config/defaults.go @@ -277,6 +277,14 @@ func DefaultConfig() *Config { APIKey: "", }, + // MiniMax - https://platform.minimax.io/ + { + ModelName: "minimax-m2.5", + Model: "minimax/MiniMax-M2.5", + APIBase: "https://api.minimax.io/v1", + APIKey: "", + }, + // Antigravity (Google Cloud Code Assist) - OAuth only { ModelName: "gemini-flash", diff --git a/pkg/config/migration.go b/pkg/config/migration.go index 4a17dd6c9..4d127d1c5 100644 --- a/pkg/config/migration.go +++ b/pkg/config/migration.go @@ -390,6 +390,23 @@ func ConvertProvidersToModelList(cfg *Config) []ModelConfig { }, true }, }, + { + providerNames: []string{"minimax"}, + protocol: "minimax", + buildConfig: func(p ProvidersConfig) (ModelConfig, bool) { + if p.Minimax.APIKey == "" && p.Minimax.APIBase == "" { + return ModelConfig{}, false + } + return ModelConfig{ + ModelName: "minimax", + Model: "minimax/MiniMax-M2.5", + APIKey: p.Minimax.APIKey, + APIBase: p.Minimax.APIBase, + Proxy: p.Minimax.Proxy, + RequestTimeout: p.Minimax.RequestTimeout, + }, true + }, + }, } // Process each provider migration diff --git a/pkg/providers/factory_provider.go b/pkg/providers/factory_provider.go index c05fb0ad4..6dd28eb83 100644 --- a/pkg/providers/factory_provider.go +++ b/pkg/providers/factory_provider.go @@ -94,7 +94,7 @@ func CreateProviderFromConfig(cfg *config.ModelConfig) (LLMProvider, string, err case "litellm", "openrouter", "groq", "zhipu", "gemini", "nvidia", "ollama", "moonshot", "shengsuanyun", "deepseek", "cerebras", - "volcengine", "vllm", "qwen", "mistral", "avian": + "volcengine", "vllm", "qwen", "mistral", "avian", "minimax": // All other OpenAI-compatible HTTP providers if cfg.APIKey == "" && cfg.APIBase == "" { return nil, "", fmt.Errorf("api_key or api_base is required for HTTP-based protocol %q", protocol) @@ -204,6 +204,8 @@ func getDefaultAPIBase(protocol string) string { return "https://ark.cn-beijing.volces.com/api/v3" case "qwen": return "https://dashscope.aliyuncs.com/compatible-mode/v1" + case "minimax": + return "https://api.minimax.io/v1" case "vllm": return "http://localhost:8000/v1" case "mistral": diff --git a/pkg/providers/openai_compat/provider.go b/pkg/providers/openai_compat/provider.go index 1904ee153..064e8d22b 100644 --- a/pkg/providers/openai_compat/provider.go +++ b/pkg/providers/openai_compat/provider.go @@ -363,7 +363,7 @@ func normalizeModel(model, apiBase string) string { prefix := strings.ToLower(before) switch prefix { - case "litellm", "moonshot", "nvidia", "groq", "ollama", "deepseek", "google", "openrouter", "zhipu", "mistral": + case "litellm", "moonshot", "nvidia", "groq", "ollama", "deepseek", "google", "openrouter", "zhipu", "mistral", "minimax": return after default: return model