Use AIUnderstand AIBuild with AI
Build with AI·Model deep dive·· 5 min read

Run Mistral Large 4: 1T MoE with Reasoning Effort and JSON Schemas

Mistral Large 4 is a 1T-parameter multimodal MoE with 1M context. Serve it with vLLM, set reasoning effort, and enforce strict JSON schemas.

The code in this post comes from the model's docs and hasn't been run in our CI yet. If something breaks, let us know.

Mistral Large 4 is Mistral’s largest model so far: a natively multimodal Mixture-of-Experts model with about 1 trillion total parameters and 49 billion active per token (52 billion including embeddings and output layers). The card says it was trained from scratch on 3,800 NVIDIA Grace Blackwell GPUs in Mistral’s own datacenters in Europe. It folds instruction following, reasoning, coding and agentic work into one set of weights, and you choose how much it reasons per request.

Key specs

Item From the model card
Parameters ~1T total, ~52B active (49B active excluding embeddings and output layers)
Experts 128 routed experts, 4 active per token, plus 1 shared expert
Context 1M tokens
Input / output Text and image in, text out
Reasoning effort low, medium, high (default high)
Languages Card lists 160+ languages, including every official EU language
Agentic features Native function calling, JSON output, strict JSON schema enforcement
License Mistral Ecosystem Open-Weight License

The card also lists a separate NVFP4 checkpoint (mistralai/Mistral-Large-4-1T-A52B-NVFP4) that targets Blackwell GPUs and supports vLLM and SGLang. This post covers the main checkpoint.

The card recommends temperature=1.0 and top_p=0.95 for all reasoning efforts. For the effort level:

  • high for complex prompts and agentic use
  • medium for day-to-day use
  • low for fast chat replies

It also advises a clear system prompt that describes the environment and use case, and keeping the tool set small.

Serve it with vLLM

The card recommends vLLM and gives an official Docker image.

Terminal window
docker pull vllm/vllm-openai:mistral-large-4
Terminal window
docker run --runtime nvidia --gpus all \
-v ~/.cache/huggingface:/root/.cache/huggingface \
-p 8000:8000 \
--ipc=host \
vllm/vllm-openai:mistral-large-4 \
--model mistralai/Mistral-Large-4-1T-A52B \
--tensor-parallel-size 8 \
--tool-call-parser mistral \
--reasoning-parser mistral \
--enable-auto-tool-choice \
--gpu-memory-utilization 0.85

The two parsers matter: per the card, --tool-call-parser mistral and --reasoning-parser mistral are required for tool use and for separating reasoning from the answer. If you run short of GPU memory, the card suggests lowering --max-model-len and/or --max-num-seqs.

Call it with a reasoning effort

The server speaks the OpenAI-compatible API. Note that max_completion_tokens counts reasoning tokens as well as visible output.

chat.py
from openai import OpenAI
client = OpenAI(api_key="EMPTY", base_url="http://localhost:8000/v1")
model = client.models.list().data[0].id
response = client.chat.completions.create(
model=model,
messages=[
{
"role": "user",
"content": "Write me a sentence where every word starts with the next letter in the alphabet - start with 'a' and end with 'z'.",
}
],
reasoning_effort="low", # Increase with 'medium' or 'high'.
temperature=1.0,
top_p=0.95,
max_completion_tokens=4096,
)
print("REASONING")
print(response.choices[0].message.reasoning)
print("CONTENT")
print(response.choices[0].message.content)

Enforce a strict JSON schema

The card says the model enforces response formats natively, including strict JSON schemas.

schema.py
from openai import OpenAI
client = OpenAI(api_key="EMPTY", base_url="http://localhost:8000/v1")
model = client.models.list().data[0].id
response = client.chat.completions.create(
model=model,
messages=[{"role": "user", "content": "What is 1 + 1? Answer as JSON."}],
reasoning_effort="medium",
temperature=1.0,
top_p=0.95,
response_format={
"type": "json_schema",
"json_schema": {
"name": "arithmetic_answer",
"strict": True,
"schema": {
"type": "object",
"properties": {"answer": {"type": "string"}},
"required": ["answer"],
"additionalProperties": False,
},
},
},
max_completion_tokens=16384,
)
print(response.choices[0].message.content)

Image input with a tool call

The card’s example sends an image plus a calculator tool, runs the tool the model asks for, and sends the results back. This version follows it; the card’s own example reads an equations image from a URL.

vision_tool.py
import json
from openai import OpenAI
client = OpenAI(api_key="EMPTY", base_url="http://localhost:8000/v1")
model = client.models.list().data[0].id
image_url = "https://math-coaching.com/img/fiche/46/expressions-mathematiques.jpg"
def my_calculator(expression: str) -> str:
return str(eval(expression)) # demo only: never eval untrusted input
tools = [
{
"type": "function",
"function": {
"name": "my_calculator",
"description": "A calculator that can evaluate a mathematical expression.",
"parameters": {
"type": "object",
"properties": {
"expression": {
"type": "string",
"description": "The mathematical expression to evaluate.",
},
},
"required": ["expression"],
},
},
}
]
messages = [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Thanks to your calculator, compute the results for the equations that involve numbers displayed in the image.",
},
{"type": "image_url", "image_url": {"url": image_url}},
],
}
]
response = client.chat.completions.create(
model=model,
messages=messages,
tools=tools,
tool_choice="auto",
reasoning_effort="high",
temperature=1.0,
top_p=0.95,
)
tool_calls = response.choices[0].message.tool_calls
results = []
for tool_call in tool_calls:
if tool_call.function.name == "my_calculator":
results.append(my_calculator(**json.loads(tool_call.function.arguments)))
messages.append({"role": "assistant", "tool_calls": tool_calls})
for tool_call, result in zip(tool_calls, results):
messages.append(
{
"role": "tool",
"tool_call_id": tool_call.id,
"name": tool_call.function.name,
"content": result,
}
)
response = client.chat.completions.create(
model=model,
messages=messages,
reasoning_effort="high",
temperature=1.0,
top_p=0.95,
)
print(response.choices[0].message.content)

Speculative decoding (DSpark)

The checkpoint ships with an embedded DSpark draft head: 3 dense MLA draft layers in BF16 that propose blocks of 3 tokens. To turn it on in vLLM, add this to the serve command:

Terminal window
--speculative-config '{"method": "dspark", "num_speculative_tokens": 3}'

Mistral says it measured up to 1.9x higher throughput than serving the target model alone, and that outputs are unchanged. Gains depend on hardware and workload.

Other ways to run it

The card also documents SGLang (image lmsysorg/sglang:mistral-large-4, with --tp-size 8 and --speculative-algorithm DSPARK in its example) and Transformers (install from main, launched with torchrun --nproc-per-node 8). It links GGUFs for llama.cpp and fine-tuning guides for Axolotl, Unsloth and TRL. The card also notes that if local serving is subpar, the Mistral API serves the model as mistral-large-4.

Gotchas

  • Hardware. Every serving recipe in the card uses eight-way tensor parallelism. Plan for a multi-GPU node, not a single card.
  • Parsers are required. The card says both mistral parsers are required for tool use and for separating reasoning from content in vLLM.
  • Token budgets. max_completion_tokens includes reasoning tokens, so a low limit at high effort can leave little room for the answer.
  • Transformers needs main. The card says to install it from the main branch.
  • License. It is a modified MIT license for commercial and non-commercial use, but running a Model-as-a-Service business requires a separate commercial license from Mistral.

When to pick it

Pick it if you have a multi-GPU node and want one open-weight model for coding, agent work, strict JSON output, image input and very long context, with a per-request dial for reasoning depth. The card’s headline numbers are 48% on the Artificial Analysis Coding Agent Index (effectively tied with GLM-5.3 while using 47% fewer tokens per task) and 26 on the Intelligence Index v5, which it describes as the highest among western open-weight models, while noting that leading Chinese open-weight models score higher on that aggregate.

Skip it if you need a small local model, or if you plan to sell hosted access to it without a commercial agreement. If you don’t have the hardware, the card says the model is also served on the Mistral API as mistral-large-4.

Related