Run this model with HF Jobs
Run davinci-prover/davinci-prover-9B-midtrain-SFT 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/davinci-prover/davinci-prover-9B-midtrain-SFT. 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/davinci-prover/davinci-prover-9B-midtrain-SFT 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/davinci-prover/davinci-prover-9B-midtrain-SFT. 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/davinci-prover/davinci-prover-9B-midtrain-SFT. 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 davinci-prover/davinci-prover-9B-midtrain-SFT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use davinci-prover/davinci-prover-9B-midtrain-SFT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="davinci-prover/davinci-prover-9B-midtrain-SFT") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("davinci-prover/davinci-prover-9B-midtrain-SFT") model = AutoModelForMultimodalLM.from_pretrained("davinci-prover/davinci-prover-9B-midtrain-SFT", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use davinci-prover/davinci-prover-9B-midtrain-SFT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "davinci-prover/davinci-prover-9B-midtrain-SFT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "davinci-prover/davinci-prover-9B-midtrain-SFT", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/davinci-prover/davinci-prover-9B-midtrain-SFT
- SGLang
How to use davinci-prover/davinci-prover-9B-midtrain-SFT 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 "davinci-prover/davinci-prover-9B-midtrain-SFT" \ --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": "davinci-prover/davinci-prover-9B-midtrain-SFT", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "davinci-prover/davinci-prover-9B-midtrain-SFT" \ --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": "davinci-prover/davinci-prover-9B-midtrain-SFT", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use davinci-prover/davinci-prover-9B-midtrain-SFT with Docker Model Runner:
docker model run hf.co/davinci-prover/davinci-prover-9B-midtrain-SFT
DaVinci-Prover-9B-Midtrain-SFT
DaVinci-Prover-9B-Midtrain-SFT is a 9B model for proving theorems in Lean 4. It is trained to work through a proof over multiple turns, call tools, and revise a Lean submission using feedback. The starting checkpoint was obtained by continuing pretraining from Qwen3.5-9B-Base with 32K-token sequences. Mid-training checkpoint
Supervised fine-tuning
The SFT dataset contains 35,291 successful proof trajectories generated by DeepSeek V4.1 Flash in Lean 4.35.0. Each trajectory records the theorem, the assistant’s reasoning and tool calls, the feedback it received, and its verified Lean submission. The training objective applied loss to the assistant’s tokens, with the theorem and tool responses provided as context. Agentic Prover SFT dataset
We used 34,955 trajectories for training and held out 336 for validation. The released weights are from the end of epoch 7 (optimizer step 1,918), with a global batch size of 128 and a peak learning rate of 3 × 10⁻⁵.
Theorem-proving results
The table reports pass@1 for one sampled proof trajectory per scored theorem. The agent used temperature 1.0 and top-p 1.0, with up to 200 turns and 200 tool calls per theorem. A proof counted as solved when the verifier accepted the submitted Lean code. DaVinci-Prover evaluation harness
| Benchmark | Solved / scored | Pass@1 |
|---|---|---|
| miniF2F test | 230 / 243 | 94.65% |
| FATE-H | 28 / 100 | 28.00% |
| FATE-X | 5 / 100 | 5.00% |
| Putnam200 (199 of 200 scored) | 36 / 199 | 18.09% |
For comparison, we also fine-tuned Qwen3.5-9B-Base directly on the same trajectories for seven epochs. On FATE-H, the mid-trained model solved 28 theorems and the direct-SFT model solved 20. On the 242 miniF2F theorems scored for both models, the mid-trained model solved 230 and the direct-SFT model solved 228.
- Downloads last month
- 38
Model tree for davinci-prover/davinci-prover-9B-midtrain-SFT
Base model
Qwen/Qwen3.5-9B-Base