Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

feat: add MiniMax as a predefined cloud provider

PR Botfcc5324b95b7
diff --git a/README.md b/README.md
index 9f0b3261b..58da60730 100644
--- a/README.md
+++ b/README.md
@@ -84,7 +84,7 @@ Download from [jan.ai](https://jan.ai/) or [GitHub Releases](https://github.com/
## Features
- **Local AI Models**: Download and run LLMs (Llama, Gemma, Qwen, GPT-oss etc.) from HuggingFace
-- **Cloud Integration**: Connect to GPT models via OpenAI, Claude models via Anthropic, Mistral, Groq, and others
+- **Cloud Integration**: Connect to GPT models via OpenAI, Claude models via Anthropic, Mistral, Groq, MiniMax, and others
- **Custom Assistants**: Create specialized AI assistants for your tasks
- **OpenAI-Compatible API**: Local server at `localhost:1337` for other applications
- **Model Context Protocol**: MCP integration for agentic capabilities
diff --git a/web-app/src/constants/models.ts b/web-app/src/constants/models.ts
index 2efae9957..a91b928de 100644
--- a/web-app/src/constants/models.ts
+++ b/web-app/src/constants/models.ts
@@ -109,6 +109,15 @@ export const providerModels = {
supportsToolCalls: ['sonar', 'sonar-pro', 'sonar-reasoning-pro'],
supportsN: true,
},
+ minimax: {
+ models: ['MiniMax-M2.5', 'MiniMax-M2.5-highspeed'],
+ supportsCompletion: true,
+ supportsStreaming: ['MiniMax-M2.5', 'MiniMax-M2.5-highspeed'],
+ supportsJSON: [],
+ supportsImages: [],
+ supportsToolCalls: ['MiniMax-M2.5', 'MiniMax-M2.5-highspeed'],
+ supportsN: true,
+ },
openrouter: {
models: true,
supportsCompletion: true,
diff --git a/web-app/src/constants/providers.ts b/web-app/src/constants/providers.ts
index ed3407141..73565f662 100644
--- a/web-app/src/constants/providers.ts
+++ b/web-app/src/constants/providers.ts
@@ -325,6 +325,55 @@ export const predefinedProviders = [
],
models: [],
},
+ {
+ active: true,
+ api_key: '',
+ base_url: 'https://api.minimax.io/v1',
+ explore_models_url: 'https://platform.minimax.io/docs/api-reference/text-openai-api',
+ provider: 'minimax',
+ settings: [
+ {
+ key: 'api-key',
+ title: 'API Key',
+ description:
+ "The MiniMax API uses API keys for authentication. Visit your [API Keys](https://platform.minimax.io/user-center/basic-information/interface-key) page to retrieve the API key you'll use in your requests.",
+ controller_type: 'input',
+ controller_props: {
+ placeholder: 'Insert API Key',
+ value: '',
+ type: 'password',
+ input_actions: ['unobscure', 'copy'],
+ },
+ },
+ {
+ key: 'base-url',
+ title: 'Base URL',
+ description:
+ 'The base endpoint to use. Use `https://api.minimax.io/v1` for global access or `https://api.minimaxi.com/v1` for users in China. See the [MiniMax API documentation](https://platform.minimax.io/docs/api-reference/text-openai-api) for more information.',
+ controller_type: 'input',
+ controller_props: {
+ placeholder: 'https://api.minimax.io/v1',
+ value: 'https://api.minimax.io/v1',
+ },
+ },
+ ],
+ models: [
+ {
+ id: 'MiniMax-M2.5',
+ name: 'MiniMax-M2.5',
+ version: '1.0',
+ description: 'Peak Performance. Ultimate Value. Master the Complex. 204K context window.',
+ capabilities: ['completion', 'tools'],
+ },
+ {
+ id: 'MiniMax-M2.5-highspeed',
+ name: 'MiniMax-M2.5-highspeed',
+ version: '1.0',
+ description: 'Same performance, faster and more agile. 204K context window.',
+ capabilities: ['completion', 'tools'],
+ },
+ ],
+ },
{
active: true,
api_key: '',
diff --git a/web-app/src/lib/__tests__/model-factory.test.ts b/web-app/src/lib/__tests__/model-factory.test.ts
index 7d6d939bf..4d18a3c05 100644
--- a/web-app/src/lib/__tests__/model-factory.test.ts
+++ b/web-app/src/lib/__tests__/model-factory.test.ts
@@ -105,6 +105,21 @@ describe('ModelFactory', () => {
expect(model.type).toBe('openai-compatible')
})
+ it('should create an OpenAI-compatible model for minimax provider', async () => {
+ const provider: ProviderObject = {
+ provider: 'minimax',
+ api_key: 'test-api-key',
+ base_url: 'https://api.minimax.io/v1',
+ models: [],
+ settings: [],
+ active: true,
+ }
+
+ const model = await ModelFactory.createModel('MiniMax-M2.5', provider)
+ expect(model).toBeDefined()
+ expect(model.type).toBe('openai-compatible')
+ })
+
it('should handle custom headers for OpenAI-compatible providers', async () => {
const provider: ProviderObject = {
provider: 'custom',
diff --git a/web-app/src/lib/model-factory.ts b/web-app/src/lib/model-factory.ts
index bb67f74d6..c25dd3d0c 100644
--- a/web-app/src/lib/model-factory.ts
+++ b/web-app/src/lib/model-factory.ts
@@ -180,6 +180,7 @@ export class ModelFactory {
case 'cohere':
case 'perplexity':
case 'moonshot':
+ case 'minimax':
return this.createOpenAICompatibleModel(modelId, provider)
case 'xai':