Register MiniMax-M3/M2.7 context, thinking, and pricing parameters - #11
Open
octo-patch wants to merge 1 commit into
Open
Conversation
Add the MiniMax-M3 (1,000,000-token) and MiniMax-M2.7 (204,800-token) context windows, detect their thinking modes (M3 adaptive/off, M2.7 always-on), and bill both through a per-model pricing lookup instead of the fixed Claude rates. Mirrored across the TypeScript and Python backends.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reason: MiniMax model parameters were missing, so MiniMax-M3/M2.7 fell back to generic context, thinking, and pricing defaults.
What changed
Both the TypeScript (
src/) and Python (python/mini_claude/) backends now carry the MiniMax model metadata instead of treating those models as unknown fallbacks:MiniMax-M3at 1,000,000 tokens andMiniMax-M2.7at 204,800 tokens inMODEL_CONTEXT, so they no longer collapse to the 200,000-token default.modelSupportsThinking/_model_supports_thinkingnow recognize MiniMax models (M3 exposes adaptive/off, M2.7 is always-on), andmodelSupportsAdaptiveThinking/_model_supports_adaptive_thinkingtreat onlyMiniMax-M3as adaptive (M2.7 keeps thinking always-on).getModelPricing/get_model_pricinglookup with a default that preserves the previous fixed rates (input $3, output $15, cache read 0.1x, cache write 1.25x per million tokens) and MiniMax overrides: M3 at $0.6 input / $2.4 output / $0.12 cache read (cache write billed at the input rate, as no separate rate is published), and M2.7 at $0.3 input / $1.2 output / $0.06 cache read / $0.375 cache write. Budget enforcement (getCurrentCostUsd/_get_current_cost_usd) and the per-turn cost line now bill through this lookup, so a MiniMax run is no longer charged at Claude rates.Non-MiniMax models keep their previous behavior via the default entry.
Checks
npm run buildnpm run test:unit(13 passed)npm run test:integration(51 passed)npm run test:py(13 passed)