Leanstral: Mistral’s Open-Source AI for Trustworthy Coding
In fast-growing AI development, trust is the biggest challenge in high-risk areas.
Large language models can write code. But for hard math or critical software, people still must check that everything is correct.
On March 16, 2026, Mistral AI released Leanstral, the first open-source code agent built for Lean 4.
Leanstral is not another coding LLM. It is implemented to generate the code and formally prove the correctness of the code using Lean 4, a powerful proof assistant.
This moves from hoping the code works to making sure it is correct. The Artificial Intelligence now creates code that follows strict rules and can be verified.
What is Lean 4 & why is it important?
Lean 4 is a tool and programming language used to prove math ideas and check that code is correct.
It lets people write math ideas and software rules in a way that a computer can check and prove.
Unlike traditional programming, Lean does not stop you from writing the code and the proof that it behaves as intended. This feature makes it invaluable for:
- Research mathematics Frontiers
- Verified software in safety critical systems (aerospace, finance, cryptography)
- Algorithm formal verification
However, creating and maintaining large formal repositories in Lean is labour intensive.
AI agents built on general models often lack precision. Because of this, humans still need to review their work.
Introducing Leanstral: Efficiency and Expertise
Leanstral (Leanstral-2603) is a Mixture-of-Experts AI model. It has 119B total parameters, but only 6.5B are used at a time.
This design makes the model very efficient while still giving strong results for proof and coding tasks.
Key specifications :
- Context length: 256k tokens (recommended 200k for the best result)
- Modalities: Text + image input, text output (multimodal capabilities)
- Multilingual support: Exceptional performance in English, French, Spanish, German, Italian, Portuguese, Dutch, Chinese, Japanese, Korean, and in Arabic.
- License: Apache 2.0: It is fully open source for commercial and research use.
- Optimized for: Calling tools (especially with lean – lsp – mcp), reasoning, coding and vision.
It is a part of Mistral’s Small 4 family and can work through:
- Mistral Vibe (with the /leanstall command for agent mode with 0 setup)
- Free/near free api endpoint (labs- leanstral-2603)
- Self hosted using vLLM (highly recommended for production)
Performance: Beating Giants at a fraction of the cost
Leanstral’s efficiency is on real world formal proof tasks.
Mistral also introduced FLTEval, a new test set. It checks how well the model can finish math proofs in real projects, like the one for Fermat’s Last Theorem.
In benchmarks that used Mistral Vibe as the agent scaffold:
- Leanstral outperforms other larger open source models (such as Qwen3.5, Kimi-Q2.5, GLM5) in terms of scores and number of inference passes.
- Pass@2: 26.3 (for $36 – beats Claude Sonnet 4.6’s 23.7 for $549)
- Pass@16: 31.9 points (for $ 290, beats Sonnet by 8 points; Opus 4.6 (costs $ 1,650 for its 39.6)
Leanstral provides competitive or superior results to the Claude suite at 1/15th to 1/90th the cost, depending upon pass budget.
This strong performance comes from its MoE design and its close work with Lean, which checks proofs and gives fast feedback.
Why Leanstral is important in the future of AI development
Leanstral addresses a critical challenge of existing artificial intelligence (AI) coding agents, verification.
By mixing code generation with formal proof, it can create AI agents that suggest code and make sure it follows the rules.
The implications are deep:
- Faster mathematical research: faster formalization of new theorems.
- Safer software: Verified implementations for critical systems
- Democratization: Open-source access makes it easier for people and groups to use formal methods.
- Agent evolution: Agents can get upgrades with MCPs and the community can help improve them.
As Mistral points out, the human review bottleneck was the main drag on velocity in engineering in high stakes domains.
Leanstral flips the script: humans tell AI what they want and AI gives provably correct solutions.
Getting started in Leanstral
- Try it on Mistral Vibe using
/leanstall. - API: Use the labs endpoint for feedback.
- Self-hosting: Download from Hugging Face (mistralai/Leanstral-2603) and run with vLLM. Example launch command supports tool calling and large contexts.
A technical report and the FLTEval test set were released to help AI move beyond simple math contests.
Conclusion
Leanstral is a major step on the way to consistent provable AI systems.
By focusing on Lean 4 and staying open-source, Mistral AI made a tool that is strong, low-cost, and shows what trustworthy AI coding can do.
If you are a mathematician, a software developer, or an AI fan, Leanstral is worth trying.
The era of provably correct AI generated code is coming – and it is open for all.
Want to Build AI-powered solutions visit Webkul!