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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ The **SRE** is the core runtime environment that powers SmythOS. Think of it as
**Supported Connectors:**

- **Storage**: Local, S3, Google Cloud, Azure
- **LLM**: OpenAI, Anthropic, Google AI, AWS Bedrock, Groq, Perplexity
- **LLM**: OpenAI, Anthropic, Google AI, AWS Bedrock, Groq, Perplexity, MiniMax
- **VectorDB**: Pinecone, Milvus, RAMVec
- **Cache**: RAM, Redis
- **Vault**: JSON File, AWS Secrets Manager, HashiCorp
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/subsystems/LLMManager/LLM.service/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export class LLMService extends ConnectorServiceProvider {
ConnectorService.register(TConnectorService.LLM, 'xAI', xAIConnector);
ConnectorService.register(TConnectorService.LLM, 'Perplexity', PerplexityConnector);
ConnectorService.register(TConnectorService.LLM, 'Ollama', OllamaConnector);
ConnectorService.register(TConnectorService.LLM, 'MiniMax', OpenAIConnector);
}

public init() {
Expand All @@ -43,5 +44,6 @@ export class LLMService extends ConnectorServiceProvider {
ConnectorService.init(TConnectorService.LLM, 'xAI');
ConnectorService.init(TConnectorService.LLM, 'Perplexity');
ConnectorService.init(TConnectorService.LLM, 'Ollama');
ConnectorService.init(TConnectorService.LLM, 'MiniMax');
}
}
73 changes: 73 additions & 0 deletions packages/core/src/subsystems/LLMManager/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2235,6 +2235,79 @@ export const models = {

// #endregion Together AI Models ==========================

// #region MiniMax Models ==========================

'minimax-m2.7': {
llm: 'MiniMax',

label: 'MiniMax M2.7',
modelId: 'MiniMax-M2.7',
provider: 'MiniMax',
features: ['text', 'tools'],
tags: ['New', 'Personal'],
tokens: 0,
completionTokens: 0,
enabled: false,
keyOptions: { tokens: 1_000_000, completionTokens: 16_384, enabled: true },

baseURL: 'https://api.minimax.io/v1',

credentials: 'vault',
},
'minimax-m2.7-highspeed': {
llm: 'MiniMax',

label: 'MiniMax M2.7 Highspeed',
modelId: 'MiniMax-M2.7-highspeed',
provider: 'MiniMax',
features: ['text', 'tools'],
tags: ['New', 'Personal'],
tokens: 0,
completionTokens: 0,
enabled: false,
keyOptions: { tokens: 1_000_000, completionTokens: 16_384, enabled: true },

baseURL: 'https://api.minimax.io/v1',

credentials: 'vault',
},
'minimax-m2.5': {
llm: 'MiniMax',

label: 'MiniMax M2.5',
modelId: 'MiniMax-M2.5',
provider: 'MiniMax',
features: ['text', 'tools'],
tags: ['Personal'],
tokens: 0,
completionTokens: 0,
enabled: false,
keyOptions: { tokens: 204_000, completionTokens: 16_384, enabled: true },

baseURL: 'https://api.minimax.io/v1',

credentials: 'vault',
},
'minimax-m2.5-highspeed': {
llm: 'MiniMax',

label: 'MiniMax M2.5 Highspeed',
modelId: 'MiniMax-M2.5-highspeed',
provider: 'MiniMax',
features: ['text', 'tools'],
tags: ['Personal'],
tokens: 0,
completionTokens: 0,
enabled: false,
keyOptions: { tokens: 204_000, completionTokens: 16_384, enabled: true },

baseURL: 'https://api.minimax.io/v1',

credentials: 'vault',
},

// #endregion MiniMax Models ==========================

// #region Image Generation Models ============================

// #region OpenAI Models gpt-image-1
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/types/LLM.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ export const BuiltinLLMProviders = {
xAI: 'xAI',
Perplexity: 'Perplexity',
Ollama: 'Ollama',
MiniMax: 'MiniMax',
} as const;
// Base provider type
export type TBuiltinLLMProvider = (typeof BuiltinLLMProviders)[keyof typeof BuiltinLLMProviders];
Expand Down
156 changes: 156 additions & 0 deletions packages/sdk/tests/integration/005-LLM/07-llm-minimax.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
// prettier-ignore-file
import { describe, it, expect, vi, beforeEach } from 'vitest';

import { LLM, LLMInstance, TLLMEvent } from '../../../src';

// Mock @smythos/sre dependencies for integration-style tests
vi.mock('@smythos/sre', async () => {
const EventEmitter = (await import('events')).EventEmitter;
class DummyRequester {
constructor(public candidate?: any) {}
async request(params: any) {
const userMsg = params?.messages?.find((m: any) => m.role === 'user')?.content || '';
const sysMsg = params?.messages?.find((m: any) => m.role === 'system')?.content || '';
return {
content: (sysMsg ? sysMsg + ' ' : '') + `Echo: ${userMsg}`,
finishReason: 'stop',
} as any;
}
async streamRequest(params: any) {
const emitter = new EventEmitter();
setTimeout(() => {
const userMsg = params?.messages?.find((m: any) => m.role === 'user')?.content || '';
emitter.emit('content', 'Echo: ' + userMsg);
emitter.emit('end');
}, 0);
return emitter as any;
}
}
return {
TLLMProvider: {
OpenAI: 'OpenAI',
MiniMax: 'MiniMax',
Anthropic: 'Anthropic',
GoogleAI: 'GoogleAI',
DeepSeek: 'DeepSeek',
Groq: 'Groq',
TogetherAI: 'TogetherAI',
Bedrock: 'Bedrock',
VertexAI: 'VertexAI',
xAI: 'xAI',
Perplexity: 'Perplexity',
Ollama: 'Ollama',
Echo: 'Echo',
},
TLLMEvent: {
Data: 'data',
Content: 'content',
Thinking: 'thinking',
End: 'end',
Abort: 'abort',
Error: 'error',
ToolInfo: 'toolInfo',
ToolCall: 'toolCall',
ToolResult: 'toolResult',
Usage: 'usage',
Interrupted: 'interrupted',
Fallback: 'fallback',
Requested: 'requested',
},
DEFAULT_TEAM_ID: 'default',
AccessCandidate: {
team: (id: string) => ({ type: 'team', id }),
},
ConnectorService: {
getModelsProviderConnector() {
return {
requester() {
return {
async getModels() {
return {
'MiniMax-M2.7': { tokens: 1000000, completionTokens: 16384, keyOptions: {} },
'MiniMax-M2.7-highspeed': { tokens: 1000000, completionTokens: 16384, keyOptions: {} },
'MiniMax-M2.5': { tokens: 204000, completionTokens: 16384, keyOptions: {} },
'MiniMax-M2.5-highspeed': { tokens: 204000, completionTokens: 16384, keyOptions: {} },
} as any;
},
} as any;
},
} as any;
},
getLLMConnector() {
return {
user(candidate: any) {
return new DummyRequester(candidate) as any;
},
} as any;
},
},
BinaryInput: class {},
SRE: { init: vi.fn(), ready: vi.fn().mockResolvedValue(true), initializing: false },
} as any;
});

describe('LLM - MiniMax integration', () => {
beforeEach(() => {
vi.clearAllMocks();
});

it('MiniMax M2.7 prompt returns expected content', async () => {
const llm = LLM.MiniMax('MiniMax-M2.7');
const res = await llm.prompt('Tell me a joke');
expect(res).toContain('Echo: Tell me a joke');
expect(typeof res).toBe('string');
});

it('MiniMax M2.7-highspeed prompt returns expected content', async () => {
const llm = LLM.MiniMax('MiniMax-M2.7-highspeed');
const res = await llm.prompt('What is AI?');
expect(res).toContain('Echo: What is AI?');
});

it('MiniMax M2.5 prompt returns expected content', async () => {
const llm = LLM.MiniMax('MiniMax-M2.5');
const res = await llm.prompt('Hello MiniMax');
expect(res).toContain('Echo: Hello MiniMax');
});

it('MiniMax streaming works correctly', async () => {
const llm = LLM.MiniMax('MiniMax-M2.7', { temperature: 0.7 });
const streamEvents = await llm.prompt('Stream test').stream();

return new Promise<void>((resolve, reject) => {
let receivedContent = false;

streamEvents.on('content', (content: string) => {
expect(content).toContain('Echo: Stream test');
receivedContent = true;
});

streamEvents.on('end', () => {
expect(receivedContent).toBe(true);
resolve();
});

streamEvents.on('error', (error: any) => {
reject(error);
});

// Timeout safety
setTimeout(() => {
if (!receivedContent) {
reject(new Error('Streaming timed out'));
}
}, 5000);
});
});

it('MiniMax with custom temperature and maxTokens', async () => {
const llm = LLM.MiniMax('MiniMax-M2.5-highspeed', {
temperature: 0.3,
maxTokens: 500,
});
const res = await llm.prompt('Custom params test');
expect(res).toContain('Echo: Custom params test');
});
});
Loading