-
Notifications
You must be signed in to change notification settings - Fork 2k
feat: upgrade MiniMax default model to M3 #3089
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ import type { LanguageModel } from 'ai'; | |
|
|
||
| export enum LLMProvider { | ||
| OPENROUTER = 'openrouter', | ||
| MINIMAX = 'minimax', | ||
| } | ||
|
|
||
| export enum OPENROUTER_MODELS { | ||
|
|
@@ -13,8 +14,15 @@ export enum OPENROUTER_MODELS { | |
| OPEN_AI_GPT_5_NANO = 'openai/gpt-5-nano', | ||
| } | ||
|
|
||
| export enum MINIMAX_MODELS { | ||
| MINIMAX_M3 = 'MiniMax-M3', | ||
| MINIMAX_M2_7 = 'MiniMax-M2.7', | ||
| MINIMAX_M2_7_HIGHSPEED = 'MiniMax-M2.7-highspeed', | ||
| } | ||
|
|
||
| interface ModelMapping { | ||
| [LLMProvider.OPENROUTER]: OPENROUTER_MODELS; | ||
| [LLMProvider.MINIMAX]: MINIMAX_MODELS; | ||
| } | ||
|
|
||
| export type InitialModelPayload = { | ||
|
|
@@ -37,4 +45,7 @@ export const MODEL_MAX_TOKENS = { | |
| [OPENROUTER_MODELS.OPEN_AI_GPT_5_NANO]: 400000, | ||
| [OPENROUTER_MODELS.OPEN_AI_GPT_5_MINI]: 400000, | ||
| [OPENROUTER_MODELS.OPEN_AI_GPT_5]: 400000, | ||
| [MINIMAX_MODELS.MINIMAX_M3]: 512000, | ||
| [MINIMAX_MODELS.MINIMAX_M2_7]: 204000, | ||
| [MINIMAX_MODELS.MINIMAX_M2_7_HIGHSPEED]: 204000, | ||
|
Comment on lines
+48
to
+50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: The maximum context window sizes (token limits) for the specified MiniMax models are as follows: MiniMax M3: Supports a context window of 1,000,000 tokens [1][2][3]. MiniMax M2.7: Supports a context window of 204,800 tokens [2][4][5]. MiniMax M2.7-highspeed: Supports a context window of 204,800 tokens [2][6][7]. These limits reflect the official specifications provided in MiniMax's documentation and related technical resources [2][8][9]. Citations:
🌐 Web query:
💡 Result: According to the official MiniMax documentation, the MiniMax M3 text generation model supports a context window of 1,000,000 tokens [1][2]. The model leverages a proprietary architecture called MiniMax Sparse Attention (MSA) to achieve this capacity [1][3]. Some documentation also specifies that the model maintains a guaranteed minimum of 512,000 tokens within this context window [1][4]. Additionally, the model is noted to support a maximum output of 1,000,000 tokens per request [5][6]. Citations:
🌐 Web query:
💡 Result: According to the official MiniMax API documentation, the MiniMax M2.7 text generation model has a maximum context window size of 204,800 tokens [1][2][3]. This limit applies to the total number of input and output tokens combined [1]. Authoritative sources, including the MiniMax platform documentation and technical integrations, consistently cite this 204,800-token (often referred to as 200K) capacity for the M2.7 series [4][5][1][2]. While some local deployment or alternative environment documentation may reference specific usage constraints or rounded figures [6][7], the official API specifications maintain 204,800 as the standard context limit [1][3]. Citations:
🌐 Web query:
💡 Result: According to the official MiniMax API documentation, the MiniMax text generation model M2.7-highspeed has a context window size of 204,800 tokens [1][2][3]. This maximum token count refers to the combined total of both input and output tokens [2]. Citations:
🏁 Script executed: #!/bin/bash
set -euo pipefail
# Show the relevant portion of the file around the snippet
sed -n '1,140p' packages/models/src/llm/index.ts | nl -ba | sed -n '35,90p'
# Find the constant identifier(s) around those lines
rg -n "MINIMAX_MODELS|MAX_TOKENS|token" packages/models/src/llm/index.ts
# Show where MAX_TOKENS values are used (across repo) to interpret semantics
# (Limit search to minimax model usage)
rg -n "MINIMAX_MODELS.*M3|MINIMAX_M2_7|MINIMAX_M2_7_HIGHSPEED" -S packages/models/src/llmRepository: onlook-dev/onlook Length of output: 104 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Show relevant section with line numbers (nl not available)
cat -n packages/models/src/llm/index.ts | sed -n '35,90p'
# Locate related constants / token limit definitions
rg -n "MINIMAX_MODELS|MAX_TOKENS|token" packages/models/src/llm/index.ts
# Find where the specific MINIMAX_MODELS token values are used
rg -n "MINIMAX_MODELS\.MINIMAX_M3|MINIMAX_MODELS\.MINIMAX_M2_7|MINIMAX_MODELS\.MINIMAX_M2_7_HIGHSPEED" -S packages/models/src/llm
# Also search across repo in case values are referenced elsewhere
rg -n "MINIMAX_MODELS\.MINIMAX_M3|MINIMAX_MODELS\.MINIMAX_M2_7|MINIMAX_MODELS\.MINIMAX_M2_7_HIGHSPEED" -S .Repository: onlook-dev/onlook Length of output: 1540 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Find usages of MODEL_MAX_TOKENS
rg -n "MODEL_MAX_TOKENS" -S .
# Find how maxOutputTokens / token limits are used around providers
rg -n "maxOutputTokens" -S packages/models/src/llm packages -S
# Specifically see where token limits are enforced (truncate/chunk)
rg -n "truncate|truncat|token( |-|_)limit|max.*token|max_tokens|maxTokens|context window" -S packages/models/src/llm packages/models/srcRepository: onlook-dev/onlook Length of output: 949 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "---- packages/ai/src/chat/providers.ts ----"
cat -n packages/ai/src/chat/providers.ts | sed -n '1,140p'
echo
echo "---- chat-context.tsx ----"
cat -n apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-input/chat-context.tsx | sed -n '1,140p'
# Look for minimax request payload fields
echo
echo "---- Search for minimax request max_tokens fields ----"
rg -n "minimax|MINIMAX|max_tokens|maxTokens|maxOutputTokens|context|tokens" -S packages/ai/src/chat packages/ai/srcRepository: onlook-dev/onlook Length of output: 18637 🏁 Script executed: #!/bin/bash
set -euo pipefail
rg -n "maxOutputTokens" -S packages/ai/src
# Show likely call sites: files that call initModel or consume ModelConfig
rg -n "initModel\\(" -S packages/ai/src
# Follow MODEL_MAX_TOKENS usage further
rg -n "MODEL_MAX_TOKENS\\[" -S packages/ai/src packages -SRepository: onlook-dev/onlook Length of output: 701 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "---- packages/ai/src/agents/root.ts ----"
cat -n packages/ai/src/agents/root.ts | sed -n '1,180p'
echo
echo "---- usages of maxOutputTokens in packages/ai/src ----"
rg -n "maxOutputTokens" -S packages/ai/src
echo
echo "---- search for maxTokens / max_tokens in packages/ai/src ----"
rg -n "maxTokens|max_tokens|max_output_tokens" -S packages/ai/srcRepository: onlook-dev/onlook Length of output: 5197 🏁 Script executed: #!/bin/bash
set -euo pipefail
rg -n "maxOutputTokens" -S .
rg -n "maxTokens\\b|max_tokens\\b|maxOutput\\b" -S packages appsRepository: onlook-dev/onlook Length of output: 1960 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "---- chat/conversation.ts ----"
cat -n apps/web/client/src/server/api/routers/chat/conversation.ts | sed -n '1,200p'
echo
echo "---- chat/suggestion.ts ----"
cat -n apps/web/client/src/server/api/routers/chat/suggestion.ts | sed -n '1,120p'
echo
echo "---- project.ts around line ~329 ----"
cat -n apps/web/client/src/server/api/routers/project/project.ts | sed -n '280,380p'
echo
echo "---- search packages/ai for maxOutputTokens usage ----"
rg -n "maxOutputTokens" -S packages/ai/srcRepository: onlook-dev/onlook Length of output: 13385 🏁 Script executed: #!/bin/bash
set -euo pipefail
rg -n "LLMProvider\\.MINIMAX|MINIMAX_MODELS\\." -S .Repository: onlook-dev/onlook Length of output: 466 Align MiniMax
🤖 Prompt for AI Agents |
||
| } as const; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: onlook-dev/onlook
Length of output: 173
Update
@ai-sdk/openai-compatibleto a valid version.Version
1.0.34does not exist in the npm registry. The latest stable versions are2.0.8and2.0.9. Update the dependency to one of these versions or the latest available version that meets the project requirements.🤖 Prompt for AI Agents