mirror of
https://github.com/voideditor/void
synced 2026-05-23 17:38:23 +00:00
Merge 34f0d0c532 into 17e7a5b152
This commit is contained in:
commit
155ba9f1d4
3 changed files with 85 additions and 0 deletions
|
|
@ -65,6 +65,9 @@ export const defaultProviderSettings = {
|
|||
region: 'us-east-1', // add region setting
|
||||
endpoint: '', // optionally allow overriding default
|
||||
},
|
||||
minimax: {
|
||||
apiKey: '',
|
||||
},
|
||||
|
||||
} as const
|
||||
|
||||
|
|
@ -153,6 +156,12 @@ export const defaultModelsOfProvider = {
|
|||
microsoftAzure: [],
|
||||
awsBedrock: [],
|
||||
liteLLM: [],
|
||||
minimax: [ // https://platform.minimax.io/docs/api-reference/text-openai-api
|
||||
'MiniMax-M2.7',
|
||||
'MiniMax-M2.7-highspeed',
|
||||
'MiniMax-M2.5',
|
||||
'MiniMax-M2.5-highspeed',
|
||||
],
|
||||
|
||||
|
||||
} as const satisfies Record<ProviderName, string[]>
|
||||
|
|
@ -955,6 +964,61 @@ const deepseekSettings: VoidStaticProviderInfo = {
|
|||
|
||||
|
||||
|
||||
// ---------------- MINIMAX ----------------
|
||||
const minimaxModelOptions = { // https://platform.minimax.io/docs/api-reference/text-openai-api
|
||||
'MiniMax-M2.7': {
|
||||
contextWindow: 204_800,
|
||||
reservedOutputTokenSpace: 8_192,
|
||||
cost: { input: 0.30, output: 1.20 },
|
||||
downloadable: false,
|
||||
supportsFIM: false,
|
||||
supportsSystemMessage: 'system-role' as const,
|
||||
specialToolFormat: 'openai-style' as const,
|
||||
reasoningCapabilities: false as const,
|
||||
},
|
||||
'MiniMax-M2.7-highspeed': {
|
||||
contextWindow: 204_800,
|
||||
reservedOutputTokenSpace: 8_192,
|
||||
cost: { input: 0.60, output: 2.40 },
|
||||
downloadable: false,
|
||||
supportsFIM: false,
|
||||
supportsSystemMessage: 'system-role' as const,
|
||||
specialToolFormat: 'openai-style' as const,
|
||||
reasoningCapabilities: false as const,
|
||||
},
|
||||
'MiniMax-M2.5': {
|
||||
contextWindow: 204_800,
|
||||
reservedOutputTokenSpace: 8_192,
|
||||
cost: { input: 0.30, output: 1.20 },
|
||||
downloadable: false,
|
||||
supportsFIM: false,
|
||||
supportsSystemMessage: 'system-role' as const,
|
||||
specialToolFormat: 'openai-style' as const,
|
||||
reasoningCapabilities: false as const,
|
||||
},
|
||||
'MiniMax-M2.5-highspeed': {
|
||||
contextWindow: 204_800,
|
||||
reservedOutputTokenSpace: 8_192,
|
||||
cost: { input: 0.60, output: 2.40 },
|
||||
downloadable: false,
|
||||
supportsFIM: false,
|
||||
supportsSystemMessage: 'system-role' as const,
|
||||
specialToolFormat: 'openai-style' as const,
|
||||
reasoningCapabilities: false as const,
|
||||
},
|
||||
} as const satisfies { [s: string]: VoidStaticModelInfo }
|
||||
|
||||
const minimaxSettings: VoidStaticProviderInfo = {
|
||||
modelOptions: minimaxModelOptions,
|
||||
modelOptionsFallback: (modelName) => {
|
||||
const lower = modelName.toLowerCase()
|
||||
if (lower.includes('minimax')) return { modelName: 'MiniMax-M2.7', recognizedModelName: 'MiniMax-M2.7', ...minimaxModelOptions['MiniMax-M2.7'] }
|
||||
return null
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ---------------- MISTRAL ----------------
|
||||
|
||||
const mistralModelOptions = { // https://mistral.ai/products/la-plateforme#pricing https://docs.mistral.ai/getting-started/models/models_overview/#premier-models
|
||||
|
|
@ -1474,6 +1538,7 @@ const modelSettingsOfProvider: { [providerName in ProviderName]: VoidStaticProvi
|
|||
googleVertex: googleVertexSettings,
|
||||
microsoftAzure: microsoftAzureSettings,
|
||||
awsBedrock: awsBedrockSettings,
|
||||
minimax: minimaxSettings,
|
||||
} as const
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -106,6 +106,9 @@ export const displayInfoOfProviderName = (providerName: ProviderName): DisplayIn
|
|||
else if (providerName === 'awsBedrock') {
|
||||
return { title: 'AWS Bedrock', }
|
||||
}
|
||||
else if (providerName === 'minimax') {
|
||||
return { title: 'MiniMax', }
|
||||
}
|
||||
|
||||
throw new Error(`descOfProviderName: Unknown provider name: "${providerName}"`)
|
||||
}
|
||||
|
|
@ -128,6 +131,7 @@ export const subTextMdOfProviderName = (providerName: ProviderName): string => {
|
|||
if (providerName === 'vLLM') return 'Read more about custom [Endpoints here](https://docs.vllm.ai/en/latest/getting_started/quickstart.html#openai-compatible-server).'
|
||||
if (providerName === 'lmStudio') return 'Read more about custom [Endpoints here](https://lmstudio.ai/docs/app/api/endpoints/openai).'
|
||||
if (providerName === 'liteLLM') return 'Read more about endpoints [here](https://docs.litellm.ai/docs/providers/openai_compatible).'
|
||||
if (providerName === 'minimax') return 'Get your [API Key here](https://platform.minimax.io). Read more about [models here](https://platform.minimax.io/docs/api-reference/text-openai-api).'
|
||||
|
||||
throw new Error(`subTextMdOfProviderName: Unknown provider name: "${providerName}"`)
|
||||
}
|
||||
|
|
@ -156,6 +160,7 @@ export const displayInfoOfSettingName = (providerName: ProviderName, settingName
|
|||
providerName === 'googleVertex' ? 'AIzaSy...' :
|
||||
providerName === 'microsoftAzure' ? 'key-...' :
|
||||
providerName === 'awsBedrock' ? 'key-...' :
|
||||
providerName === 'minimax' ? 'eyJhbGci...' :
|
||||
'',
|
||||
|
||||
isPasswordField: true,
|
||||
|
|
@ -352,6 +357,12 @@ export const defaultSettingsOfProvider: SettingsOfProvider = {
|
|||
...modelInfoOfDefaultModelNames(defaultModelsOfProvider.awsBedrock),
|
||||
_didFillInProviderSettings: undefined,
|
||||
},
|
||||
minimax: {
|
||||
...defaultCustomSettings,
|
||||
...defaultProviderSettings.minimax,
|
||||
...modelInfoOfDefaultModelNames(defaultModelsOfProvider.minimax),
|
||||
_didFillInProviderSettings: undefined,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -167,6 +167,10 @@ const newOpenAICompatibleSDK = async ({ settingsOfProvider, providerName, includ
|
|||
const thisConfig = settingsOfProvider[providerName]
|
||||
return new OpenAI({ baseURL: 'https://api.mistral.ai/v1', apiKey: thisConfig.apiKey, ...commonPayloadOpts })
|
||||
}
|
||||
else if (providerName === 'minimax') {
|
||||
const thisConfig = settingsOfProvider[providerName]
|
||||
return new OpenAI({ baseURL: 'https://api.minimax.io/v1', apiKey: thisConfig.apiKey, ...commonPayloadOpts })
|
||||
}
|
||||
|
||||
else throw new Error(`Void providerName was invalid: ${providerName}.`)
|
||||
}
|
||||
|
|
@ -937,6 +941,11 @@ export const sendLLMMessageToProviderImplementation = {
|
|||
sendFIM: null,
|
||||
list: null,
|
||||
},
|
||||
minimax: {
|
||||
sendChat: (params) => _sendOpenAICompatibleChat(params),
|
||||
sendFIM: null,
|
||||
list: null,
|
||||
},
|
||||
|
||||
} satisfies CallFnOfProvider
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue