Independent Auditing of AI Agents. Run by human or the agent itself, to answer the most crucial question in the AI Agent Economy. Is the agent doing what is supposed to do? With iFixAi you can have this answer in less than 120 seconds.
Python agent-evaluationaiai-alignmentai-evaluationai-governanceai-safetyclidiagnostic-tooleu-ai-acthallucination-detectioniso-42001llm-evaluationllm-securitynist-ai-rmfowasp-llmprompt-injectionpythonresponsible-airisk-assessmentrisk-management
Default MiniMax to M3.1 Flash (#355)
Octopus652a04b8c3a4
diff --git a/docs/testing-your-agent.md b/docs/testing-your-agent.mdindex bb9fa7c..32bd8a6 100644--- a/docs/testing-your-agent.md+++ b/docs/testing-your-agent.md@@ -134,7 +134,7 @@ the SUT key from the environment: pass `--api-key` / `-k`, or enter it when prom| `anthropic` | `.[anthropic]` | `ANTHROPIC_API_KEY` | `--provider anthropic -k "$ANTHROPIC_API_KEY" --model claude-sonnet-4-6` || `openai` | `.[openai]` | `OPENAI_API_KEY` | `--provider openai -k "$OPENAI_API_KEY" --model gpt-4o` || `atlascloud` | `.[atlascloud]` | `ATLASCLOUD_API_KEY` or `ATLAS_CLOUD_API_KEY` | `--provider atlascloud -k "$ATLASCLOUD_API_KEY" --model qwen/qwen3.5-flash` |-| `minimax` | none | `MINIMAX_API_KEY` | `--provider minimax -k "$MINIMAX_API_KEY" --model MiniMax-M3` |+| `minimax` | none | `MINIMAX_API_KEY` | `--provider minimax -k "$MINIMAX_API_KEY" --model MiniMax-M3.1-Flash` || `openrouter` | `.[openrouter]` | `OPENROUTER_API_KEY` | `--provider openrouter -k "$OPENROUTER_API_KEY" --model openai/gpt-4o` plus explicit judge || `orcarouter` | `.[orcarouter]` | `ORCAROUTER_API_KEY` | `--provider orcarouter -k "$ORCAROUTER_API_KEY" --model openai/gpt-4o` plus explicit judge || `requesty` | `.[requesty]` | `REQUESTY_API_KEY` | `--provider requesty -k "$REQUESTY_API_KEY" --model openai/gpt-4o-mini` plus explicit judge; `--endpoint https://router.eu.requesty.ai/v1` for EU data residency |diff --git a/ifixai/cli/model_catalog.py b/ifixai/cli/model_catalog.pyindex 50c59ba..d805c81 100644--- a/ifixai/cli/model_catalog.py+++ b/ifixai/cli/model_catalog.py@@ -14,17 +14,9 @@ def _minimax_pricing_summary(model_id: str) -> str:return f"${pricing['input']:.2f}/${pricing['output']:.2f}"summaries = []- previous_limit = Nonefor tier in tiers:pricing = tier["pricing_usd_per_million_tokens"]- limit = tier["max_input_tokens"]- if limit is not None:- range_label = f"up to {limit // 1000}k input"- previous_limit = limit- elif previous_limit is not None:- range_label = f"above {previous_limit // 1000}k input"- else:- range_label = "all input sizes"+ range_label = tier["input_range"]summaries.append(f"${pricing['input']:.2f}/${pricing['output']:.2f} {range_label}")diff --git a/ifixai/providers/minimax.py b/ifixai/providers/minimax.pyindex b967573..2f2aeeb 100644--- a/ifixai/providers/minimax.py+++ b/ifixai/providers/minimax.py@@ -36,7 +36,7 @@ class ModelMetadata(TypedDict):class PricingTier(TypedDict):- max_input_tokens: int | None+ input_range: strpricing_usd_per_million_tokens: PricingMetadata@@ -60,34 +60,34 @@ REGIONAL_ENDPOINTS: Final[dict[str, RegionalEndpoint]] = {}MODEL_METADATA: Final[dict[str, ModelMetadata]] = {- "MiniMax-M3": {+ "MiniMax-M3.1-Flash": {"context_window": 1000000,"pricing_usd_per_million_tokens": {- "input": 0.6,- "output": 2.4,- "cache_read": 0.12,+ "input": 0.15,+ "output": 0.6,+ "cache_read": 0.015,"cache_write": None,},"input_modalities": ["text", "image", "video"],- "thinking": ["adaptive", "disabled"],+ "thinking": ["adaptive"],},- "MiniMax-M2.7": {- "context_window": 204800,+ "MiniMax-M3": {+ "context_window": 1000000,"pricing_usd_per_million_tokens": {"input": 0.3,"output": 1.2,"cache_read": 0.06,- "cache_write": 0.375,+ "cache_write": None,},- "input_modalities": ["text"],- "thinking": ["always_on"],+ "input_modalities": ["text", "image", "video"],+ "thinking": ["adaptive", "disabled"],},}MODEL_PRICING_TIERS: Final[dict[str, list[PricingTier]]] = {"MiniMax-M3": [{- "max_input_tokens": 512000,+ "input_range": "up to 512k input","pricing_usd_per_million_tokens": {"input": 0.3,"output": 1.2,@@ -96,7 +96,7 @@ MODEL_PRICING_TIERS: Final[dict[str, list[PricingTier]]] = {},},{- "max_input_tokens": None,+ "input_range": "above 512k input","pricing_usd_per_million_tokens": {"input": 0.6,"output": 2.4,@@ -107,7 +107,7 @@ MODEL_PRICING_TIERS: Final[dict[str, list[PricingTier]]] = {],}-DEFAULT_MODEL = "MiniMax-M3"+DEFAULT_MODEL = "MiniMax-M3.1-Flash"DEFAULT_BASE_URL = REGIONAL_ENDPOINTS["global_en"]["openai_base_url"]DEFAULT_MAX_TOKENS = 4096ANTHROPIC_VERSION = "2023-06-01"diff --git a/ifixai/tests/test_minimax_model_defaults.py b/ifixai/tests/test_minimax_model_defaults.pynew file mode 100644index 0000000..9e2e85a--- /dev/null+++ b/ifixai/tests/test_minimax_model_defaults.py@@ -0,0 +1,155 @@+"""Exercise setup defaults through the real HTTP serialization boundary."""++from contextlib import asynccontextmanager++import aiohttp+import pytest+from aiohttp import web+from yarl import URL++from ifixai.cli.model_catalog import default_model, suggestions+from ifixai.cli.setup_cmd import _CUSTOM_MODEL, _pick_model+from ifixai.core.types import ChatMessage, ProviderConfig+from ifixai.providers.minimax import MODEL_METADATA, REGIONAL_ENDPOINTS+from ifixai.providers.resolver import resolve_provider+++@asynccontextmanager+async def capture_requests(monkeypatch):+ captured = []++ async def reply(request):+ captured.append((request.path, await request.json(), dict(request.headers)))+ if request.path.endswith("/messages"):+ return web.json_response({"content": [{"type": "text", "text": "ok"}]})+ return web.json_response({"choices": [{"message": {"content": "ok"}}]})++ app = web.Application()+ app.router.add_post("/{path:.*}", reply)+ runner = web.AppRunner(app)+ await runner.setup()+ site = web.TCPSite(runner, "127.0.0.1", 0)+ await site.start()+ port = site._server.sockets[0].getsockname()[1]+ original_request = aiohttp.ClientSession._request+ destinations = []++ async def local_request(session, method, url, **kwargs):+ destinations.append(str(url))+ local_url = URL(url).with_scheme("http").with_host("127.0.0.1").with_port(port)+ return await original_request(session, method, local_url, **kwargs)++ monkeypatch.setattr(aiohttp.ClientSession, "_request", local_request)+ try:+ yield destinations, captured+ finally:+ await runner.cleanup()+++ "endpoint",+ [None]+ + [+ region[style]+ for region in REGIONAL_ENDPOINTS.values()+ for style in ("openai_base_url", "anthropic_base_url")+ ]+ + ["https://custom.invalid/v1", "https://custom.invalid/anthropic/v1"],+)+ "model",+ [None, "MiniMax-M3.1-Flash", "MiniMax-M3", "MiniMax-M2.7", "saved-custom-id"],+)+async def test_default_and_saved_models_reach_http_unchanged(+ monkeypatch, endpoint, model+):+ # Round-trip saved configuration before resolving the runtime provider.+ config = ProviderConfig.model_validate_json(+ ProviderConfig(+ provider="minimax",+ endpoint=endpoint,+ model=model,+ api_key="offline-fixture",+ max_tokens=128,+ temperature=0.5,+ seed=17,+ json_output=True,+ max_retries=0,+ extra_headers={"X-Test-Header": "preserved"},+ ).model_dump_json()+ )+ provider = resolve_provider(config.provider)+ messages = [+ ChatMessage(role="system", content="Be helpful."),+ ChatMessage(content="Hello"),+ ]+ async with capture_requests(monkeypatch) as (destinations, captured):+ try:+ assert await provider.send_message(messages, config) == "ok"+ finally:+ await provider.aclose()+ base = endpoint or REGIONAL_ENDPOINTS["global_en"]["openai_base_url"]+ is_messages = "/anthropic" in base+ expected_url = (+ f"{base.removesuffix('/v1')}/v1/messages"+ if is_messages+ else f"{base}/chat/completions"+ )+ assert destinations == [expected_url]+ assert len(captured) == 1+ path, payload, headers = captured[0]+ assert path == URL(expected_url).path+ expected_payload = {+ "model": model or "MiniMax-M3.1-Flash",+ "max_tokens": 128,+ "temperature": 0.5,+ "messages": [{"role": "user", "content": "Hello"}],+ }+ if is_messages:+ expected_payload["system"] = "Be helpful."+ assert headers["anthropic-version"] == "2023-06-01"+ else:+ expected_payload["messages"].insert(+ 0, {"role": "system", "content": "Be helpful."}+ )+ expected_payload.update(seed=17, response_format={"type": "json_object"})+ # Exact equality also guards against unsupported thinking/effort/tier overrides.+ assert payload == expected_payload+ assert headers["Authorization"] == "Bearer offline-fixture"+ assert headers["X-Test-Header"] == "preserved"+++def test_active_catalog_and_pricing():+ assert default_model("minimax") == "MiniMax-M3.1-Flash"+ models = suggestions("minimax")+ assert [model for model, _ in models] == ["MiniMax-M3.1-Flash", "MiniMax-M3"]+ assert "$0.15/$0.60" in models[0][1]+ assert "$0.30/$1.20 up to 512k input; $0.60/$2.40 above 512k input" in models[1][1]+ assert MODEL_METADATA[models[0][0]] == {+ "context_window": 1000000,+ "pricing_usd_per_million_tokens": {+ "input": 0.15,+ "output": 0.6,+ "cache_read": 0.015,+ "cache_write": None,+ },+ "input_modalities": ["text", "image", "video"],+ "thinking": ["adaptive"],+ }+ assert MODEL_METADATA["MiniMax-M3"]["thinking"] == ["adaptive", "disabled"]++[email protected]("custom", [None, "MiniMax-M2.7", "saved-custom-id"])+def test_setup_default_and_custom_models(monkeypatch, custom):+ def select(prompt, labels, **kwargs):+ assert labels == [+ "Provider default (MiniMax-M3.1-Flash)",+ "MiniMax-M3.1-Flash",+ "MiniMax-M3",+ _CUSTOM_MODEL,+ ]+ return _CUSTOM_MODEL if custom else kwargs["default"]++ monkeypatch.setattr("ifixai.cli.setup_cmd.ui.select", select)+ monkeypatch.setattr("ifixai.cli.setup_cmd.ui.text", lambda *args, **kwargs: custom)+ assert _pick_model("minimax", role="agent") == custom