feat: add MiniMax as LLM provider

Add MiniMax (api.minimax.io) as a fifth LLM provider option alongside
Anthropic, OpenAI, Gemini, and Codex. MiniMax offers an
OpenAI-compatible Chat Completions API with the M2.5 model (204K
context window).

Changes:
- lib/llm/minimax.mjs: new provider using raw fetch (no SDK)
- lib/llm/index.mjs: register MiniMax in the factory
- .env.example, crucix.config.mjs, README.md: document the new option
- test/llm-minimax.test.mjs: 10 unit tests (node:test)
- test/llm-minimax-integration.test.mjs: live API integration test

Usage:
  LLM_PROVIDER=minimax
  LLM_API_KEY=sk-...
  LLM_MODEL=MiniMax-M2.5          # optional, this is the default
This commit is contained in:
Octopus
2026-03-16 08:45:35 -05:00
parent 183702e688
commit 6f41c2ff3d
7 changed files with 239 additions and 8 deletions

View File

@@ -148,10 +148,10 @@ Alerts are delivered as rich embeds with color-coded sidebars: red for FLASH, ye
**Optional dependency:** The full bot requires `discord.js`. Install it with `npm install discord.js`. If it's not installed, Crucix automatically falls back to webhook-only mode.
### Optional LLM Layer
Connect any of 4 LLM providers for enhanced analysis:
Connect any of 5 LLM providers for enhanced analysis:
- **AI trade ideas** — quantitative analyst producing 5-8 actionable ideas citing specific data
- **Smarter alert evaluation** — LLM classifies signals into FLASH/PRIORITY/ROUTINE tiers with cross-domain correlation and confidence scoring
- Providers: Anthropic Claude, OpenAI, Google Gemini, OpenAI Codex (ChatGPT subscription)
- Providers: Anthropic Claude, OpenAI, Google Gemini, OpenAI Codex (ChatGPT subscription), MiniMax
- Graceful fallback — when LLM is unavailable, a rule-based engine takes over alert evaluation. LLM failures never crash the sweep cycle.
---
@@ -184,7 +184,7 @@ These three unlock the most valuable economic and satellite data. Each takes abo
### LLM Provider (optional, for AI-enhanced ideas)
Set `LLM_PROVIDER` to one of: `anthropic`, `openai`, `gemini`, `codex`
Set `LLM_PROVIDER` to one of: `anthropic`, `openai`, `gemini`, `codex`, `minimax`
| Provider | Key Required | Default Model |
|----------|-------------|---------------|
@@ -192,6 +192,7 @@ Set `LLM_PROVIDER` to one of: `anthropic`, `openai`, `gemini`, `codex`
| `openai` | `LLM_API_KEY` | gpt-5.4 |
| `gemini` | `LLM_API_KEY` | gemini-3.1-pro |
| `codex` | None (uses `~/.codex/auth.json`) | gpt-5.3-codex |
| `minimax` | `LLM_API_KEY` | MiniMax-M2.5 |
For Codex, run `npx @openai/codex login` to authenticate via your ChatGPT subscription.
@@ -261,12 +262,13 @@ crucix/
│ └── jarvis.html # Self-contained Jarvis HUD
├── lib/
│ ├── llm/ # LLM abstraction (4 providers, raw fetch, no SDKs)
│ ├── llm/ # LLM abstraction (5 providers, raw fetch, no SDKs)
│ │ ├── provider.mjs # Base class
│ │ ├── anthropic.mjs # Claude
│ │ ├── openai.mjs # GPT
│ │ ├── gemini.mjs # Gemini
│ │ ├── codex.mjs # Codex (ChatGPT subscription)
│ │ ├── minimax.mjs # MiniMax (M2.5, 204K context)
│ │ ├── ideas.mjs # LLM-powered trade idea generation
│ │ └── index.mjs # Factory: createLLMProvider()
│ ├── delta/ # Change tracking between sweeps
@@ -368,7 +370,7 @@ All settings are in `.env` with sensible defaults:
|----------|---------|-------------|
| `PORT` | `3117` | Dashboard server port |
| `REFRESH_INTERVAL_MINUTES` | `15` | Auto-refresh interval |
| `LLM_PROVIDER` | disabled | `anthropic`, `openai`, `gemini`, or `codex` |
| `LLM_PROVIDER` | disabled | `anthropic`, `openai`, `gemini`, `codex`, or `minimax` |
| `LLM_API_KEY` | — | API key (not needed for codex) |
| `LLM_MODEL` | per-provider default | Override model selection |
| `TELEGRAM_BOT_TOKEN` | disabled | For Telegram alerts + bot commands |