Run this model with HF Jobs
Run jgalego/hilbert-prover-8b on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/jgalego/hilbert-prover-8b. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/jgalego/hilbert-prover-8b on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/jgalego/hilbert-prover-8b. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/jgalego/hilbert-prover-8b. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use jgalego/hilbert-prover-8b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jgalego/hilbert-prover-8b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="jgalego/hilbert-prover-8b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("jgalego/hilbert-prover-8b") model = AutoModelForCausalLM.from_pretrained("jgalego/hilbert-prover-8b", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use jgalego/hilbert-prover-8b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jgalego/hilbert-prover-8b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jgalego/hilbert-prover-8b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/jgalego/hilbert-prover-8b
- SGLang
How to use jgalego/hilbert-prover-8b 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 "jgalego/hilbert-prover-8b" \ --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": "jgalego/hilbert-prover-8b", "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 "jgalego/hilbert-prover-8b" \ --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": "jgalego/hilbert-prover-8b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use jgalego/hilbert-prover-8b with Docker Model Runner:
docker model run hf.co/jgalego/hilbert-prover-8b
hilbert-prover-8b

A Lean 4 prover for theorems in Physlib and CSLib, fine-tuned from Goedel-LM/Goedel-Prover-V2-8B. The base model was trained on competition maths with Lean 4.9; this one was trained on the proofs in Physlib and CSLib, which build with Lean 4.34 and later.
It is weaker than the base model on miniF2F (0.307 against 0.449) and VERINA (0.048 against 0.115), so use Goedel-Prover-V2-8B for competition maths and verified code.
🚀 Usage
The prompt is the one Goedel-Prover-V2-8B was trained on: a Lean file ending in a theorem whose proof is sorry.
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "jgalego/hilbert-prover-8b"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, dtype="auto", device_map="auto")
code = """import Mathlib
theorem two_mul_le (n : ℕ) : n ≤ 2 * n := by
sorry
"""
prompt = "Complete the following Lean 4 code:\n\n```lean4\n{}```\n\nBefore producing the Lean 4 code to formally prove the given theorem, provide a detailed proof plan outlining the main proof steps and strategies.\nThe plan should highlight key ideas, intermediate lemmas, and proof structures that will guide the construction of the final formal proof."
messages = [{"role": "user", "content": prompt.format(code)}]
inputs = tokenizer.apply_chat_template(
messages, add_generation_prompt=True, return_tensors="pt", return_dict=True
).to(model.device)
out = model.generate(**inputs, max_new_tokens=32768, do_sample=True, temperature=0.6, top_p=0.95)
print(tokenizer.decode(out[0, inputs["input_ids"].shape[1] :], skip_special_tokens=True))
The answer ends in a lean4 block with the full proof. Check it with Lean before trusting it.
🏋️ Training
LoRA (r=16, alpha=32, all linear layers), merged into the base weights, on the 10,371 training theorems of jgalego/hilbert-libraries: 2 epochs at learning rate 0.0001, 4.6 h on an NVIDIA RTX PRO 6000 Blackwell Server Edition. The completions carry no proof plan, so the model learns to answer with an empty <think> block and go straight to the proof.
📊 Results
A proof counts only if the file compiles and #print axioms shows nothing beyond propext, Classical.choice and Quot.sound. Four samples per theorem at temperature 0.6.
Theorems from the modules held out of the training data:
| Model | Library | Theorems | pass@1 | pass@4 |
|---|---|---|---|---|
| Goedel-LM/Goedel-Prover-V2-8B | cslib | 283 | 0.101 | 0.205 |
| Goedel-LM/Goedel-Prover-V2-8B | physlib | 972 | 0.106 | 0.195 |
| jgalego/hilbert-prover-8b@sft-a | cslib | 283 | 0.306 | 0.399 |
| jgalego/hilbert-prover-8b@sft-a | physlib | 972 | 0.237 | 0.311 |
Theorems added to Physlib after training. They come from 511abd5 (2026-12-01) and share no name or statement with anything at the training commit, d630c36 (2026-10-02). They are checked on Lean v4.36.0, and the library's own proof of each compiles. Up to 8,192 new tokens; a response cut off at the limit scores nothing. Plain automation is one fixed answer for every theorem, first | rfl | simp | grind | aesop | simp_all | norm_num | omega | linarith | positivity, which closes 194 of 1,251. The last column is pass@1 on the 1,057 it leaves open.
| Model | pass@1 | pass@4 | Difference to base | pass@1 where automation fails | Cut off |
|---|---|---|---|---|---|
| Goedel-LM/Goedel-Prover-V2-8B | 0.117 | 0.230 | n/a | 0.075 | 33% |
| jgalego/hilbert-prover-8b@sft-a | 0.310 | 0.362 | +0.193 ± 0.011 | 0.216 | 1% |
| Plain automation, no model | 0.155 | n/a | +0.038 ± 0.010 | 0.000 | 0% |
The difference is the mean over theorems of the pass-rate gap to the base model, with its standard error.
⚠️ Limitations
- It answers without reasoning and does best on short proofs; the gain over the base model shrinks as proofs get longer.
- Trained on fixed library commits. On the newer Physlib theorems, 34% of its failed samples cite an unknown name, against 32% for the base model.
- Scored on single theorems, not whole projects.
Logo: a portrait of David Hilbert from before 1912 (public domain, photographer unknown, retouched postcard on Wikimedia Commons), redrawn as a grid of dots and recoloured.
- Downloads last month
- 268