From f10f16f444f7735673f0013b9cd5748555999023 Mon Sep 17 00:00:00 2001 From: octo-patch <266937838+octo-patch@users.noreply.github.com> Date: Thu, 9 Jul 2026 07:08:07 +0000 Subject: [PATCH] fix: update MiniMax M3 model metadata Keep MiniMax M3 token limits and cost tracking aligned with current provider documentation. Co-Authored-By: Claude Opus 4.7 --- scrapegraphai/helpers/models_tokens.py | 2 +- scrapegraphai/utils/model_costs.py | 2 ++ tests/test_minimax_models.py | 26 +++++++++++++++++++++++++- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/scrapegraphai/helpers/models_tokens.py b/scrapegraphai/helpers/models_tokens.py index 17f855833..c109a352e 100644 --- a/scrapegraphai/helpers/models_tokens.py +++ b/scrapegraphai/helpers/models_tokens.py @@ -408,7 +408,7 @@ "grok-beta": 128000, }, "minimax": { - "MiniMax-M3": 524288, + "MiniMax-M3": 1000000, "MiniMax-M2.7": 204000, "MiniMax-M2.7-highspeed": 204000, }, diff --git a/scrapegraphai/utils/model_costs.py b/scrapegraphai/utils/model_costs.py index 0b8fb9ec3..e303751a1 100644 --- a/scrapegraphai/utils/model_costs.py +++ b/scrapegraphai/utils/model_costs.py @@ -50,6 +50,7 @@ "amazon.titan-text-express-v1": 0.0002, "amazon.titan-text-lite-v1": 0.00015, "amazon.titan-text-premier-v1:0": 0.0005, + "MiniMax-M3": 0.0006, } """ @@ -102,4 +103,5 @@ "amazon.titan-text-express-v1": 0.0006, "amazon.titan-text-lite-v1": 0.0002, "amazon.titan-text-premier-v1:0": 0.0015, + "MiniMax-M3": 0.0024, } diff --git a/tests/test_minimax_models.py b/tests/test_minimax_models.py index ec41d5e9d..c796d193d 100644 --- a/tests/test_minimax_models.py +++ b/tests/test_minimax_models.py @@ -25,6 +25,24 @@ def models_tokens(): return module.models_tokens +@pytest.fixture(scope="module") +def model_costs(): + """Import model_costs directly to avoid triggering the full package init.""" + spec = importlib.util.spec_from_file_location( + "model_costs", + os.path.join( + os.path.dirname(__file__), + "..", + "scrapegraphai", + "utils", + "model_costs.py", + ), + ) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + return module + + def test_minimax_m3_in_model_list(models_tokens): """MiniMax-M3 should be in the model list.""" minimax_models = models_tokens["minimax"] @@ -57,6 +75,12 @@ def test_minimax_deprecated_models_removed(models_tokens): def test_minimax_token_limits(models_tokens): """MiniMax model token limits should match upstream documentation.""" minimax_models = models_tokens["minimax"] - assert minimax_models["MiniMax-M3"] == 524288 + assert minimax_models["MiniMax-M3"] == 1000000 assert minimax_models["MiniMax-M2.7"] == 204000 assert minimax_models["MiniMax-M2.7-highspeed"] == 204000 + + +def test_minimax_m3_cost(model_costs): + """MiniMax-M3 pricing should match upstream documentation.""" + assert model_costs.MODEL_COST_PER_1K_TOKENS_INPUT["MiniMax-M3"] == 0.0006 + assert model_costs.MODEL_COST_PER_1K_TOKENS_OUTPUT["MiniMax-M3"] == 0.0024