Skip to content
Merged
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
6 changes: 6 additions & 0 deletions packages/i18n/src/locales/en/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,12 @@ pages:
azure-ai-foundry:
description: Azure AI Foundry
title: Azure AI Foundry
minimax:
description: minimaxi.com
title: MiniMax
minimax-global:
description: minimax.io
title: MiniMax Global
mistral:
description: mistral.ai
title: Mistral
Expand Down
6 changes: 6 additions & 0 deletions packages/i18n/src/locales/es/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,12 @@ pages:
azure-ai-foundry:
description: Azure AI Foundry
title: Azure AI Foundry
minimax:
description: minimaxi.com
title: MiniMax
minimax-global:
description: minimax.io
title: MiniMax Global
mistral:
description: mistral.ai
title: Mistral
Expand Down
6 changes: 6 additions & 0 deletions packages/i18n/src/locales/fr/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,12 @@ pages:
azure-ai-foundry:
description: Azure AI Foundry
title: Azure AI Foundry
minimax:
description: minimaxi.com
title: MiniMax
minimax-global:
description: minimax.io
title: MiniMax Global
mistral:
description: mistral.ai
title: Mistral
Expand Down
6 changes: 6 additions & 0 deletions packages/i18n/src/locales/ja/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,12 @@ pages:
azure-ai-foundry:
description: Azure AI Foundry
title: Azure AI Foundry
minimax:
description: minimaxi.com
title: MiniMax
minimax-global:
description: minimax.io
title: MiniMax Global
mistral:
description: mistral.ai
title: Mistral
Expand Down
6 changes: 6 additions & 0 deletions packages/i18n/src/locales/ko/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,12 @@ pages:
azure-ai-foundry:
description: Azure AI Foundry
title: Azure AI Foundry
minimax:
description: minimaxi.com
title: MiniMax
minimax-global:
description: minimax.io
title: MiniMax Global
mistral:
description: mistral.ai
title: Mistral
Expand Down
6 changes: 6 additions & 0 deletions packages/i18n/src/locales/ru/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,12 @@ pages:
azure-ai-foundry:
description: Azure AI Foundry
title: Azure AI Foundry
minimax:
description: minimaxi.com
title: MiniMax
minimax-global:
description: minimax.io
title: MiniMax Global
mistral:
description: mistral.ai
title: Mistral
Expand Down
6 changes: 6 additions & 0 deletions packages/i18n/src/locales/vi/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,12 @@ pages:
azure-ai-foundry:
description: Azure AI Foundry
title: Azure AI Foundry
minimax:
description: minimaxi.com
title: MiniMax
minimax-global:
description: minimax.io
title: MiniMax Global
mistral:
description: mistral.ai
title: Mistral
Expand Down
6 changes: 6 additions & 0 deletions packages/i18n/src/locales/zh-Hans/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,12 @@ pages:
azure-ai-foundry:
description: Azure AI Foundry
title: Azure AI Foundry
minimax:
description: minimaxi.com
title: MiniMax
minimax-global:
description: minimax.io
title: MiniMax Global
mistral:
description: mistral.ai
title: Mistral
Expand Down
6 changes: 6 additions & 0 deletions packages/i18n/src/locales/zh-Hant/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,12 @@ pages:
azure-ai-foundry:
description: Azure AI Foundry
title: Azure AI Foundry
minimax:
description: minimaxi.com
title: MiniMax
minimax-global:
description: minimax.io
title: MiniMax Global
mistral:
description: mistral.ai
title: Mistral
Expand Down
1 change: 1 addition & 0 deletions packages/stage-ui/src/libs/providers/providers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import './fireworks-ai'
import './featherless-ai'
import './comet-api'
import './perplexity-ai'
import './minimax'
import './mistral-ai'
import './moonshot-ai'
import './modelscope'
Expand Down
148 changes: 148 additions & 0 deletions packages/stage-ui/src/libs/providers/providers/minimax/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
import type { ModelInfo } from '../../types'

import { createMinimax, createMinimaxCn } from '@xsai-ext/providers/create'
import { z } from 'zod'

import { createOpenAICompatibleValidators } from '../../validators/openai-compatible'
import { defineProvider } from '../registry'

const minimaxCnConfigSchema = z.object({
apiKey: z
.string('API Key'),
baseUrl: z
.string('Base URL')
.optional()
.default('https://api.minimaxi.com/v1/'),
})

type MinimaxCnConfig = z.input<typeof minimaxCnConfigSchema>

const minimaxGlobalConfigSchema = z.object({
apiKey: z
.string('API Key'),
baseUrl: z
.string('Base URL')
.optional()
.default('https://api.minimax.io/v1/'),
})

type MinimaxGlobalConfig = z.input<typeof minimaxGlobalConfigSchema>

const minimaxModels: ModelInfo[] = [
{
id: 'MiniMax-M2.5',
name: 'MiniMax M2.5',
provider: 'minimax',
description: 'Top performance and cost-effectiveness for complex tasks',
},
{
id: 'MiniMax-M2.5-highspeed',
name: 'MiniMax M2.5 Highspeed',
provider: 'minimax',
description: 'M2.5 high-speed version with same quality',
},
{
id: 'MiniMax-M2.1',
name: 'MiniMax M2.1',
provider: 'minimax',
description: 'Strong multilingual programming capabilities',
},
{
id: 'MiniMax-M2.1-highspeed',
name: 'MiniMax M2.1 Highspeed',
provider: 'minimax',
description: 'M2.1 high-speed version with same quality',
},
{
id: 'M2-her',
name: 'MiniMax M2-her',
provider: 'minimax',
description: 'Specialized for roleplay and multi-turn dialogue',
},
{
id: 'MiniMax-M2',
name: 'MiniMax M2',
provider: 'minimax',
description: 'Designed for efficient coding and agent workflows',
},
]

export const providerMinimax = defineProvider<MinimaxCnConfig>({
id: 'minimax',
name: 'MiniMax',
nameLocalize: ({ t }) => t('settings.pages.providers.provider.minimax.title'),
description: 'minimaxi.com',
descriptionLocalize: ({ t }) => t('settings.pages.providers.provider.minimax.description'),
tasks: ['chat'],
icon: 'i-lobe-icons:minimax',
iconColor: 'i-lobe-icons:minimax-color',

createProviderConfig: ({ t }) => minimaxCnConfigSchema.extend({
apiKey: minimaxCnConfigSchema.shape.apiKey.meta({
labelLocalized: t('settings.pages.providers.catalog.edit.config.common.fields.field.api-key.label'),
descriptionLocalized: t('settings.pages.providers.catalog.edit.config.common.fields.field.api-key.description'),
placeholderLocalized: t('settings.pages.providers.catalog.edit.config.common.fields.field.api-key.placeholder'),
type: 'password',
}),
baseUrl: minimaxCnConfigSchema.shape.baseUrl.meta({
labelLocalized: t('settings.pages.providers.catalog.edit.config.common.fields.field.base-url.label'),
descriptionLocalized: t('settings.pages.providers.catalog.edit.config.common.fields.field.base-url.description'),
placeholderLocalized: t('settings.pages.providers.catalog.edit.config.common.fields.field.base-url.placeholder'),
}),
}),
createProvider(config) {
return createMinimaxCn(config.apiKey, config.baseUrl)
},

extraMethods: {
listModels: async () => minimaxModels,
},
validationRequiredWhen(config) {
return !!config.apiKey?.trim()
},
validators: {
...createOpenAICompatibleValidators({
checks: ['connectivity'],
}),
},
})

export const providerMinimaxGlobal = defineProvider<MinimaxGlobalConfig>({
id: 'minimax-global',
name: 'MiniMax Global',
nameLocalize: ({ t }) => t('settings.pages.providers.provider.minimax-global.title'),
description: 'minimax.io',
descriptionLocalize: ({ t }) => t('settings.pages.providers.provider.minimax-global.description'),
tasks: ['chat'],
icon: 'i-lobe-icons:minimax',
iconColor: 'i-lobe-icons:minimax-color',

createProviderConfig: ({ t }) => minimaxGlobalConfigSchema.extend({
apiKey: minimaxGlobalConfigSchema.shape.apiKey.meta({
labelLocalized: t('settings.pages.providers.catalog.edit.config.common.fields.field.api-key.label'),
descriptionLocalized: t('settings.pages.providers.catalog.edit.config.common.fields.field.api-key.description'),
placeholderLocalized: t('settings.pages.providers.catalog.edit.config.common.fields.field.api-key.placeholder'),
type: 'password',
}),
baseUrl: minimaxGlobalConfigSchema.shape.baseUrl.meta({
labelLocalized: t('settings.pages.providers.catalog.edit.config.common.fields.field.base-url.label'),
descriptionLocalized: t('settings.pages.providers.catalog.edit.config.common.fields.field.base-url.description'),
placeholderLocalized: t('settings.pages.providers.catalog.edit.config.common.fields.field.base-url.placeholder'),
}),
}),
createProvider(config) {
return createMinimax(config.apiKey, config.baseUrl)
},

extraMethods: {
listModels: async () => minimaxModels.map(m => ({ ...m, provider: 'minimax-global' })),
},
validationRequiredWhen(config) {
return !!config.apiKey?.trim()
},
validators: {
...createOpenAICompatibleValidators({
checks: ['connectivity'],
}),
},
})
46 changes: 46 additions & 0 deletions packages/stage-ui/src/stores/providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import {
createDeepSeek,
createFireworks,
createGoogleGenerativeAI,
createMinimax,
createMinimaxCn,
createMistral,
createMoonshotai,
createNovita,
Expand Down Expand Up @@ -1997,6 +1999,50 @@ export const useProvidersStore = defineStore('providers', () => {
validation: ['health', 'model_list'],
iconColor: 'i-lobe-icons:mistral',
}),
'minimax': buildOpenAICompatibleProvider({
id: 'minimax',
name: 'MiniMax',
nameKey: 'settings.pages.providers.provider.minimax.title',
descriptionKey: 'settings.pages.providers.provider.minimax.description',
icon: 'i-lobe-icons:minimax',
description: 'minimaxi.com',
defaultBaseUrl: 'https://api.minimaxi.com/v1/',
creator: createMinimaxCn,
validation: ['health'],
iconColor: 'i-lobe-icons:minimax-color',
capabilities: {
listModels: async () => [
{ id: 'MiniMax-M2.5', name: 'MiniMax M2.5', provider: 'minimax', description: 'Top performance and cost-effectiveness for complex tasks' },
{ id: 'MiniMax-M2.5-highspeed', name: 'MiniMax M2.5 Highspeed', provider: 'minimax', description: 'M2.5 high-speed version with same quality' },
{ id: 'MiniMax-M2.1', name: 'MiniMax M2.1', provider: 'minimax', description: 'Strong multilingual programming capabilities' },
{ id: 'MiniMax-M2.1-highspeed', name: 'MiniMax M2.1 Highspeed', provider: 'minimax', description: 'M2.1 high-speed version with same quality' },
{ id: 'M2-her', name: 'MiniMax M2-her', provider: 'minimax', description: 'Specialized for roleplay and multi-turn dialogue' },
{ id: 'MiniMax-M2', name: 'MiniMax M2', provider: 'minimax', description: 'Designed for efficient coding and agent workflows' },
],
},
}),
'minimax-global': buildOpenAICompatibleProvider({
id: 'minimax-global',
name: 'MiniMax Global',
nameKey: 'settings.pages.providers.provider.minimax-global.title',
descriptionKey: 'settings.pages.providers.provider.minimax-global.description',
icon: 'i-lobe-icons:minimax',
description: 'minimax.io',
defaultBaseUrl: 'https://api.minimax.io/v1/',
creator: createMinimax,
validation: ['health'],
iconColor: 'i-lobe-icons:minimax-color',
capabilities: {
listModels: async () => [
{ id: 'MiniMax-M2.5', name: 'MiniMax M2.5', provider: 'minimax-global', description: 'Top performance and cost-effectiveness for complex tasks' },
{ id: 'MiniMax-M2.5-highspeed', name: 'MiniMax M2.5 Highspeed', provider: 'minimax-global', description: 'M2.5 high-speed version with same quality' },
{ id: 'MiniMax-M2.1', name: 'MiniMax M2.1', provider: 'minimax-global', description: 'Strong multilingual programming capabilities' },
{ id: 'MiniMax-M2.1-highspeed', name: 'MiniMax M2.1 Highspeed', provider: 'minimax-global', description: 'M2.1 high-speed version with same quality' },
{ id: 'M2-her', name: 'MiniMax M2-her', provider: 'minimax-global', description: 'Specialized for roleplay and multi-turn dialogue' },
{ id: 'MiniMax-M2', name: 'MiniMax M2', provider: 'minimax-global', description: 'Designed for efficient coding and agent workflows' },
],
},
}),
'moonshot-ai': buildOpenAICompatibleProvider({
id: 'moonshot-ai',
name: 'Moonshot AI',
Expand Down
6 changes: 3 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.