DEV Community

Aamer Mihaysi
Aamer Mihaysi

Posted on

Leanstral 1.5: Mistral's Open-Source Bet on Formal Verification Agents

Leanstral 1.5: Mistral's Open-Source Bet on Formal Verification Agents

I spent the morning pulling down Mistral's new Leanstral 1.5 — a 119B-parameter MoE model with 6.5B active parameters, purpose-built for Lean 4 theorem proving. It's Apache 2.0 licensed, runs on vLLM, and it's the first model I've seen that treats formal verification as a first-class agent use case rather than an afterthought.

Here's what I found.

What It Actually Is

Leanstral 1.5 is a code agent model fine-tuned from Mistral's Small 4 family. It's a Mixture of Experts architecture — 128 experts, 4 active per token — with 256k context and multimodal input (text + images). The base model is Leanstral-2603, and this 1.5 release is a significant update.

The headline number is 119B parameters with only 6.5B activated per token. That's roughly the same active parameter count as Llama 3 8B, but with 18x more total parameters to draw expertise from. The MoE design means inference cost stays manageable while the model retains broad knowledge.

Why Lean 4 Matters

Lean 4 is a proof assistant used to formalize everything from perfectoid spaces in mathematics to Rust program verification. It's not a niche academic tool anymore — companies like Amazon and Meta are investing in formal verification for critical infrastructure. The bottleneck has always been that writing Lean proofs is slow, even for experienced developers.

A model that can generate correct Lean code and proofs changes the economics of formal verification. Instead of spending days writing a single proof, you describe the theorem and let the agent handle the heavy lifting.

What I Tested

I deployed Leanstral 1.5 locally using vLLM (requires vllm >= 0.24.0 and mistral_common >= 1.11.5). The setup is straightforward:

vllm serve mistralai/Leanstral-1.5-119B-A6B \
  --max-model-len 200000 \
  --tensor-parallel-size 4 \
  --attention-backend FLASH_ATTN_MLA \
  --tool-call-parser mistral \
  --enable-auto-tool-choice \
  --reasoning-parser mistral
Enter fullscreen mode Exit fullscreen mode

You need at least 4 GPUs for tensor parallelism at 200k context. I ran it on 4x A100 80GB and it fit comfortably.

The model supports two reasoning modes: none for fast direct answers and high for complex proofs. Temperature is recommended at 1.0. I tested both modes on a few theorems from the PrimeNumberTheoremAnd repository.

Results: With reasoning_effort=high, the model produced correct Lean code for about 70% of the intermediate lemmas I threw at it. The reasoning traces are genuinely useful — you can see the model working through proof strategies before committing to code. In none mode, it was faster but noticeably less reliable on anything beyond trivial statements.

The Trade-Offs

The good: The model handles tool calling natively. You can give it a lean_run_code function and it will iterate on proofs autonomously, running code, checking errors, and fixing them. This is the agent loop that makes it practical — you don't need a separate orchestrator.

The catch: Running the full 119B model locally requires serious hardware. 4x A100 80GB is not a hobbyist setup. The Mistral API version works well and the free tier covers the model, but if you want local deployment for data privacy or latency control, budget accordingly.

The other catch: This model is specialized. It's not a general-purpose coding assistant. If you're not working with Lean 4, there are better options. But if you are working with Lean 4, nothing else comes close.

The Takeaway

Leanstral 1.5 is a signal of where open-source models are heading: not broader, but deeper. Instead of another general-purpose LLM that's okay at everything, Mistral built a specialist that's genuinely good at one hard thing. Formal verification is a high-value niche — bugs in smart contracts, protocol implementations, and safety-critical systems cost real money. A model that can write correct proofs is a tool with immediate ROI.

If you're doing any work with formal methods or Lean 4, try it. The API is free, the model is open, and the reasoning traces alone are worth studying to understand how an LLM thinks about proofs.

Top comments (0)