mirror of
https://github.com/TauricResearch/TradingAgents.git
synced 2026-06-16 21:06:15 +03:00
feat(llm): add MiniMax as a built-in provider
Two regional endpoints (global api.minimax.io, China api.minimaxi.com) with separate API keys. Models M2.7 / M2.5 plus -highspeed variants, 204K context. Follows the existing provider-preset pattern. #789 #609 #577 #546 #395 #378
This commit is contained in:
@@ -4,7 +4,9 @@ from .base_client import BaseLLMClient
|
||||
|
||||
# Providers that use the OpenAI-compatible chat completions API
|
||||
_OPENAI_COMPATIBLE = (
|
||||
"openai", "xai", "deepseek", "qwen", "glm", "ollama", "openrouter",
|
||||
"openai", "xai", "deepseek", "qwen", "glm",
|
||||
"minimax", "minimax-cn",
|
||||
"ollama", "openrouter",
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -8,6 +8,22 @@ ModelOption = Tuple[str, str]
|
||||
ProviderModeOptions = Dict[str, Dict[str, List[ModelOption]]]
|
||||
|
||||
|
||||
# Shared model list for MiniMax's global and CN endpoints (same model IDs).
|
||||
_MINIMAX_MODELS: Dict[str, List[ModelOption]] = {
|
||||
"quick": [
|
||||
("MiniMax M2.7 Highspeed — Fast, 204K ctx", "MiniMax-M2.7-highspeed"),
|
||||
("MiniMax M2.5 Highspeed — Previous-gen fast", "MiniMax-M2.5-highspeed"),
|
||||
("Custom model ID", "custom"),
|
||||
],
|
||||
"deep": [
|
||||
("MiniMax M2.7 — Flagship, 204K ctx", "MiniMax-M2.7"),
|
||||
("MiniMax M2.5 — Previous-gen flagship", "MiniMax-M2.5"),
|
||||
("MiniMax M2.7 Highspeed — Faster M2.7, 204K ctx", "MiniMax-M2.7-highspeed"),
|
||||
("Custom model ID", "custom"),
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
MODEL_OPTIONS: ProviderModeOptions = {
|
||||
"openai": {
|
||||
"quick": [
|
||||
@@ -101,6 +117,10 @@ MODEL_OPTIONS: ProviderModeOptions = {
|
||||
("Custom model ID", "custom"),
|
||||
],
|
||||
},
|
||||
# MiniMax: same model IDs across global (.io) and China (.com) regions,
|
||||
# so the two provider keys share one model list.
|
||||
"minimax": _MINIMAX_MODELS,
|
||||
"minimax-cn": _MINIMAX_MODELS,
|
||||
# OpenRouter: fetched dynamically. Azure: any deployed model name.
|
||||
"ollama": {
|
||||
"quick": [
|
||||
|
||||
@@ -119,6 +119,10 @@ _PROVIDER_CONFIG = {
|
||||
"deepseek": ("https://api.deepseek.com", "DEEPSEEK_API_KEY"),
|
||||
"qwen": ("https://dashscope-intl.aliyuncs.com/compatible-mode/v1", "DASHSCOPE_API_KEY"),
|
||||
"glm": ("https://api.z.ai/api/paas/v4/", "ZHIPU_API_KEY"),
|
||||
# MiniMax exposes two regional endpoints with separate keys; mainland
|
||||
# Chinese users hit .com while global users hit .io.
|
||||
"minimax": ("https://api.minimax.io/v1", "MINIMAX_API_KEY"),
|
||||
"minimax-cn": ("https://api.minimaxi.com/v1", "MINIMAX_CN_API_KEY"),
|
||||
"openrouter": ("https://openrouter.ai/api/v1", "OPENROUTER_API_KEY"),
|
||||
"ollama": ("http://localhost:11434/v1", None),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user