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
16 changes: 16 additions & 0 deletions packages/core/src/core/tokenLimits.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,22 @@ describe('tokenLimit', () => {
});
});

describe('MiniMax', () => {
it('should return the correct limit for MiniMax-M3', () => {
expect(tokenLimit('MiniMax-M3')).toBe(1_000_000);
expect(tokenLimit('minimax-m3')).toBe(1_000_000);
expect(tokenLimit('minimax-m3-20250101')).toBe(1_000_000);
});
it('should return the correct limit for MiniMax-M2.7', () => {
expect(tokenLimit('MiniMax-M2.7')).toBe(204_800);
expect(tokenLimit('minimax-m2.7')).toBe(204_800);
});
it('should not fall back to the default for MiniMax models', () => {
expect(tokenLimit('MiniMax-M3')).not.toBe(DEFAULT_TOKEN_LIMIT);
expect(tokenLimit('MiniMax-M2.7')).not.toBe(DEFAULT_TOKEN_LIMIT);
});
});

describe('Other models', () => {
it('should return the correct limit for deepseek-r1', () => {
expect(tokenLimit('deepseek-r1')).toBe(131072);
Expand Down
10 changes: 10 additions & 0 deletions packages/core/src/core/tokenLimits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ const LIMITS = {
'1m': 1_048_576,
'2m': 2_097_152,
'10m': 10_485_760, // 10 million tokens
// MiniMax vendor-declared exact context windows (decimal, not power-of-two)
'minimax-m3': 1_000_000, // MiniMax-M3: 1,000,000 tokens (1M decimal)
'minimax-m2.7': 204_800, // MiniMax-M2.7: 204,800 tokens
// Output token limits (typically much smaller than input limits)
'4k': 4_096,
'8k': 8_192,
Expand Down Expand Up @@ -141,6 +144,13 @@ const PATTERNS: Array<[RegExp, TokenCount]> = [
// Generic vision-model: same as qwen-vl-max (128K token context)
[/^vision-model$/, LIMITS['128k']],

// -------------------
// MiniMax
// -------------------
// MiniMax-M3: 1,000,000-token context window (vendor-declared decimal).
[/^minimax-m2\.7.*$/, LIMITS['minimax-m2.7']], // more specific (dotted) first
[/^minimax-m3.*$/, LIMITS['minimax-m3']],

// -------------------
// ByteDance Seed-OSS (512K)
// -------------------
Expand Down