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:
parent
2b6b4fb35a
commit
70d907643a
2 changed files with 18 additions and 0 deletions
|
|
@ -179,6 +179,7 @@ type ProvidersConfig struct {
|
||||||
Moonshot ProviderConfig `json:"moonshot"`
|
Moonshot ProviderConfig `json:"moonshot"`
|
||||||
ShengSuanYun ProviderConfig `json:"shengsuanyun"`
|
ShengSuanYun ProviderConfig `json:"shengsuanyun"`
|
||||||
DeepSeek ProviderConfig `json:"deepseek"`
|
DeepSeek ProviderConfig `json:"deepseek"`
|
||||||
|
MiniMax ProviderConfig `json:"minimax"`
|
||||||
GitHubCopilot ProviderConfig `json:"github_copilot"`
|
GitHubCopilot ProviderConfig `json:"github_copilot"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -305,6 +306,7 @@ func DefaultConfig() *Config {
|
||||||
Nvidia: ProviderConfig{},
|
Nvidia: ProviderConfig{},
|
||||||
Moonshot: ProviderConfig{},
|
Moonshot: ProviderConfig{},
|
||||||
ShengSuanYun: ProviderConfig{},
|
ShengSuanYun: ProviderConfig{},
|
||||||
|
MiniMax: ProviderConfig{},
|
||||||
},
|
},
|
||||||
Gateway: GatewayConfig{
|
Gateway: GatewayConfig{
|
||||||
Host: "0.0.0.0",
|
Host: "0.0.0.0",
|
||||||
|
|
|
||||||
|
|
@ -327,6 +327,15 @@ func CreateProvider(cfg *config.Config) (LLMProvider, error) {
|
||||||
apiBase = "localhost:4321"
|
apiBase = "localhost:4321"
|
||||||
}
|
}
|
||||||
return NewGitHubCopilotProvider(apiBase, cfg.Providers.GitHubCopilot.ConnectMode, model)
|
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"
|
apiBase = "http://localhost:11434/v1"
|
||||||
}
|
}
|
||||||
fmt.Println("Ollama apiBase:", apiBase)
|
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 != "":
|
case cfg.Providers.VLLM.APIBase != "":
|
||||||
apiKey = cfg.Providers.VLLM.APIKey
|
apiKey = cfg.Providers.VLLM.APIKey
|
||||||
apiBase = cfg.Providers.VLLM.APIBase
|
apiBase = cfg.Providers.VLLM.APIBase
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue