Metadata-Version: 2.4
Name: lean-library
Version: 1.0.2
Summary: A comprehensive library for AI-assisted theorem proving in Lean
Author: LeanLibrary Contributors
License: MIT
Project-URL: Homepage, https://github.com/lean-dojo/LeanLibrary
Project-URL: Repository, https://github.com/lean-dojo/LeanLibrary
Project-URL: Documentation, https://github.com/lean-dojo/LeanLibrary
Project-URL: Bug Tracker, https://github.com/lean-dojo/LeanLibrary/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: torch>=1.12.0
Requires-Dist: pytorch-lightning[extra]>=1.9.0
Requires-Dist: transformers>=4.20.0
Requires-Dist: numpy>=1.21.0
Requires-Dist: deepspeed>=0.7.0
Requires-Dist: loguru>=0.6.0
Requires-Dist: networkx>=2.8.0
Requires-Dist: ray>=2.0.0
Requires-Dist: vllm>=0.2.0
Requires-Dist: requests>=2.28.0
Requires-Dist: tqdm>=4.64.0
Requires-Dist: openai>=0.27.0
Requires-Dist: python-dotenv>=0.19.0
Requires-Dist: rank-bm25>=0.2.2
Requires-Dist: torchmetrics>=0.9.0
Requires-Dist: gitpython>=3.1.0
Requires-Dist: pexpect>=4.8.0
Requires-Dist: toml>=0.10.0
Requires-Dist: PyGithub>=1.58.0
Requires-Dist: lxml>=4.9.0
Requires-Dist: filelock>=3.8.0
Requires-Dist: psutil>=5.9.0
Requires-Dist: datasets>=4.0.0
Requires-Dist: trl>=0.20.0
Requires-Dist: peft>=0.17.0
Provides-Extra: dev
Requires-Dist: pytest>=8.4.0; extra == "dev"
Requires-Dist: pytest-cov>=6.2.1; extra == "dev"
Requires-Dist: black>=22.0.0; extra == "dev"
Requires-Dist: isort>=5.10.0; extra == "dev"
Requires-Dist: flake8>=5.0.0; extra == "dev"
Requires-Dist: mypy>=0.991; extra == "dev"
Dynamic: license-file

# LeanLibrary
To install LeanLibrary, run
``` sh
uv pip install lean-library
```
install Pantograph
``` sh
uv add git+https://github.com/stanford-centaur/PyPantograph
```
make sure you've installed CUDA-compiled torch,
``` sh
uv pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126
```
export your Github access token,
``` sh
export GITHUB_ACCESS_TOKEN=<GITHUB_ACCESS_TOKEN>
```
## Example
``` python
from leanlibrary.agent.hf_agent import HFAgent
from leanlibrary.trainer.sft_trainer import SFTTrainer

url = "https://github.com/durant42040/lean4-example"
commit = "005de00d03f1aaa32cb2923d5e3cbaf0b954a192"

trainer = SFTTrainer(
    model_name="deepseek-ai/DeepSeek-Prover-V2-7B",
    output_dir="outputs-deepseek",
    epochs_per_repo=1,
    batch_size=2,
    lr=2e-5,
)

agent = HFAgent(trainer=trainer)
agent.setup_github_repository(url=url, commit=commit)
agent.train()
agent.prove()

```
