πŸ“‹ Model Description


base_model:
  • mistralai/Magistral-Small-2507
language:
  • en
  • fr
  • de
  • es
  • pt
  • it
  • ja
  • ko
  • ru
  • zh
  • ar
  • fa
  • id
  • ms
  • ne
  • pl
  • ro
  • sr
  • sv
  • tr
  • uk
  • vi
  • hi
  • bn
library_name: vllm license: apache-2.0 inference: false extragateddescription: >- If you want to learn more about how we process your personal data, please read our Privacy Policy. tags:
  • vllm
  • mistral-common

Learn to run Magistral correctly - Read our Guide.

Unsloth Dynamic 2.0 achieves SOTA performance in model quantization.

Magistral Small 1.1

Building upon Mistral Small 3.1 (2503), with added reasoning capabilities, undergoing SFT from Magistral Medium traces and RL on top, it's a small, efficient reasoning model with 24B parameters.

Magistral Small can be deployed locally, fitting within a single RTX 4090 or a 32GB RAM MacBook once quantized.

Learn more about Magistral in our blog post.

The model was presented in the paper Magistral.

Updates compared with Magistral Small 1.0

Magistral Small 1.1 should give you about the same performance as Magistral Small 1.0 as seen in the benchmark results.

The update involves the following features:

  • Better tone and model behaviour. You should experiment better LaTeX and Markdown formatting, and shorter answers on easy general prompts.
  • The model is less likely to enter infinite generation loops.
  • [THINK] and [/THINK] special tokens encapsulate the reasoning content in a thinking chunk. This makes it easier to parse the reasoning trace and prevents confusion when the '[THINK]' token is given as a string in the prompt.
  • The reasoning prompt is now given in the system prompt.

Key Features

  • Reasoning: Capable of long chains of reasoning traces before providing an answer.
  • Multilingual: Supports dozens of languages, including English, French, German, Greek, Hindi, Indonesian, Italian, Japanese, Korean, Malay, Nepali, Polish, Portuguese, Romanian, Russian, Serbian, Spanish, Turkish, Ukrainian, Vietnamese, Arabic, Bengali, Chinese, and Farsi.
  • Apache 2.0 License: Open license allowing usage and modification for both commercial and non-commercial purposes.
  • Context Window: A 128k context window, but performance might degrade past 40k. Hence we recommend setting the maximum model length to 40k.

Benchmark Results

ModelAIME24 pass@1AIME25 pass@1GPQA DiamondLivecodebench (v5)
Magistral Medium 1.172.03%60.99%71.46%59.35%
Magistral Medium 1.073.59%64.95%70.83%59.36%
Magistral Small 1.170.52%62.03%65.78%59.17%
Magistral Small 1.070.68%62.76%68.18%55.84%

Sampling parameters

Please make sure to use:

  • topp: 0.95
  • temperature: 0.7
  • maxtokens: 40960

Basic Chat Template

We highly recommend including the following system prompt for the best results, you can edit and customise it if needed for your specific use case.

First draft your thinking process (inner monologue) until you arrive at a response. Format your response using Markdown, and use LaTeX for any mathematical equations. Write both your thoughts and the response in the same language as the input.

>

Your thinking process must follow the template below:[THINK]Your thoughts or/and draft, like working through an exercise on scratch paper. Be as casual and as long as you want until you are confident to generate the response. Use the same language as the input.[/THINK]Here, provide a self-contained response.

The [THINK] and [/THINK] are special tokens that must be encoded as such.

Please make sure to use mistral-common as the source of truth. Find below examples from libraries supporting mistral-common.

We invite you to choose, depending on your use case and requirements, between keeping reasoning traces during multi-turn interactions or keeping only the final assistant response.

Usage

The model can be used with the following frameworks;

Inference

vLLM (recommended)

We recommend using this model with the vLLM library
to implement production-ready inference pipelines.

Installation

Make sure you install the latest vLLM code:

pip install -U vllm \
    --pre \
    --extra-index-url https://wheels.vllm.ai/nightly

Doing so should automatically install mistralcommon >= 1.8.2.

To check:

python -c "import mistralcommon; print(mistralcommon.version)"

You can also make use of a ready-to-go docker image or on the docker hub.

Serve model as follows:

vllm serve mistralai/Magistral-Small-2507 --reasoning-parser mistral --tokenizermode mistral --configformat mistral --load_format mistral --tool-call-parser mistral --enable-auto-tool-choice --tensor-parallel-size 2

Ping model as follows:


Python snippet

from typing import Any
from openai import OpenAI
from huggingfacehub import hfhub_download

Modify OpenAI's API key and API base to use vLLM's API server.

openaiapikey = "EMPTY" openaiapibase = "http://localhost:8000/v1"

TEMP = 0.7
TOP_P = 0.95
MAXTOK = 40960

client = OpenAI(
apikey=openaiapi_key,
baseurl=openaiapi_base,
)

models = client.models.list()
model = models.data[0].id

def loadsystemprompt(repo_id: str, filename: str) -> dict[str, Any]:
filepath = hfhubdownload(repoid=repo_id, filename=filename)
with open(file_path, "r") as file:
system_prompt = file.read()

indexbeginthink = system_prompt.find("[THINK]")
indexendthink = system_prompt.find("[/THINK]")

return {
"role": "system",
"content": [
{"type": "text", "text": systemprompt[:indexbegin_think]},
{
"type": "thinking",
"thinking": system_prompt[
indexbeginthink + len("[THINK]") : indexendthink
],
"closed": True,
},
{
"type": "text",
"text": systemprompt[indexend_think + len("[/THINK]") :],
},
],
}

SYSTEMPROMPT = loadsystemprompt(model, "SYSTEMPROMPT.txt")

query = "Write 4 sentences, each with at least 8 words. Now make absolutely sure that every sentence has exactly one word less than the previous sentence."

or try out other queries


query = "Exactly how many days ago did the French Revolution start? Today is June 4th, 2025."


query = "Think about 5 random numbers. Verify if you can combine them with addition, multiplication, subtraction or division to 133"


query = "If it takes 30 minutes to dry 12 T-shirts in the sun, how long does it take to dry 33 T-shirts?"

messages = [
SYSTEM_PROMPT,
{"role": "user", "content": query}
]
stream = client.chat.completions.create(
model=model,
messages=messages,
stream=True,
temperature=TEMP,
topp=TOPP,
maxtokens=MAXTOK,
)

print("client: Start streaming chat completions...:\n")
printedreasoningcontent = False
answer = []

for chunk in stream:
reasoning_content = None
content = None
# Check the content is reasoning_content or content
if hasattr(chunk.choices[0].delta, "reasoning_content"):
reasoningcontent = chunk.choices[0].delta.reasoningcontent
elif hasattr(chunk.choices[0].delta, "content"):
content = chunk.choices[0].delta.content

if reasoning_content is not None:
if not printedreasoningcontent:
printedreasoningcontent = True
print("Start reasoning:\n", end="", flush=True)
print(reasoning_content, end="", flush=True)
elif content is not None:
# Extract and print the content
if not reasoningcontent and printedreasoning_content:
answer.extend(content)
print(content, end="", flush=True)

if answer:
print("\n\n=============\nAnswer\n=============\n")
print("".join(answer))
else:
print("\n\n=============\nNo Answer\n=============\n")
print("No answer was generated by the model, probably because the maximum number of tokens was reached.")

client: Start streaming chat completions...:

#

Start reasoning:

First, I need to write ...

...

# #

=============

Answer

=============

#

Here are four sentences where each has at least 8 words, and each subsequent sentence has exactly one word less than the previous one:

1. The quick brown fox jumps over the lazy dog and rests.

2. The lazy dog rests under the big shady tree peacefully.

3. The big shady tree provides ample shade during summer.

4. The tree's leaves are very lush and green.

Transformers

Make sure you install the latest Transformers code:

pip install git+https://github.com/huggingface/transformers

Also make sure to install mistralcommon >= 1.8.2:

pip install --upgrade mistral-common

To check:

python -c "import mistralcommon; print(mistralcommon.version)"

Now you can use Transformers with Magistral:


Python snippet

from typing import Any
import torch

from huggingfacehub import hfhub_download
from transformers import AutoModelForCausalLM, AutoTokenizer

TEMP = 0.7
TOP_P = 0.95
MAXTOK = 40960

def loadsystemprompt(repo_id: str, filename: str) -> dict[str, Any]:
filepath = hfhubdownload(repoid=repo_id, filename=filename)
with open(file_path, "r") as file:
system_prompt = file.read()

indexbeginthink = system_prompt.find("[THINK]")
indexendthink = system_prompt.find("[/THINK]")

return {
"role": "system",
"content": [
{"type": "text", "text": systemprompt[:indexbegin_think]},
{
"type": "thinking",
"thinking": system_prompt[
indexbeginthink + len("[THINK]") : indexendthink
],
"closed": True,
},
{
"type": "text",
"text": systemprompt[indexend_think + len("[/THINK]") :],
},
],
}

model_id = "mistralai/Magistral-Small-2507"
SYSTEMPROMPT = loadsystemprompt(modelid, "SYSTEM_PROMPT.txt")
query = "Think about 5 random numbers. Verify if you can combine them with addition, multiplication, subtraction or division to 133."

or try out other queries


query = "Exactly how many days ago did the French Revolution start? Today is June 4th, 2025."


query = "Write 4 sentences, each with at least 8 words. Now make absolutely sure that every sentence has exactly one word less than the previous sentence."


query = "If it takes 30 minutes to dry 12 T-shirts in the sun, how long does it take to dry 33 T-shirts?"

tokenizer = AutoTokenizer.frompretrained(modelid, tokenizertype="mistral", usefast=False)
model = AutoModelForCausalLM.from_pretrained(
modelid, torchdtype=torch.bfloat16, device_map="auto"
)

inputids = tokenizer.applychat_template(
[
SYSTEM_PROMPT,
{"role": "user", "content": query},
],
)

output = model.generate(
inputids=torch.tensor([inputids], device=model.device),
padtokenid=tokenizer.padtokenid,
eostokenid=tokenizer.eostokenid,
temperature=TEMP,
topp=TOPP,
do_sample=True,
maxnewtokens=MAX_TOK,
)[0]

decodedoutput = tokenizer.decode(output[len(inputids) :])
print(decoded_output)

[THINK]Alright, I need to think of 5 random numbers first. Let's say I pick the numbers 5, 10, 2, 7, and 3.

#

Now, I need to see if I can combine these numbers using addition, multiplication, subtraction, or division to get 133.

...

...

...

But if we're to find any five numbers that can be combined to make 133, then yes, such sets exist, like the one demonstrated above.[/THINK]Yes, it is possible to combine some sets of five random numbers to make 133 using basic arithmetic operations. For example, the numbers 13, 10, 1, 2, and 3 can be combined as follows to make 133:

#

\[ (13 \times 10) + (3 \times (2 - 1)) = 130 + 3 = 133 \]

#

However, not all sets of five random numbers can be combined in this way to make 133. For instance, with the numbers 5, 10, 2, 7, and 3, it is not possible to combine them using the allowed operations to get exactly 133.

#

Therefore, the ability to combine five random numbers to make 133 depends on the specific numbers chosen.

#

$133 = (13 \times 10) + (3 \times (2 - 1))$</s>

πŸ“‚ GGUF File List

πŸ“ Filename πŸ“¦ Size ⚑ Download
Magistral-Small-2507-BF16.gguf
LFS FP16
43.92 GB Download
Magistral-Small-2507-IQ4_NL.gguf
LFS Q4
12.54 GB Download
Magistral-Small-2507-IQ4_XS.gguf
LFS Q4
11.9 GB Download
Magistral-Small-2507-Q2_K.gguf
LFS Q2
8.28 GB Download
Magistral-Small-2507-Q2_K_L.gguf
LFS Q2
8.43 GB Download
Magistral-Small-2507-Q3_K_M.gguf
LFS Q3
10.69 GB Download
Magistral-Small-2507-Q3_K_S.gguf
LFS Q3
9.69 GB Download
Magistral-Small-2507-Q4_0.gguf
Recommended LFS Q4
12.57 GB Download
Magistral-Small-2507-Q4_1.gguf
LFS Q4
13.85 GB Download
Magistral-Small-2507-Q4_K_M.gguf
LFS Q4
13.35 GB Download
Magistral-Small-2507-Q4_K_S.gguf
LFS Q4
12.62 GB Download
Magistral-Small-2507-Q5_K_M.gguf
LFS Q5
15.61 GB Download
Magistral-Small-2507-Q5_K_S.gguf
LFS Q5
15.18 GB Download
Magistral-Small-2507-Q6_K.gguf
LFS Q6
18.02 GB Download
Magistral-Small-2507-Q8_0.gguf
LFS Q8
23.33 GB Download
Magistral-Small-2507-UD-IQ1_M.gguf
LFS
5.6 GB Download
Magistral-Small-2507-UD-IQ1_S.gguf
LFS
5.18 GB Download
Magistral-Small-2507-UD-IQ2_M.gguf
LFS Q2
7.68 GB Download
Magistral-Small-2507-UD-IQ2_XXS.gguf
LFS Q2
6.29 GB Download
Magistral-Small-2507-UD-IQ3_XXS.gguf
LFS Q3
8.76 GB Download
Magistral-Small-2507-UD-Q2_K_XL.gguf
LFS Q2
8.65 GB Download
Magistral-Small-2507-UD-Q3_K_XL.gguf
LFS Q3
11.04 GB Download
Magistral-Small-2507-UD-Q4_K_XL.gguf
LFS Q4
13.51 GB Download
Magistral-Small-2507-UD-Q5_K_XL.gguf
LFS Q5
15.61 GB Download
Magistral-Small-2507-UD-Q6_K_XL.gguf
LFS Q6
19.36 GB Download
Magistral-Small-2507-UD-Q8_K_XL.gguf
LFS Q8
27 GB Download