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
This commit is contained in:
Together 2026-02-17 14:30:23 +08:00
parent 2b6b4fb35a
commit 70d907643a
2 changed files with 18 additions and 0 deletions

View file

@ -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",

View file

@ -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