Only a few months after releasing M2, a quick, low-cost mannequin designed for brokers and code, MiniMax launched the following enhanced model. Minimax M2.1.
M2 was already distinguished by its effectivity, providing considerably sooner speeds whereas working at roughly 8% the price of Claude Sonnet. Extra importantly, completely different computational and inference patterns have been launched, particularly in how fashions construction and carry out their pondering throughout advanced code and tool-driven workflows.
M2.1 builds on this basis and delivers tangible enhancements throughout key areas, together with improved code high quality, smarter instruction following, cleaner inference, and efficiency enhancements throughout a number of programming languages. These upgrades lengthen the M2’s authentic strengths whereas staying true to MiniMax’s imaginative and prescient.Intelligence for everybody.”
Enhanced with M2’s core capabilities, M2.1 would not simply enhance your coding, it additionally produces clearer, extra structured output throughout conversations, paperwork, and writing.
- Constructed for real-world coding and AI-native groups: Designed to assist every part from fast “construct ambiance” to advanced production-grade workflows.
- Greater than coding: Produce clearer, extra structured, and higher-quality output throughout on a regular basis conversations, technical paperwork, and writing duties.
- Chopping-edge multilingual coding efficiency: Achieved 72.5% in SWE Multilingual, outperforming Claude Sonnet 4.5 and Gemini 3 Professional throughout a number of programming languages.
- Highly effective AppDev and WebDev options: With a rating of 88.6% on VIBE-Bench, it beats Claude Sonnet 4.5 and Gemini 3 Professional, with vital enhancements in native Android, iOS, and trendy net growth.
- Nice agent and power compatibility: Offers constant and steady efficiency throughout main coding instruments and agent frameworks, together with Claude Code, Droid (Manufacturing unit AI), Cline, Kilo Code, Roo Code, and BlackBox.
- Strong context administration assist: It really works reliably with superior context mechanisms akin to Talent.md, Claude.md/agent.md/cursorrule, and Slash instructions to allow scalable agent workflows.
- Computerized caching, no configuration required: Constructed-in caching works out of the field to scale back latency, cut back prices, and supply an general smoother expertise.
To start out utilizing MiniMax M2.1, MiniMax platform. Might be generated from the MiniMax Person Console.
As soon as you have issued your API key, maintain it secure and do not expose it to your code repository or public atmosphere.
Putting in and establishing dependencies
MiniMax helps each Anthropic and OpenAI API codecs, so whether or not you are utilizing an Anthropic-style messaging API or an OpenAI-compatible setup, you’ll be able to simply combine MiniMax fashions into your current workflows with minimal configuration adjustments.
import os
from getpass import getpass
os.environ['ANTHROPIC_BASE_URL'] = 'https://api.minimax.io/anthropic'
os.environ['ANTHROPIC_API_KEY'] = getpass('Enter MiniMax API Key: ')
With this minimal setup, you might be prepared to start out utilizing your mannequin.
Ship a request to the mannequin
MiniMax M2.1 returns structured output that separates inner reasoning (ideas) and last responses (textual content). This lets you observe how the mannequin interprets your intent and plans its reply earlier than producing output for the consumer.
import anthropic
shopper = anthropic.Anthropic()
message = shopper.messages.create(
mannequin="MiniMax-M2.1",
max_tokens=1000,
system="You're a useful assistant.",
messages=[
{
"role": "user",
"content": [
{
"type": "text",
"text": "Hi, how are you?"
}
]
}
]
)
for block in message.content material:
if block.kind == "pondering":
print(f"Pondering:n{block.pondering}n")
elif block.kind == "textual content":
print(f"Textual content:n{block.textual content}n")
Pondering:
The consumer is simply asking how I'm doing. This can be a pleasant greeting, so I ought to reply in a heat, conversational means. I will maintain it easy and pleasant.
Textual content:
Hello! I am doing properly, thanks for asking! 😊
I am prepared that will help you with no matter you want as we speak. Whether or not it is coding, answering questions, brainstorming concepts, or simply chatting, I am right here for you.
What can I make it easier to with?
What units MiniMax aside is that its inference course of is seen. Earlier than producing the ultimate response, the mannequin makes specific inferences concerning the consumer’s intent, tone, and anticipated fashion to make sure the response is acceptable and context-aware.
Clear separation of inference from response makes fashions simpler to interpret, debug, and belief, particularly in advanced agent-based or multi-step workflows. M2.1 combines this readability with sooner responses, extra concise reasoning, and considerably diminished token consumption in comparison with M2.
MiniMax M2 stands out for its native proficiency in interleaved pondering, permitting it to dynamically plan and adapt inside advanced coding and tool-based workflows. M2.1 extends this functionality with improved code high quality, extra correct instruction following, clearer inference, and stronger efficiency throughout programming languages, enabling workplace automation readiness, particularly in dealing with advanced instruction constraints like these present in OctoCodingBench.
To essentially consider these options, strive testing your mannequin utilizing structured coding prompts with a number of constraints and real-world engineering necessities.
import anthropic
shopper = anthropic.Anthropic()
def run_test(immediate: str, title: str):
print(f"n{'='*80}")
print(f"TEST: {title}")
print(f"{'='*80}n")
message = shopper.messages.create(
mannequin="MiniMax-M2.1",
max_tokens=10000,
system=(
"You're a senior software program engineer. "
"Write production-quality code with clear construction, "
"specific assumptions, and minimal however ample reasoning. "
"Keep away from pointless verbosity."
),
messages=[
{
"role": "user",
"content": [{"type": "text", "text": prompt}]
}
]
)
for block in message.content material:
if block.kind == "pondering":
print("🧠 Pondering:n", block.pondering, "n")
elif block.kind == "textual content":
print("📄 Output:n", block.textual content, "n")
PROMPT= """
Design a small Python service that processes consumer occasions.
Necessities:
1. Occasions arrive as dictionaries with keys: user_id, event_type, timestamp.
2. Validate enter strictly (varieties + required keys).
3. Mixture occasions per consumer in reminiscence.
4. Expose two capabilities:
- ingest_event(occasion: dict) -> None
- get_user_summary(user_id: str) -> dict
5. Code should be:
- Testable
- Thread-safe
- Simply extensible for brand spanking new occasion varieties
6. Do NOT use exterior libraries.
Present:
- Code solely
- Transient inline feedback the place wanted
"""
run_test(immediate=PROMPT, title="Instruction Following + Structure")
This check makes use of deliberately structured and restrictive prompts designed to guage extra than simply code technology. Prompts will need to have strict enter validation, in-memory state administration, thread security, testability, and extensibility with out counting on exterior libraries.
By combining architectural selections with a number of key constraints, prompts function at medium to excessive complexity ranges, making them appropriate for evaluating how successfully MiniMax M2.1 follows directions, considers design tradeoffs and causes, and produces production-quality code relatively than remoted snippets.
Mannequin inference and output
This mannequin considers key architectural tradeoffs earlier than coding and punctiliously balances flexibility, reminiscence utilization, and scalability. We deliberately select uncooked occasion storage to guage a number of approaches to occasion aggregation and allow future enlargement with out altering the ingestion logic.
Thread security is dealt with explicitly with locks, strict enter validation is deliberate to make sure knowledge correctness, and displays a real-world, engineering-first mindset relatively than a leap to implementation.
This considerate reasoning is mirrored within the last output, which demonstrates robust code high quality by clear construction, significant naming, kind hints, and thread-safe design aligned to manufacturing requirements. This answer adheres precisely to all immediate constraints, akin to validation, in-memory aggregation, extensibility, and lack of exterior dependencies, whereas avoiding pointless complexity and sustaining clear, centered logic that’s straightforward to take care of.
import threading
from typing import Dict, Listing, Any
class EventProcessor:
"""
Thread-safe occasion processor that aggregates consumer occasions in reminiscence.
Validates enter strictly and helps straightforward extension for brand spanking new occasion varieties.
"""
def __init__(self) -> None:
# Shops occasions per consumer: user_id -> listing of occasion dictionaries
self._user_events: Dict[str, List[Dict[str, Any]]] = {}
# Lock for thread-safe entry
self._lock = threading.Lock()
def ingest_event(self, occasion: dict) -> None:
"""
Validate and ingest a single occasion.
Strictly validates varieties and presence of required keys.
"""
# Validate occasion is a dictionary
if not isinstance(occasion, dict):
increase ValueError("Occasion should be a dictionary")
# Validate required keys and their varieties
required_keys = {
'user_id': str,
'event_type': str,
'timestamp': (str, int, float) # Settle for string or numeric timestamp
}
for key, expected_type in required_keys.objects():
if key not in occasion:
increase ValueError(f"Lacking required key: '{key}'")
if not isinstance(occasion[key], expected_type):
increase ValueError(f"Key '{key}' should be of kind {expected_type.__name__}")
# Thread-safe occasion storage
with self._lock:
user_id = occasion['user_id']
if user_id not in self._user_events:
self._user_events[user_id] = []
self._user_events[user_id].append(occasion)
def get_user_summary(self, user_id: str) -> dict:
"""
Generate abstract for a particular consumer.
Returns aggregated occasion counts and timestamps.
"""
if not isinstance(user_id, str):
increase ValueError("user_id should be a string")
with self._lock:
user_events = self._user_events.get(user_id, [])
# Mixture occasion counts
event_counts = {}
timestamps = []
for occasion in user_events:
event_type = occasion['event_type']
event_counts[event_type] = event_counts.get(event_type, 0) + 1
timestamps.append(occasion['timestamp'])
return {
'user_id': user_id,
'total_events': len(user_events),
'event_counts': event_counts,
'timestamps': sorted(timestamps) if timestamps else []
}
```
**Key Design Selections:**
1. **Thread Security**: Makes use of `threading.Lock` to guard shared state throughout concurrent entry
2. **Enter Validation**: Strict kind checking for required keys with clear error messages
3. **Extensibility**:
- New occasion varieties robotically dealt with by dynamic counting
- Simple so as to add new aggregations in `get_user_summary`
4. **Testability**: Clear separation of issues, straightforward to mock for unit assessments
5. **Reminiscence Effectivity**: Shops solely important knowledge (occasion dictionaries)
**Utilization Instance:**
```python
processor = EventProcessor()
# Ingest occasions
processor.ingest_event({
'user_id': 'user123',
'event_type': 'login',
'timestamp': '2023-01-01T10:00:00Z'
})
# Get consumer abstract
abstract = processor.get_user_summary('user123')
print(abstract)
Now let’s examine MiniMax M2.1’s interleaved pondering in motion. We ask for a mannequin that compares two organizations based mostly on P/E ratio and sentiment, utilizing two dummy instruments to obviously observe how the workflow works.
This instance exhibits how M2.1 interacts with exterior instruments in a managed agent fashion setup. One software simulates inventory index retrieval, the opposite offers sentiment evaluation, and each return regionally generated responses. When the mannequin receives the outputs of those instruments, it incorporates them into its inference and adjusts the ultimate comparability accordingly.
Software definition
import anthropic
import json
shopper = anthropic.Anthropic()
def get_stock_metrics(ticker):
knowledge = {
"NVDA": {"worth": 130, "pe": 75.2},
"AMD": {"worth": 150, "pe": 40.5}
}
return json.dumps(knowledge.get(ticker, "Ticker not discovered"))
def get_sentiment_analysis(company_name):
sentiments = {"NVIDIA": 0.85, "AMD": 0.42}
return f"Sentiment rating for {company_name}: {sentiments.get(company_name, 0.0)}"
instruments = [
{
"name": "get_stock_metrics",
"description": "Get price and P/E ratio.",
"input_schema": {
"type": "object",
"properties": {"ticker": {"type": "string"}},
"required": ["ticker"]
}
},
{
"title": "get_sentiment_analysis",
"description": "Get information sentiment rating.",
"input_schema": {
"kind": "object",
"properties": {"company_name": {"kind": "string"}},
"required": ["company_name"]
}
}
]
messages = [{"role": "user", "content": "Compare NVDA and AMD value based on P/E and sentiment."}]
operating = True
print(f"👤 [USER]: {messages[0]['content']}")
whereas operating:
# Get mannequin response
response = shopper.messages.create(
mannequin="MiniMax-M2.1",
max_tokens=4096,
messages=messages,
instruments=instruments,
)
messages.append({"position": "assistant", "content material": response.content material})
tool_results = []
has_tool_use = False
for block in response.content material:
if block.kind == "pondering":
print(f"n💭 [THINKING]:n{block.pondering}")
elif block.kind == "textual content":
print(f"n💬 [MODEL]: {block.textual content}")
if not any(b.kind == "tool_use" for b in response.content material):
operating = False
elif block.kind == "tool_use":
has_tool_use = True
print(f"🔧 [TOOL CALL]: {block.title}({block.enter})")
# Execute the proper mock operate
if block.title == "get_stock_metrics":
end result = get_stock_metrics(block.enter['ticker'])
elif block.title == "get_sentiment_analysis":
end result = get_sentiment_analysis(block.enter['company_name'])
# Add to the outcomes listing for this flip
tool_results.append({
"kind": "tool_result",
"tool_use_id": block.id,
"content material": end result
})
if has_tool_use:
messages.append({"position": "consumer", "content material": tool_results})
else:
operating = False
print("n✅ Dialog Full.")
Throughout execution, the mannequin decides which instruments to name and when, receives the outcomes of the corresponding instruments, and updates its inferences and last response based mostly on that knowledge. This demonstrates M2.1’s skill to interleave inference, software utilization, and response technology, dynamically adjusting output as new data turns into obtainable.



Lastly, we examine MiniMax M2.1 and GPT-5.2 utilizing compact multilingual instruction-following prompts. This activity requires the mannequin to establish coffee-related phrases in a Spanish passage, translate solely these phrases into English, take away duplicates, and return the ends in a strictly formatted numbered listing.
An OpenAI API secret’s required to run this code block. This secret’s OpenAI developer dashboard.
import os
from getpass import getpass
os.environ['OPENAI_API_KEY'] = getpass ('Enter OpenAI API Key: ')
input_text = """
¡Preparar café Chilly Brew es un proceso sencillo y refrescante!
Todo lo que necesitas son granos de café molido grueso y agua fría.
Comienza añadiendo el café molido a un recipiente o jarra grande.
Luego, vierte agua fría, asegurándote de que todos los granos de café
estén completamente sumergidos.
Remueve la mezcla suavemente para garantizar una saturación uniforme.
Cubre el recipiente y déjalo en remojo en el refrigerador durante al
menos 12 a 24 horas, dependiendo de la fuerza deseada.
"""
immediate = f"""
The next textual content is written in Spanish.
Job:
1. Determine all phrases within the textual content which are associated to espresso or espresso preparation.
2. Translate ONLY these phrases into English.
3. Take away duplicates (every phrase ought to seem solely as soon as).
4. Current the end result as a numbered listing.
Guidelines:
- Do NOT embody explanations.
- Do NOT embody non-coffee-related phrases.
- Do NOT embody Spanish phrases within the last output.
Textual content:
<{input_text}>
"""
from openai import OpenAI
shopper = OpenAI()
response = shopper.responses.create(
mannequin="gpt-5.2",
enter=immediate
)
print(response.output_text)
import anthropic
shopper = anthropic.Anthropic()
message = shopper.messages.create(
mannequin="MiniMax-M2.1",
max_tokens=10000,
system="You're a useful assistant.",
messages=[
{
"role": "user",
"content": [
{
"type": "text",
"text": prompt
}
]
}
]
)
for block in message.content material:
if block.kind == "pondering":
print(f"Pondering:n{block.pondering}n")
elif block.kind == "textual content":
print(f"Textual content:n{block.textual content}n")
Evaluating the outputs, MiniMax M2.1 produces a considerably broader and extra detailed set of coffee-related phrases than GPT-5.2. M2.1 identifies key nouns akin to espresso, beans, and water, in addition to preparatory actions (pour, stir, cowl), process-related states (soak, soak), and contextual attributes (coldness, coarseness, power, time).
This factors to a deeper semantic path by the textual content that the mannequin infers all through the preparation workflow, relatively than simply extracting the obvious key phrases.
This distinction can also be mirrored within the reasoning course of. M2.1 explicitly analyzes context, resolves particular circumstances (akin to borrowed English phrases akin to Chilly Brew), accounts for overlap, and considers whether or not a selected adjective or verb qualifies as coffee-related earlier than finalizing the listing. In distinction, GPT-5.2 offers quick, conservative output that hides the depth of inference and focuses on high-confidence phrases.
Taken collectively, these spotlight M2.1’s stronger crucial compliance and semantic protection, particularly for duties that require cautious filtering, transformation, and tight output management.


Asif Razzaq is the CEO of Marktechpost Media Inc. As a visionary entrepreneur and engineer, Asif is dedicated to harnessing the potential of synthetic intelligence for social good. His newest endeavor is the launch of Marktechpost, a synthetic intelligence media platform. It stands out for its thorough protection of machine studying and deep studying information, which is technically sound and simply understood by a large viewers. The platform boasts over 2 million views per 30 days, demonstrating its reputation amongst viewers.

