|
| 1 | +import type { ModelDefinitionConfig, ModelProviderConfig } from "../../src/config/types.models.js"; |
| 2 | + |
| 3 | +const MINIMAX_PORTAL_BASE_URL = "https://api.minimax.io/anthropic"; |
| 4 | +export const MINIMAX_DEFAULT_MODEL_ID = "MiniMax-M2.5"; |
| 5 | +const MINIMAX_DEFAULT_VISION_MODEL_ID = "MiniMax-VL-01"; |
| 6 | +const MINIMAX_DEFAULT_CONTEXT_WINDOW = 200000; |
| 7 | +const MINIMAX_DEFAULT_MAX_TOKENS = 8192; |
| 8 | +const MINIMAX_API_COST = { |
| 9 | + input: 0.3, |
| 10 | + output: 1.2, |
| 11 | + cacheRead: 0.03, |
| 12 | + cacheWrite: 0.12, |
| 13 | +}; |
| 14 | + |
| 15 | +function buildMinimaxModel(params: { |
| 16 | + id: string; |
| 17 | + name: string; |
| 18 | + reasoning: boolean; |
| 19 | + input: ModelDefinitionConfig["input"]; |
| 20 | +}): ModelDefinitionConfig { |
| 21 | + return { |
| 22 | + id: params.id, |
| 23 | + name: params.name, |
| 24 | + reasoning: params.reasoning, |
| 25 | + input: params.input, |
| 26 | + cost: MINIMAX_API_COST, |
| 27 | + contextWindow: MINIMAX_DEFAULT_CONTEXT_WINDOW, |
| 28 | + maxTokens: MINIMAX_DEFAULT_MAX_TOKENS, |
| 29 | + }; |
| 30 | +} |
| 31 | + |
| 32 | +function buildMinimaxTextModel(params: { |
| 33 | + id: string; |
| 34 | + name: string; |
| 35 | + reasoning: boolean; |
| 36 | +}): ModelDefinitionConfig { |
| 37 | + return buildMinimaxModel({ ...params, input: ["text"] }); |
| 38 | +} |
| 39 | + |
| 40 | +function buildMinimaxCatalog(): ModelDefinitionConfig[] { |
| 41 | + return [ |
| 42 | + buildMinimaxModel({ |
| 43 | + id: MINIMAX_DEFAULT_VISION_MODEL_ID, |
| 44 | + name: "MiniMax VL 01", |
| 45 | + reasoning: false, |
| 46 | + input: ["text", "image"], |
| 47 | + }), |
| 48 | + buildMinimaxTextModel({ |
| 49 | + id: MINIMAX_DEFAULT_MODEL_ID, |
| 50 | + name: "MiniMax M2.5", |
| 51 | + reasoning: true, |
| 52 | + }), |
| 53 | + buildMinimaxTextModel({ |
| 54 | + id: "MiniMax-M2.5-highspeed", |
| 55 | + name: "MiniMax M2.5 Highspeed", |
| 56 | + reasoning: true, |
| 57 | + }), |
| 58 | + ]; |
| 59 | +} |
| 60 | + |
| 61 | +export function buildMinimaxProvider(): ModelProviderConfig { |
| 62 | + return { |
| 63 | + baseUrl: MINIMAX_PORTAL_BASE_URL, |
| 64 | + api: "anthropic-messages", |
| 65 | + authHeader: true, |
| 66 | + models: buildMinimaxCatalog(), |
| 67 | + }; |
| 68 | +} |
| 69 | + |
| 70 | +export function buildMinimaxPortalProvider(): ModelProviderConfig { |
| 71 | + return { |
| 72 | + baseUrl: MINIMAX_PORTAL_BASE_URL, |
| 73 | + api: "anthropic-messages", |
| 74 | + authHeader: true, |
| 75 | + models: buildMinimaxCatalog(), |
| 76 | + }; |
| 77 | +} |
0 commit comments