diff --git a/README.md b/README.md index 20da37c..c14d306 100644 --- a/README.md +++ b/README.md @@ -154,7 +154,7 @@ pnpm test # run tests All config lives in `data/config/` as JSON files with Zod validation. Missing files fall back to sensible defaults. You can edit these files directly or use the Web UI. -**AI Provider** — The default provider is Claude Code (`claude -p` subprocess). To use the [Vercel AI SDK](https://sdk.vercel.ai/docs) instead (Anthropic, OpenAI, Google, etc.), switch `ai-provider.json` to `vercel-ai-sdk` and add your API key to `api-keys.json`. A third option, Agent SDK (`@anthropic-ai/claude-agent-sdk`), is also available via `agent-sdk`. +**AI Provider** — The default provider is Claude Code (`claude -p` subprocess). To use the [Vercel AI SDK](https://sdk.vercel.ai/docs) instead (Anthropic, OpenAI, Google, [MiniMax](https://www.minimax.io), etc.), switch `ai-provider.json` to `vercel-ai-sdk` and add your API key to `api-keys.json`. A third option, Agent SDK (`@anthropic-ai/claude-agent-sdk`), is also available via `agent-sdk`. **Trading** — Multi-account architecture. Crypto via [CCXT](https://docs.ccxt.com/) (Bybit, OKX, Binance, etc.) configured in `crypto.json`. US equities via [Alpaca](https://alpaca.markets/) configured in `securities.json`. Both use the same git-like trading workflow. @@ -163,7 +163,7 @@ All config lives in `data/config/` as JSON files with Zod validation. Missing fi | `engine.json` | Trading pairs, tick interval, timeframe | | `agent.json` | Max agent steps, evolution mode toggle, Claude Code tool permissions | | `ai-provider.json` | Active AI provider (`claude-code`, `vercel-ai-sdk`, or `agent-sdk`), switchable at runtime | -| `api-keys.json` | AI provider API keys (Anthropic, OpenAI, Google) — only needed for Vercel AI SDK mode | +| `api-keys.json` | AI provider API keys (Anthropic, OpenAI, Google, MiniMax) — only needed for Vercel AI SDK mode | | `platforms.json` | Trading platform definitions (CCXT exchanges, Alpaca) | | `accounts.json` | Trading account credentials and guard config, references platforms | | `crypto.json` | CCXT exchange config + API keys, allowed symbols, guards | diff --git a/src/ai-providers/vercel-ai-sdk/model-factory.ts b/src/ai-providers/vercel-ai-sdk/model-factory.ts index 0e42c3f..598a41e 100644 --- a/src/ai-providers/vercel-ai-sdk/model-factory.ts +++ b/src/ai-providers/vercel-ai-sdk/model-factory.ts @@ -54,7 +54,16 @@ export async function createModelFromConfig(override?: ModelOverride): Promise = { { label: 'Gemini 3 Flash', value: 'gemini-3-flash-preview' }, { label: 'Gemini 2.5 Pro', value: 'gemini-2.5-pro' }, ], + minimax: [ + { label: 'MiniMax-M2.5', value: 'MiniMax-M2.5' }, + { label: 'MiniMax-M2.5-highspeed', value: 'MiniMax-M2.5-highspeed' }, + ], } const PROVIDERS = [ { value: 'anthropic', label: 'Anthropic' }, { value: 'openai', label: 'OpenAI' }, { value: 'google', label: 'Google' }, + { value: 'minimax', label: 'MiniMax' }, { value: 'custom', label: 'Custom' }, ] @@ -115,7 +120,7 @@ function ModelForm({ aiProvider }: { aiProvider: AIProviderConfig }) { const [customModel, setCustomModel] = useState(initCustom ? (aiProvider.model || '') : '') const [baseUrl, setBaseUrl] = useState(aiProvider.baseUrl || '') const [showKeys, setShowKeys] = useState(false) - const [keys, setKeys] = useState({ anthropic: '', openai: '', google: '' }) + const [keys, setKeys] = useState({ anthropic: '', openai: '', google: '', minimax: '' }) const [keySaveStatus, setKeySaveStatus] = useState('idle') const keySavedTimer = useRef | null>(null) @@ -152,6 +157,7 @@ function ModelForm({ aiProvider }: { aiProvider: AIProviderConfig }) { anthropic: !!aiProvider.apiKeys?.anthropic, openai: !!aiProvider.apiKeys?.openai, google: !!aiProvider.apiKeys?.google, + minimax: !!aiProvider.apiKeys?.minimax, }), [aiProvider.apiKeys]) const [liveKeyStatus, setLiveKeyStatus] = useState(keyStatus) @@ -199,13 +205,15 @@ function ModelForm({ aiProvider }: { aiProvider: AIProviderConfig }) { if (keys.anthropic) updatedKeys.anthropic = keys.anthropic if (keys.openai) updatedKeys.openai = keys.openai if (keys.google) updatedKeys.google = keys.google + if (keys.minimax) updatedKeys.minimax = keys.minimax await api.config.updateSection('aiProvider', { ...aiProvider, apiKeys: updatedKeys }) setLiveKeyStatus({ anthropic: !!updatedKeys.anthropic, openai: !!updatedKeys.openai, google: !!updatedKeys.google, + minimax: !!updatedKeys.minimax, }) - setKeys({ anthropic: '', openai: '', google: '' }) + setKeys({ anthropic: '', openai: '', google: '', minimax: '' }) setKeySaveStatus('saved') if (keySavedTimer.current) clearTimeout(keySavedTimer.current) keySavedTimer.current = setTimeout(() => setKeySaveStatus('idle'), 2000)