Mistral Small 4 is a powerful hybrid model capable of acting as both a general instruction model and a reasoning model. It unifies the capabilities of three different model families—Instruct, Reasoning (previously called Magistral), and Devstral—into a single, unified model.
With its multimodal capabilities, efficient architecture, and flexible mode switching, it is a powerful general-purpose model for any task. In a latency-optimized setup, Mistral Small 4 achieves a 40% reduction in end-to-end completion time, and in a throughput-optimized setup, it handles 3x more requests per second compared to Mistral Small 3.
To further improve efficiency you can either take advantages of:
Mistral Small 4 offers the following capabilities:
Reasoning Mode: Toggle between fast instant reply mode and reasoning mode, boosting performance with test-time compute when requested.
Vision: Analyzes images and provides insights based on visual content, in addition to text.
Multilingual: Supports dozens of languages, including English, French, Spanish, German, Italian, Portuguese, Dutch, Chinese, Japanese, Korean, and Arabic.
System Prompt: Strong adherence and support for system prompts.
Agentic: Best-in-class agentic capabilities with native function calling and JSON output.
Speed-Optimized: Delivers best-in-class performance and speed.
Apache 2.0 License: Open-source license for both commercial and non-commercial use.
Large Context Window: Supports a 256k context window.
Recommended Settings
Reasoning Effort:
'none' → Do not use reasoning
'high' → Use reasoning (recommended for complex prompts)
Use reasoning_effort="high" for complex tasks
Temperature: 0.7 for reasoning_effort="high". Temp between 0.0 and 0.7 for reasoning_effort="none" depending on task.
Use Cases
Mistral Small 4 is designed for general chat assistants, coding, agentic tasks, and reasoning tasks (with reasoning mode toggled). Its multimodal capabilities also enable document and image understanding for data extraction and analysis.
Its capabilities are ideal for:
Developers interested in coding and agentic capabilities for SWE automation and codebase exploration.
Enterprises seeking general chat assistants, agents, and document understanding.
Researchers leveraging its math and research capabilities.
Mistral Small 4 is also well-suited for customization and fine-tuning for more specialized tasks.
Examples
General chat assistant
Document parsing and extraction
Coding agent
Research assistant
Customization & fine-tuning
And more...
Benchmarks
Comparison with internal models
Depending on your tasks you can trigger reasoning thanks to the support of the per-request parameter reasoning_effort. Set it to:
reasoning_effort="high": Deep, step-by-step reasoning for complex problems, with equivalent verbosity to previous Magistral models such as mistralai/Magistral-Small-2509.
Internal benchmark
Comparing Reasoning Models
Internal benchmark - Reasoning
Comparison with other models
Mistral Small 4 with reasoning achieves competitive scores, matching or surpassing GPT-OSS 120B across all three benchmarks while generating significantly
shorter outputs. On AA LCR, Mistral Small 4 scores 0.72 with just 1.6K characters, whereas Qwen models require 3.5-4x more output (5.8-6.1K)
for comparable performance. On LiveCodeBench, Mistral Small 4 outperforms GPT-OSS 120B while producing 20% less output.
This efficiency reduces latency, inference costs, and improves user experience.
Comparison benchmark - LCR
Comparison benchmark - LiveCodeBench
Comparison benchmark - AIME25
Usage
You can find Mistral Small 4 support on multiple libraries for inference and fine-tuning. We here thank everyone contributors and maintainers that helped us making it happen.
We recommend using Mistral Small 4 with the vLLM library for production-ready inference.
Installation
[!Tip]
Use our custom Docker image with fixes for tool calling and reasoning parsing in vLLM, and the latest Transformers version. We are working with the vLLM team to merge these fixes soon.
Mistral Small 4 can follow your instructions to the letter.
python
1from datetime import datetime, timedelta
23from openai import OpenAI
4from huggingface_hub import hf_hub_download
56# Modify OpenAI's API key and API base to use vLLM's API server.7openai_api_key ="EMPTY"8openai_api_base ="http://localhost:8000/v1"910TEMP =0.111# use TEMP = 0.7 for reasoning="high"1213client = OpenAI(14 api_key=openai_api_key,15 base_url=openai_api_base,16)1718models = client.models.list()19model = models.data[0].id202122defload_system_prompt(repo_id:str, filename:str)->str:23 file_path = hf_hub_download(repo_id=repo_id, filename=filename)24withopen(file_path,"r")asfile:25 system_prompt =file.read()26 today = datetime.today().strftime("%Y-%m-%d")27 yesterday =(datetime.today()- timedelta(days=1)).strftime("%Y-%m-%d")28 model_name = repo_id.split("/")[-1]29return system_prompt.format(name=model_name, today=today, yesterday=yesterday)303132SYSTEM_PROMPT = load_system_prompt(model,"SYSTEM_PROMPT.txt")3334messages =[35{"role":"system","content": SYSTEM_PROMPT},36{37"role":"user",38"content":"Write me a sentence where every word starts with the next letter in the alphabet - start with 'a' and end with 'z'.",39},40]4142response = client.chat.completions.create(43 model=model,44 messages=messages,45 temperature=TEMP,46 reasoning_effort="none",47)4849assistant_message = response.choices[0].message.content
50print(assistant_message)
Tool Call
Let's solve some equations thanks to our simple Python calculator tool.
python
1import json
2from datetime import datetime, timedelta
34from openai import OpenAI
5from huggingface_hub import hf_hub_download
67# Modify OpenAI's API key and API base to use vLLM's API server.8openai_api_key ="EMPTY"9openai_api_base ="http://localhost:8000/v1"1011TEMP =0.11213client = OpenAI(14 api_key=openai_api_key,15 base_url=openai_api_base,16)1718models = client.models.list()19model = models.data[0].id202122defload_system_prompt(repo_id:str, filename:str)->str:23 file_path = hf_hub_download(repo_id=repo_id, filename=filename)24withopen(file_path,"r")asfile:25 system_prompt =file.read()26 today = datetime.today().strftime("%Y-%m-%d")27 yesterday =(datetime.today()- timedelta(days=1)).strftime("%Y-%m-%d")28 model_name = repo_id.split("/")[-1]29return system_prompt.format(name=model_name, today=today, yesterday=yesterday)303132SYSTEM_PROMPT = load_system_prompt(model,"SYSTEM_PROMPT.txt")3334image_url ="https://math-coaching.com/img/fiche/46/expressions-mathematiques.jpg"353637defmy_calculator(expression:str)->str:38returnstr(eval(expression))394041tools =[42{43"type":"function",44"function":{45"name":"my_calculator",46"description":"A calculator that can evaluate a mathematical expression.",47"parameters":{48"type":"object",49"properties":{50"expression":{51"type":"string",52"description":"The mathematical expression to evaluate.",53},54},55"required":["expression"],56},57},58},59{60"type":"function",61"function":{62"name":"rewrite",63"description":"Rewrite a given text for improved clarity",64"parameters":{65"type":"object",66"properties":{67"text":{68"type":"string",69"description":"The input text to rewrite",70}71},72},73},74},75]7677messages =[78{"role":"system","content": SYSTEM_PROMPT},79{80"role":"user",81"content":[82{83"type":"text",84"text":"Thanks to your calculator, compute the results for the equations that involve numbers displayed in the image.",85},86{87"type":"image_url",88"image_url":{89"url": image_url,90},91},92],93},94]9596response = client.chat.completions.create(97 model=model,98 messages=messages,99 temperature=TEMP,100 tools=tools,101 tool_choice="auto",102 reasoning_effort="none",103)104105tool_calls = response.choices[0].message.tool_calls
106107results =[]108for tool_call in tool_calls:109 function_name = tool_call.function.name
110 function_args = tool_call.function.arguments
111if function_name =="my_calculator":112 result = my_calculator(**json.loads(function_args))113 results.append(result)114115messages.append({"role":"assistant","tool_calls": tool_calls})116for tool_call, result inzip(tool_calls, results):117 messages.append(118{119"role":"tool",120"tool_call_id": tool_call.id,121"name": tool_call.function.name,122"content": result,123}124)125126127response = client.chat.completions.create(128 model=model,129 messages=messages,130 temperature=TEMP,131 reasoning_effort="none",132)133134print(response.choices[0].message.content)
Vision Reasoning
Let's see if the Mistral Small 4 knows when to pick a fight !
python
1from datetime import datetime, timedelta
23from openai import OpenAI
4from huggingface_hub import hf_hub_download
56# Modify OpenAI's API key and API base to use vLLM's API server.7openai_api_key ="EMPTY"8openai_api_base ="http://localhost:8000/v1"910TEMP =0.71112client = OpenAI(13 api_key=openai_api_key,14 base_url=openai_api_base,15)1617models = client.models.list()18model = models.data[0].id192021defload_system_prompt(repo_id:str, filename:str)->str:22 file_path = hf_hub_download(repo_id=repo_id, filename=filename)23withopen(file_path,"r")asfile:24 system_prompt =file.read()25 today = datetime.today().strftime("%Y-%m-%d")26 yesterday =(datetime.today()- timedelta(days=1)).strftime("%Y-%m-%d")27 model_name = repo_id.split("/")[-1]28return system_prompt.format(name=model_name, today=today, yesterday=yesterday)293031SYSTEM_PROMPT = load_system_prompt(model,"SYSTEM_PROMPT.txt")32image_url ="https://static.wikia.nocookie.net/essentialsdocs/images/7/70/Battle.png/revision/latest?cb=20220523172438"3334messages =[35{"role":"system","content": SYSTEM_PROMPT},36{37"role":"user",38"content":[39{40"type":"text",41"text":"What action do you think I should take in this situation? List all the possible actions and explain why you think they are good or bad.",42},43{"type":"image_url","image_url":{"url": image_url}},44],45},46]474849response = client.chat.completions.create(50 model=model,51 messages=messages,52 temperature=TEMP,53 reasoning_effort="high",54)5556print(response.choices[0].message.content)
Transformers
Installation
You need to install the main branch of Transformers to use Mistral Small 4:
1import torch
2from transformers import AutoProcessor, Mistral3ForConditionalGeneration
345model_id ="mistralai/Mistral-Small-4-119B-2603"67processor = AutoProcessor.from_pretrained(model_id)8model = Mistral3ForConditionalGeneration.from_pretrained(9 model_id, device_map="auto"10)1112image_url ="https://static.wikia.nocookie.net/essentialsdocs/images/7/70/Battle.png/revision/latest?cb=20220523172438"1314messages =[15{16"role":"user",17"content":[18{19"type":"text",20"text":"What action do you think I should take in this situation? List all the possible actions and explain why you think they are good or bad.",21},22{"type":"image_url","image_url":{"url": image_url}},23],24},25]2627inputs = processor.apply_chat_template(messages, return_tensors="pt", tokenize=True, return_dict=True, reasoning_effort="high")28inputs = inputs.to(model.device)2930output = model.generate(31**inputs,32 max_new_tokens=1024,33 do_sample=True,34 temperature=0.7,35)[0]3637# Setting `skip_special_tokens=False` to visualize reasoning trace between [THINK] [/THINK] tags.38decoded_output = processor.decode(output[len(inputs["input_ids"][0]):], skip_special_tokens=False)39print(decoded_output)