You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Produces checkpoints under `output_dir` that the `HFProver` consumes.
173
-
174
-
### GRPO Trainer (`GRPOTrainer`)
175
-
176
-
- Implements Group Relative Policy Optimization for reinforcement-style refinement.
177
-
- Accepts `reference_model`, `reward_weights`, and `kl_beta` settings.
178
-
- Useful for improving search policies on curated theorem batches.
179
-
180
-
### Retrieval Trainer & LeanAgent
181
-
182
-
-`RetrievalTrainer` trains the dense retriever that scores prior proofs.
183
-
-`LeanAgent` wraps the trainer, maintains repository curricula, and couples it with `RetrievalProver`.
184
-
185
-
Each agent inherits `BaseAgent`, so you can implement your own by overriding `_get_build_deps()` and `_setup_prover()` to register new trainer/prover pairs.
186
-
187
-
---
188
-
189
165
## Tracing and Dataset Generation
190
166
191
167
The `lean_dojo_v2/lean_dojo/data_extraction` package powers repository tracing:
The generated artifacts flow into the `DynamicDatabase`, which keeps repositories sorted by difficulty and appends new sorrys without retracing everything.
-`python/server.py` hosts a FastAPI service with adapters for Anthropic, OpenAI, Google Generative AI, vLLM, and custom HF models.
226
-
- Start the service with:
227
-
```sh
228
-
cd lean_dojo_v2/external_api/python
229
-
pip install -r requirements.txt
230
-
uvicorn server:app --port 23337
231
-
```
232
-
- Point your Lean client to the running server to interactively request tactics, proofs, or completions from external models.
209
+
### Retrieval Trainer & LeanAgent
233
210
234
-
### LeanProgress Step-Prediction Workflow
211
+
-`RetrievalTrainer` trains the dense retriever that scores prior proofs.
212
+
-`LeanAgent` wraps the trainer, maintains repository curricula, and couples it with `RetrievalProver`.
213
+
214
+
Each agent inherits `BaseAgent`, so you can implement your own by overriding `_get_build_deps()` and `_setup_prover()` to register new trainer/prover pairs.
215
+
216
+
## LeanProgress Step-Prediction
235
217
236
218
- Generate a JSONL dataset with remaining-step targets (or replace it with your own LeanProgress export):
LeanDojo-v2 supports two methods for theorem proving:
245
+
246
+
-**Whole-proof generation**: generate complete proof in one forward pass of the prover.
247
+
248
+
```python
249
+
from lean_dojo_v2.prover import ExternalProver
250
+
251
+
theorem ="theorem my_and_comm : ∀ {p q : Prop}, And p q → And q p := by"
252
+
prover = ExternalProver()
253
+
proof = prover.generate_whole_proof(theorem)
251
254
```
252
-
- Add `use_reward=true` when calling `/generate`. Each output now includes `steps_remaining` and a reward value (currently `-steps_remaining`) so agents can minimize proof length.
253
255
254
-
---
256
+
-**Proof search**: generate tactics sequentially and update the goal state through interaction with Pantograph until the proof is complete.
0 commit comments