From 70d907643a843f9d7c77bde0008af3e24436ad87 Mon Sep 17 00:00:00 2001 From: Together Date: Tue, 17 Feb 2026 14:30:23 +0800 Subject: [PATCH] feat: add MiniMax provider support for model name routing Add MiniMax as a supported provider so models like 'MiniMax-M2.5' are automatically routed without requiring explicit provider configuration. - Add MiniMax field to ProvidersConfig struct - Add 'minimax' case in explicit provider selection - Add model name fallback detection for 'minimax' prefix --- pkg/config/config.go | 2 ++ pkg/providers/http_provider.go | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/pkg/config/config.go b/pkg/config/config.go index d189ff00b..327028528 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -179,6 +179,7 @@ type ProvidersConfig struct { Moonshot ProviderConfig `json:"moonshot"` ShengSuanYun ProviderConfig `json:"shengsuanyun"` DeepSeek ProviderConfig `json:"deepseek"` + MiniMax ProviderConfig `json:"minimax"` GitHubCopilot ProviderConfig `json:"github_copilot"` } @@ -305,6 +306,7 @@ func DefaultConfig() *Config { Nvidia: ProviderConfig{}, Moonshot: ProviderConfig{}, ShengSuanYun: ProviderConfig{}, + MiniMax: ProviderConfig{}, }, Gateway: GatewayConfig{ Host: "0.0.0.0", diff --git a/pkg/providers/http_provider.go b/pkg/providers/http_provider.go index 138ed4e50..06dec5aaf 100644 --- a/pkg/providers/http_provider.go +++ b/pkg/providers/http_provider.go @@ -327,6 +327,15 @@ func CreateProvider(cfg *config.Config) (LLMProvider, error) { apiBase = "localhost:4321" } return NewGitHubCopilotProvider(apiBase, cfg.Providers.GitHubCopilot.ConnectMode, model) + case "minimax": + if cfg.Providers.MiniMax.APIKey != "" { + apiKey = cfg.Providers.MiniMax.APIKey + apiBase = cfg.Providers.MiniMax.APIBase + proxy = cfg.Providers.MiniMax.Proxy + if apiBase == "" { + apiBase = "https://api.minimax.chat/v1" + } + } } @@ -409,6 +418,13 @@ func CreateProvider(cfg *config.Config) (LLMProvider, error) { apiBase = "http://localhost:11434/v1" } fmt.Println("Ollama apiBase:", apiBase) + case (strings.Contains(lowerModel, "minimax") || strings.HasPrefix(model, "minimax/")) && cfg.Providers.MiniMax.APIKey != "": + apiKey = cfg.Providers.MiniMax.APIKey + apiBase = cfg.Providers.MiniMax.APIBase + proxy = cfg.Providers.MiniMax.Proxy + if apiBase == "" { + apiBase = "https://api.minimax.chat/v1" + } case cfg.Providers.VLLM.APIBase != "": apiKey = cfg.Providers.VLLM.APIKey apiBase = cfg.Providers.VLLM.APIBase