Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions src/vs/workbench/contrib/void/common/modelCapabilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ export const defaultProviderSettings = {
region: 'us-east-1', // add region setting
endpoint: '', // optionally allow overriding default
},
minimax: {
apiKey: '',
},

} as const

Expand Down Expand Up @@ -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[]>
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1474,6 +1538,7 @@ const modelSettingsOfProvider: { [providerName in ProviderName]: VoidStaticProvi
googleVertex: googleVertexSettings,
microsoftAzure: microsoftAzureSettings,
awsBedrock: awsBedrockSettings,
minimax: minimaxSettings,
} as const


Expand Down
11 changes: 11 additions & 0 deletions src/vs/workbench/contrib/void/common/voidSettingsTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}"`)
}
Expand All @@ -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}"`)
}
Expand Down Expand Up @@ -156,6 +160,7 @@ export const displayInfoOfSettingName = (providerName: ProviderName, settingName
providerName === 'googleVertex' ? 'AIzaSy...' :
providerName === 'microsoftAzure' ? 'key-...' :
providerName === 'awsBedrock' ? 'key-...' :
providerName === 'minimax' ? 'eyJhbGci...' :
'',

isPasswordField: true,
Expand Down Expand Up @@ -352,6 +357,12 @@ export const defaultSettingsOfProvider: SettingsOfProvider = {
...modelInfoOfDefaultModelNames(defaultModelsOfProvider.awsBedrock),
_didFillInProviderSettings: undefined,
},
minimax: {
...defaultCustomSettings,
...defaultProviderSettings.minimax,
...modelInfoOfDefaultModelNames(defaultModelsOfProvider.minimax),
_didFillInProviderSettings: undefined,
},
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}.`)
}
Expand Down Expand Up @@ -937,6 +941,11 @@ export const sendLLMMessageToProviderImplementation = {
sendFIM: null,
list: null,
},
minimax: {
sendChat: (params) => _sendOpenAICompatibleChat(params),
sendFIM: null,
list: null,
},

} satisfies CallFnOfProvider

Expand Down