Instructions to use haielab/STP_model_Lean_0320-conjecture-base-FineTune-new-config with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use haielab/STP_model_Lean_0320-conjecture-base-FineTune-new-config with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="haielab/STP_model_Lean_0320-conjecture-base-FineTune-new-config") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("haielab/STP_model_Lean_0320-conjecture-base-FineTune-new-config", dtype="auto") - PEFT
How to use haielab/STP_model_Lean_0320-conjecture-base-FineTune-new-config with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use haielab/STP_model_Lean_0320-conjecture-base-FineTune-new-config with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "haielab/STP_model_Lean_0320-conjecture-base-FineTune-new-config" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "haielab/STP_model_Lean_0320-conjecture-base-FineTune-new-config", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/haielab/STP_model_Lean_0320-conjecture-base-FineTune-new-config
- SGLang
How to use haielab/STP_model_Lean_0320-conjecture-base-FineTune-new-config with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "haielab/STP_model_Lean_0320-conjecture-base-FineTune-new-config" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "haielab/STP_model_Lean_0320-conjecture-base-FineTune-new-config", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "haielab/STP_model_Lean_0320-conjecture-base-FineTune-new-config" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "haielab/STP_model_Lean_0320-conjecture-base-FineTune-new-config", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use haielab/STP_model_Lean_0320-conjecture-base-FineTune-new-config with Docker Model Runner:
docker model run hf.co/haielab/STP_model_Lean_0320-conjecture-base-FineTune-new-config
STP-Lean-7B LoRA (v1)
LoRA rank-16 adapter fine-tuned from kfdong/STP_model_Lean_0320 to assist with Lean theorem proving.
Model Details
| Field | Value |
|---|---|
| Developed by | HAIE Lab |
| Model type | 7 B-parameter causal-LM + LoRA r 16 α 32 |
| Languages | Lean syntax & English commentary |
| Finetuned from | kfdong/STP_model_Lean_0320 |
| Precision | BF16 · Flash-Attention v2 |
| Context length | 1792 tokens |
| Hardware | 1 × H100 80 GB |
Training Hyperparameters
| Setting | Value |
|---|---|
| Precision / regime | bf16 mixed precision |
| Epochs | 1 |
| Max sequence length | 1 792 tokens (right-padding) |
| Per-device train batch size | 6 |
| Per-device eval batch size | 2 |
| Gradient accumulation steps | 1 (effective batch = 6) |
| Optimizer | AdamW |
| Learning rate schedule | 2 × 10⁻⁴ cosine, warm-up 3 % |
| Weight decay | 0.01 |
| LoRA rank / α / dropout | r = 16, α = 32 (2 × r), dropout = 0.05 |
| Gradient checkpointing | Enabled (memory-efficient) |
| Flash-Attention v2 | Enabled |
| Logging | every 50 steps |
| Evaluation strategy | once per epoch |
| Save strategy | once per epoch |
| Seed | 42 |
| Hardware | 1 × H100 80 GB |
Results (1 epoch)
| Metric | Value |
|---|---|
| Final train loss | 1.1593 |
| Final train accuracy | 0.713 token-level |
| First-step loss (warm-up) | 1.6084 |
| Tokens processed | 168 856 138 |
| Grad-norm (final) | 0.265 |
Uses
Direct Use
Interactive Lean-proof suggestions, theorem exploration, education.
Downstream Use
Research on automated theorem proving.
Out-of-Scope
Open-domain advice, legal/medical claims, guaranteed proof correctness.
Bias, Risks & Limitations
Model may hallucinate or output invalid Lean code; inherits errors in the STP dataset.
How to Get Started
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = "haielab/STP_model_Lean_0320-conjecture-base-FineTune-new-config"
# 1️⃣ Tokenizer ─ leave default right padding for STP
tok = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
tok.pad_token = tok.eos_token # STP uses </s> as PAD
# 2️⃣ Load base-plus-LoRA adapter on GPU (BF16)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype="bfloat16",
device_map="auto" # auto-dispatch to available GPU(s)
)
# 3️⃣ Build a Lean-style prompt
prompt = "<user>Theorem foo …</user><assistant>"
inputs = tok(prompt, return_tensors="pt").to(model.device)
# 4️⃣ Generate the next proof steps
out = model.generate(
**inputs,
max_new_tokens=256,
temperature=0.7,
top_p=0.9,
)
print(tok.decode(out[0], skip_special_tokens=True))
Model tree for haielab/STP_model_Lean_0320-conjecture-base-FineTune-new-config
Base model
deepseek-ai/DeepSeek-Prover-V1.5-Base