What is Leanstral
Leanstral is Mistral AI's first open-source AI code agent, designed specifically for the Lean 4 theorem prover. The model uses a sparse architecture with 120B total parameters / 6B activated parameters, and can automatically generate formal proofs and verify code correctness. Compared with giant competitors, Leanstral achieves higher efficiency at extremely low cost ($18 per run), and performs excellently in evaluations on real mathematical codebases (such as the Fermat's Last Theorem project). The model supports extension through the MCP protocol and has been integrated into the Mistral Vibe platform.
Leanstral's main features
-
Automatic formal proof generation: For the Lean 4 proof assistant, automatically generates rigorous mathematical proofs and software specification verification code.
-
Code correctness verification: Through Lean 4's complete verifier, ensures that generated code conforms to strict formal specifications, eliminating the manual review bottleneck.
-
Intelligent diagnosis and repair: Supports analyzing the reasons for code failures (such as identifying
defandabbrevdifferences in type aliases), and provides precise repair solutions. -
Cross-language conversion: Supports automatically converting other proof languages (such as Rocq/Coq) into Lean 4 code, preserving custom notation.
-
Theorem proving assistance: Completes formal proofs and definitions of new mathematical concepts in real mathematical codebases (such as the Fermat's Last Theorem project).
Leanstral's key information and usage requirements
- Developer:Mistral AI
- Positioning: The first open-source AI code agent designed specifically for Lean 4
- Architecture: Sparse mixture of experts (MoE), 120B total parameters / 6B activated parameters
- License: Apache 2.0 (fully open source)
- Cost: $18 per run, only $36 for pass@2 (compared with Claude Sonnet at $549)
- Performance: FLTEval score 29.3 (pass@4), surpassing most open-source competitors
- Mistral Vibe: Zero-configuration integration, usable by entering /leanstall
- Labs API: Free/low-cost endpoint labs-leanstral-2603 (available for a limited time)
- Local deployment: Download the open-source weights and run them yourself
Leanstral's core advantages
-
Extreme efficiency: Surpasses hundred-billion-level open-source models with only 6B activated parameters, achieving the best balance between performance and cost.
-
Cost revolution: Requires only $18 per task, achieving better verification results at 1/15 the price of Claude Sonnet.
-
Fully open source: Opens weights under the Apache 2.0 license, eliminating vendor lock-in and supporting private deployment and autonomous control.
-
Vertical optimization: Deeply trained for Lean 4 proof engineering, performing far beyond general large models in real mathematical codebases.
-
Trustworthy verification: Supports generated code accompanied by formal mathematical proofs, transforming the manual review bottleneck into automatic machine verification.
-
Ecosystem compatibility: Natively supports the MCP protocol and can seamlessly integrate with existing development toolchains and language servers.
How to use Leanstral
- Mistral Vibe (recommended for beginners): Visit the Mistral Vibe platform and enter in the conversation
/leanstallcommand to start with zero configuration, no need to install any local environment. - Labs API (Developer): Call the API endpoint
labs-leanstral-2603, currently free for a limited time, suitable for integration into automated workflows or custom applications. - Local Deployment (Advanced Users): Download the Apache 2.0 licensed model weights from official channels and run them independently on your own hardware, achieving complete data privacy and control.
- Usage Recommendations: Best performance is achieved with the
lean-lsp-mcptool, suitable for scenarios such as formal mathematical proofs and high-assurance software verification.
Leanstral's project address
- Project official website:https://mistral.ai/news/leanstral
Comparison of Leanstral with similar competitors
| Comparison dimension | Model | Scale | FLTEval score | Cost | Features |
|---|---|---|---|---|---|
| Leanstral | Leanstral-120B-A6B | 120B/6B | 26.3 (pass@2) 29.3 (pass@4) 31.9 (pass@16) |
$18-$290 | Optimized specifically for Lean 4, open source, MCP extension |
| Open-source competitor | Qwen3.5-397B-A17B | 397B/17B | 25.4 (pass@4) | – | Requires 4 rounds to achieve the effect of Leanstral in 2 rounds |
| Kimi-K2.5-1T-A32B | 1T/32B | 20.1 (pass@4) | – | Huge scale but obvious score bottleneck | |
| GLM5-744B-A40B | 744B/40B | 16.6 (pass@4) | – | Largest parameter count but worst performance | |
| Closed-source competitor | Claude Opus 4.6 | – | 39.6 | $1,650 | Highest quality but cost is 92 times that of Leanstral |
| Claude Sonnet 4.6 | – | 23.7 | $549 | Cost is 15 times that of Leanstral, with lower scores | |
| Claude Haiku 4.5 | – | 23.0 | $184 | Mediocre cost-effectiveness |
Leanstral's application scenarios
- Formal mathematical proofs: Automatically complete formal proofs in large mathematical projects such as Fermat's Last Theorem, and correctly define new mathematical concepts.
- High-assurance software verification: Verify strict properties of code snippets in programming languages such as Rust, ensuring software correctness for mission-critical systems.
- Codebase migration and adaptation: Diagnose and fix breaking changes caused by Lean version upgrades, for example automatically identifying
defandabbrevdifferences in type aliases and providing fixes. - Cross-language code conversion: Fully convert code in other proof languages such as Rocq/Coq to Lean 4, preserving custom notation and logical structure.
- Intelligent debugging and diagnosis: The model supports analyzing the root causes of compilation failures, automatically generating test cases to reproduce problems, and providing precise fixes and explanations of the underlying principles.