Leanstral:信頼できるバイブコーディングのためのオープンソース基盤
AIエージェントはコード生成に優れるが、高リスク領域では人間の検証がボトルネックとなる。Leanstralは、この人的レビューの負担を軽減し、エンジニアリング速度を向上させるための信頼性の高いオープンソース基盤を提供する。
Source Article
元記事を日本語で読む
本文に関係しない購読案内、埋め込み通知、サイト内プロモーションは除いています。
AI エージェントはコード生成において非常に能力の高いツールであることが証明されています。しかし、最先端の研究数学からミッションクリティカルなソフトウェアに至るまで、これらのモデルを高リスク領域に適用しようとする際、私たちはスケーリングのボトルネックに直面します:それは人間のレビューです。手動で検証するために必要な時間と専門知識が、エンジニアリングの速度に対する主要な impedance(阻害要因)となっています。
私たちは、タスクを実行すると同時に、厳格な仕様に対して実装を形式的に証明する、より有益な次世代のコーディングエージェントを構想しています。機械生成ロジックのデバッグを行うのではなく、人間が何を望むかを指示します。本日、私たちはそのビジョンに向けた最初の大きな一歩を踏み出します。
Leanstral の紹介
Lean 4 用に設計された初のオープンソースコードエージェントである Leanstral をリリースします。Lean4 は、perfectoid spaces(完全体空間)のような複雑な数学的対象や、Rust フラグメントの特性 といったソフトウェア仕様を表現できる証明支援系です。既存の証明システムが汎用大規模モデルをラップするものや単一の数学問題に焦点を当てるものであるのに対し、Leanstral は非常に効率的(アクティブパラメータ数 6B)であり、現実的な形式リポジトリで動作するように訓練されています。
- オープンでアクセス可能:Leanstral の重みは Apache 2.0 ライセンスの下、Mistral のバイブ(vibe)モード内のエージェントとして、および無料の API エンドポイントを通じて公開されます。また、トレーニング手法を詳細に記した技術レポートと、競技数学への焦点を超えた評価を可能にする新たな評価スイート「FLTEval」も公開する予定です。
- 効率的かつ強力:Leanstral は証明工学タスク向けに最適化された極めてスパースなアーキテクチャを採用しています。完璧な検証ツールである Lean を活用した並列推論により、既存のクローズドソース競合他社製品に対して高性能かつコスト効率を実現しています。
- MCP によるアップグレード対応:Leanstral はバイブ(vibe)を通じて任意の MCP(Model Context Protocol)をサポートしており、特に頻繁に使用される「lean-lsp-mcp」との組み合わせで最大限のパフォーマンスを発揮するように特別にトレーニングされています。
評価
現実的な証明工学シナリオにおける有用性を反映させるため、Leanstral のベンチマークは、FLT プロジェクトへの各 PR(Pull Request)においてすべての形式化された証明を完了し、新しい数学的概念を正しく定義できるかを対象として行います。これは孤立した数学的問題に対する評価とは異なります。Leanstral は、主要なコーディングエージェント(Claude Opus 4.6, Sonnet 4.6, Haiku 4.5)およびオープンソースモデル(Qwen3.5 397B-A17B, Kimi-K2.5 1T-A32B, GLM5 744B-A40B)と比較されます。
Leanstral vs. OSS モデル
Leanstral-120B-A6B は、はるかに大きなオープンソースの競合モデルと比較して、顕著な効率性の優位性を示しています。GLM5-744B-A40B や Kimi-K2.5-1T-32B といったモデルはスケーリングに苦しみ、FLTEval スコアがそれぞれ約 16.6 と 20.1 で頭打ちになる中、Leanstral は単一のパス(single pass)でこれら両者を上回っています。
最も強力な OSS 競合である Qwen3.5-397B-A17B でさえ、スコア 25.4 に達するには 4 パスが必要です。それに対し Leanstral は、その半分以下の投資(pass@2)でより優れたスコア 26.3 を達成し、線形にスケールを続け、同じコストレベルで 29.3 に到達します。

Leanstral vs. Claude Family
Leanstral は、Claude シリーズに対する高価値な代替案として機能し、その数分の一の価格で競争力のあるパフォーマンスを提供します。Leanstral の pass@2 はスコア 26.3 を達成し、Sonnet よりも 2.6 ポイント上回りますが、実行コストは Sonnet の 549 ドルに対してわずか 36 ドルです。pass@16 では Leanstral はスコア 31.9 に達し、Sonnet を 8 ポイント引き離して余裕を持って勝利します。Claude Opus 4.6 は品質において依然としてリーダーですが、そのコストは驚異的な 1,650 ドルで、Leanstral の実行コストの 92 倍に相当します。
ベンチマークでは、評価のために特別に修正を加えず、Mistral Vibe をスケフォールド(基盤)として使用しました。
モデル | コスト ($) | スコア
---|---|---
Haiku | 184 | 23.0
Sonnet | 549 | 23.7
Opus | 1,650 | 39.6
Leanstral | 182 | 21.9
Leanstral pass@2 | 36 | 26.3
Leanstral pass@4 | 72 | 29.3
Leanstral pass@8 | 145 | 31.0
Leanstral pass@16 | 290 | 31.9
ケーススタディ
新しい Lean バージョンの変更に関する Stack Exchange の投稿への回答
破壊的変更が新しい Lean リリースに適用されると、コードの移行は大きな頭痛の種になり得ます。私たちは Leanstral に、Proof Assistants Stack Exchange からの実際の質問 a real-world question from the Proof Assistants Stack Exchange を入力しました。これは、Lean 4.29.0-rc6 で突然コンパイルが停止したスクリプトに関するものであり、このバージョンは学習データに含まれていませんでした(最新のため)。その原因は、単純な型エイリアス def T2 := List Bool で定義されたパターンを suddenly 一致させられなくなった書き換え (rw) タクティクスでした。
闇雲に試行錯誤するのではなく、Leanstral は袖をまくり上げました。失敗した環境を再現するためのテストコードを成功裏に構築し、定義的等価性に関する根本的な問題を特定しました。モデルは正しく、def が明示的な展開を必要とする剛性の高い定義を作成するため、rw タクティクスがマッチングに必要な基底構造を見ることができなくなっていると指摘しました。
提案された修正は単純でした:def を abbrev に置き換えることです。abbrev は透明なエイリアスを作成し、元の型と即座に定義的等価となるため、rw タクティクスは証明内で再びパターン (L2 n).length を完璧に一致させることができるようになりました。Leanstral は作業を完了し、その理由をユーザーに対して完全に説明します。
プログラムに関する推論
Rocq の定義を https://www.cs.princeton.edu/courses/archive/fall10/cos441/sf/Imp.html からコピーし、Leanstral に Lean への変換を依頼しました。Leanstral はこれを成功裡に実行し、カスタム記法の実装さえ行いました。例を示します:
また、Rocq の記述(証明なし)のみを与えられただけでも、この言語のプログラムに関するいくつかの性質を Lean へ変換して証明することも可能です。
証明を要求する。Leanstral を今日からお試しください。
Leanstral は現在、誰でも利用可能です。
- Mistral Vibe でのゼロセットアップ:Leanstral を Mistral Vibe に直接統合し、即時のゼロセットアップによる「バイブコーディング」と証明を実現しました。/leanstall と入力してアクティブ化してください。その後、Shift+Tab を押してモデルが Leanstral として表示されるまで待ちます。あるいは、vibe --agent lean を使用することもできます。
- Labs API:無料またはほぼ無料の API エンドポイント labs-leanstral-2603 を通じてモデルにアクセスできます。次世代の検証済みコードモデルを強化するための現実的なフィードバックと観測データを収集するため、このエンドポイントは限られた期間、非常に高いアクセシビリティを維持します。
- ウェイトの所有:Apache 2.0 ライセンスの下でモデルをダウンロードし、ご自身のハードウェア上で実行できます。
原文を表示
AI agents have proven to be highly capable tools at code generation. Yet, as we push these models to high-stakes domains, ranging from frontier research mathematics to mission-critical software, we encounter a scaling bottleneck: the human review. The time and specialized expertise required to manually verify become the primary impedance of engineering velocity.
We envision a more helpful generation of coding agents to both carry out their tasks and formally prove their implementations against strict specifications. Instead of debugging machine-generated logic, humans dictate what they want. Today, we are taking the first major step toward that vision.
Introducing Leanstral
We release Leanstral, the first open-source code agent designed for Lean 4. Lean4 is a proof assistant capable of expressing complex mathematical objects such as perfectoid spaces and software specifications like properties of Rust fragments. Unlike existing proving systems that act as wrappers around large generalist models or focus on single math problems, Leanstral is designed to be highly efficient (with 6B active parameters) and trained for operating in realistic formal repositories.
- Open and accessible: We release Leanstral weights under an Apache 2.0 license, in an agent mode within Mistral vibe, and through a free API endpoint. We will also release a tech report detailing our training approach, and a new evaluation suite FLTEval, to move evaluations beyond their focus on competition math.
- Efficient and mighty: We use a highly sparse architecture for Leanstral, and optimise it for proof engineering tasks. Leveraging parallel inference with Lean as a perfect verifier, Leanstral is both performant and cost-efficient against existing closed-source competitors.
- Upgradable via MCP: Leanstral supports arbitrary MCPs through vibe, and was specifically trained to achieve maximal performance with the frequently used lean-lsp-mcp.
Evaluation
To reflect usefulness in realistic proof engineering scenarios, we benchmark Leanstral for completing all formal proofs and correctly defining new mathematical concepts in each PR to the FLT project, instead of isolated mathematical problems. We compare Leanstral against leading coding agents (Claude Opus 4.6, Sonnet 4.6, Haiku 4.5) and open-source models (Qwen3.5 397B-A17B, Kimi-K2.5 1T-A32B, GLM5 744B-A40B).
Leanstral vs. OSS Models
Leanstral-120B-A6B demonstrates a significant efficiency advantage over its much larger open-source peers. While models like GLM5-744B-A40B and Kimi-K2.5-1T-32B struggle to scale, capping their FLTEval scores at approximately 16.6 and 20.1 respectively, Leanstral outperforms them both with just a single pass.
Even Qwen3.5-397B-A17B, the strongest OSS competitor shown, requires 4 passes to reach a score of 25.4. In contrast, Leanstral achieves a superior score of 26.3 with half that investment (pass@2) and continues to scale linearly, reaching 29.3 at the same cost level.

Leanstral vs. Claude Family
Leanstral serves as a high-value alternative to the Claude suite, offering competitive performance at a fraction of the price: Leanstral pass@2 reaches a score of 26.3, beating Sonnet by 2.6 points, while costing only $36 to run, compared to Sonnet’s $549. At pass@16, Leanstral reaches a score of 31.9, comfortably beating Sonnet by 8 points. While Claude Opus 4.6 remains the leader in quality, it carries a staggering cost of $1,650, 92 times higher than running Leanstral.
In our benchmarking, we used Mistral Vibe as the scaffold with no modifications specifically for the evaluation.
ModelCost ($)Score
Haiku18423.0
Sonnet54923.7
Opus1,65039.6
Leanstral1821.9
Leanstral pass@23626.3
Leanstral pass@47229.3
Leanstral pass@814531.0
Leanstral pass@1629031.9
Case studies
Answering stackexchange posts about changes in newest Lean version
When breaking changes hit a new Lean release, migrating code can be a massive headache. We fed Leanstral a real-world question from the Proof Assistants Stack Exchange about a script that mysteriously stopped compiling in Lean 4.29.0-rc6 (which we did not train with due to its recency). The culprit was a rewrite (rw) tactic that suddenly failed to match patterns involving a simple type alias, initially written as def T2 := List Bool.
Instead of taking a stab in the dark, Leanstral rolled up its sleeves. It successfully built test code to recreate the failing environment and diagnosed the underlying issue with definitional equality. The model correctly identified that because def creates a rigid definition requiring explicit unfolding, it was actively blocking the rw tactic from seeing the underlying structure it needed to match.
The fix it proposed was simple: just swap def for abbrev. Because abbrev creates a transparent alias that is immediately definitionally equal to the original type, the rw tactic could once again perfectly match the pattern (L2 n).length in the proof. Leanstral completes the job and explains the rationale to the user perfectly.
Reasoning about programs
We copied over definitions in Rocq from https://www.cs.princeton.edu/courses/archive/fall10/cos441/sf/Imp.html and asked Leanstral to convert to Lean. It did so successfully, even implementing custom notation. Example snippet:
It could also translate to Lean and then prove some properties about programs in this language when just given the Rocq statement (without proof):
Demand Proof. Try Leanstral Today.
Leanstral is available today for everyone to use.
- Zero-Setup in Mistral Vibe: We’ve integrated Leanstral directly into Mistral Vibe for immediate, zero-setup vibe coding and proving. Use /leanstall to active. Then to use Leanstral press Shift+Tab until the model displays as Leanstral, Alternately, use vibe --agent lean.
- Labs API: Access the model via our free/near-free API endpoint labs-leanstral-2603. We are keeping this endpoint highly accessible for a limited period to gather realistic feedback and observability data to fuel the next generation of verified code models.
- Own the Weights: Download the Apache 2.0 licensed model and run it on your own metal.
関連記事
News to Guide
ニュースの次に確認する
発表内容を、現在の料金や仕様と照らし合わせられる関連ガイドです。
今日のまとめ
AIデイリーブリーフで今日の重要ニュースをまとめ読み