Skip to content
Back to Blog
Model Releases

Leanstral by Mistral AI: The Open-Source Proof Agent Revolutionizing Code Verification

Mistral AI introduces Leanstral, the first open-source code agent for Lean 4 formal proof engineering, outperforming Claude Sonnet 4.6 at 15x lower cost.

March 16, 2026
Model ReleaseLeanstral

Introduction

Mistral AI has officially unveiled Leanstral on March 16, 2026, marking a significant milestone in the evolution of AI-assisted software engineering. This release addresses the persistent bottleneck of human review in formal verification processes, offering a scalable solution for developers who require mathematical certainty in their code. Unlike previous models that generate syntax without validation, Leanstral is purpose-built to generate machine-checkable proofs alongside executable code.

The industry has long struggled with the reliability of AI-generated software, particularly in critical systems where bugs are unacceptable. Leanstral changes this paradigm by integrating Lean 4, a powerful proof assistant, directly into the AI workflow. This ensures that the output is not just syntactically correct but logically sound, reducing the risk of runtime errors and security vulnerabilities in production environments.

  • First open-source code agent for Lean 4 formal proof engineering
  • Generates code AND machine-checkable mathematical proofs
  • Apache 2.0 license ensures full commercial freedom

Key Features & Architecture

At its core, Leanstral is architected as a massive Mixture of Experts (MoE) model designed for hardware efficiency without sacrificing reasoning capabilities. The model utilizes a total parameter count of 119 billion, with only 6.5 billion active parameters per token. This sparse activation strategy allows for faster inference times and lower memory footprint compared to dense models of similar size, making it viable for deployment on a wider range of hardware infrastructures.

The architecture is specifically tuned for the logical complexity required in formal verification. It understands the syntax of Lean 4 deeply, enabling it to construct proofs that satisfy the theorem prover. This dual capability of coding and proving is unique in the open-source landscape, bridging the gap between rapid prototyping and rigorous validation.

  • 119B Total Parameters (MoE)
  • 6.5B Active Parameters per token
  • Context Window: 128k tokens
  • Apache 2.0 License

Performance & Benchmarks

Performance testing reveals significant leaps in capability compared to general-purpose coding models. On the FLTEval benchmark, Leanstral outperforms Claude Sonnet 4.6, demonstrating superior ability in formal verification tasks. This is a critical metric for developers working on safety-critical software where standard code generation is insufficient.

Beyond formal proofs, the model maintains high performance on standard coding benchmarks. It achieves top-tier scores on HumanEval and SWE-bench, indicating that it does not sacrifice general programming proficiency for the sake of mathematical rigor. The model effectively balances the need for speed with the need for correctness, a balance that has historically been difficult to achieve in AI agents.

  • FLTEval Score: Higher than Claude Sonnet 4.6
  • HumanEval: Top 1% of open models
  • SWE-bench: 65% pass rate
  • Reasoning: Optimized for logical deduction

API Pricing

Cost efficiency is a primary driver for the Leanstral release, making formal verification accessible to startups and enterprises alike. Mistral AI positions the model as 15x cheaper than Claude Opus for formal verification tasks. This pricing structure is designed to lower the barrier to entry for high-assurance software development, encouraging adoption of formal methods without breaking the budget.

The pricing model reflects the hardware-efficient architecture of the model. Developers can expect significantly reduced costs per token compared to proprietary competitors. This makes Leanstral an attractive option for long-running verification pipelines that would otherwise be cost-prohibitive with standard large language models.

  • 15x cheaper than Claude Opus for verification
  • Input Cost: Optimized for high-volume tasks
  • Output Cost: Competitive with industry standards
  • No hidden fees for commercial use

Comparison Table

To contextualize the performance and cost advantages, we have compared Leanstral against leading competitors in the current market. The table below highlights key metrics including context window, pricing, and specific strengths. This comparison demonstrates why Leanstral is the preferred choice for formal verification workflows.

While general coding models like GPT-5.4 mini offer broad utility, they lack the specialized training required for Lean 4 proofs. Leanstral fills this niche, offering specialized capabilities that generalists cannot match, all at a fraction of the cost of proprietary alternatives.

  • Specialized for Lean 4
  • Open Source Access
  • Lower Cost per Token

Use Cases

Leanstral is best suited for applications where code correctness is non-negotiable. Smart contracts in blockchain environments are a prime example, where a single logic error can lead to financial loss. The model can generate and verify the code automatically, ensuring that the smart contract logic matches the intended specification.

Other ideal use cases include aerospace software, financial trading algorithms, and cryptographic implementations. In these domains, the cost of a bug far outweighs the cost of verification. Leanstral automates the tedious process of writing proofs, allowing human engineers to focus on high-level architecture and system design rather than low-level verification details.

  • Smart Contract Verification
  • Aerospace and Defense Software
  • Cryptographic Protocol Design
  • Automated Testing Pipelines

Getting Started

Developers can access the model immediately via the Mistral AI API or by downloading the weights from Hugging Face. The API endpoint provides standard SDK support for Python, JavaScript, and Go, allowing for seamless integration into existing CI/CD pipelines. No special hardware is required to access the model via the cloud API.

For local deployment, the Apache 2.0 license permits the use of the model weights on any hardware. Mistral provides detailed documentation on quantization techniques to optimize the model for consumer-grade GPUs. This flexibility ensures that the model can be utilized in both cloud-native and edge computing environments.

  • Access via Mistral AI API
  • Weights available on Hugging Face
  • SDKs for Python, JS, Go
  • Local deployment supported

Comparison

API Pricing β€” Input: $0.02 / Output: $0.08 / Context: 128k


Sources

Leanstral: Open-Source foundation for trustworthy vibe-coding

Mistral AI has released 'Leanstral,' an open-source proof verification platform

Leanstral by Mistral AI: The AI That Proves Your Code Is Correct