Instructions to use Lego-X/LegoReview-35B-A3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Lego-X/LegoReview-35B-A3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Lego-X/LegoReview-35B-A3B") 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("Lego-X/LegoReview-35B-A3B") model = AutoModelForMultimodalLM.from_pretrained("Lego-X/LegoReview-35B-A3B", 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 Lego-X/LegoReview-35B-A3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Lego-X/LegoReview-35B-A3B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Lego-X/LegoReview-35B-A3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Lego-X/LegoReview-35B-A3B
- SGLang
How to use Lego-X/LegoReview-35B-A3B 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 "Lego-X/LegoReview-35B-A3B" \ --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": "Lego-X/LegoReview-35B-A3B", "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 "Lego-X/LegoReview-35B-A3B" \ --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": "Lego-X/LegoReview-35B-A3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Lego-X/LegoReview-35B-A3B with Docker Model Runner:
docker model run hf.co/Lego-X/LegoReview-35B-A3B
LegoReview-35B-A3B is a repository-level reviewer fine-tuned from Qwen3.5-35B-A3B-Base on verified code-review trajectories. Trained with finding-level verification from PR histories, it uses repository tools to produce prioritized findings and a structured review decision.
Project overview; coding gains come from the paper’s joint-training experiments.
Highlights
- Verification at the finding level. PR histories support checking the individual defects a reviewer reports, enabling selection of informative training trajectories.
- Review data at scale. LegoReview constructs 168k tasks across 12,891 repositories and eight languages, with 60k verified trajectories for reviewer training.
- Stronger reviews through verified training. LegoReview-35B-A3B reaches 56.1 F1 on LegoReview-Bench, up from 5.7 for the base model, with 90.9% Clean Rate. Scaling verified data from 1k to 60k trajectories raises F1 from 43.1 to 56.1.
Resources
| Resource | What you can do with it |
|---|---|
| Code | Construct tasks, generate and verify trajectories, and evaluate reviewers |
| LegoReview-Task | Generate new reviews on 167,960 tasks with PR context and reference findings |
| LegoReview-Traj | Train on 59,338 verified trajectories or study the full 154,412 teacher rollouts |
| LegoReview-Bench | Evaluate on 75 tasks, including 11 clean tasks, with 430 reference findings |
Run the reviewer
Download the full checkpoint, tokenizer, and chat template:
from huggingface_hub import snapshot_download
model_path = snapshot_download("Lego-X/LegoReview-35B-A3B")
Serve the model with a runtime supporting Qwen3_5MoeForConditionalGeneration, using the supplied tokenizer and chat template. Run reviews with the OpenHands scaffold and repository tools. The installation guide and local model evaluation guide provide the commands for serving, task preparation, agent execution, and scoring.
Evaluation
| Benchmark | Precision | Recall | F1 | Clean Rate |
|---|---|---|---|---|
| LegoReview-Bench | 62.5 | 50.9 | 56.1 | 90.9 |
| Martian Code Review Bench | 37.2 | 51.1 | 43.1 | — |
Scores (%) pool three runs per task with the same OpenHands prompt and tools. Clean Rate is the share of clean-task runs with a valid report and no high-priority finding. See the evaluation protocol for the full settings and scoring procedure.
Training
| Setting | Value |
|---|---|
| Base model | Qwen3.5-35B-A3B-Base |
| Method | Full-parameter supervised fine-tuning |
| Released training split | 59,338 trajectories (45,775 defect and 13,563 clean) |
| Epochs / context | 3 / 196,608 tokens |
| Global batch size | 64 |
| Learning rate | 5e-5, cosine decay, 0.1 warmup ratio |
| Precision | bfloat16 |
The data guide lists the datasets and download revisions.
Acknowledgements
Built with SWE-Review, OpenHands, Harbor, LegoFlow, and Martian Code Review Benchmark.
License
Citation
If you use our code, data, or model, please cite the two papers below.
@misc{wang2026legoreviewscalingcodereview,
title={LegoReview: Scaling Code Review Data with Verification from Pull Request Histories},
author={Ruoyu Wang and Jierun Chen and Yuxin Jiang and Chaofan Tao and Shaowei Wang and Sidi Yang and Conghao Xiong and Yiming Du and Tiezheng Yu and Kim-Hui Yap and Lifeng Shang and Xiao-Hui Li and Haoli Bai},
year={2026},
eprint={2612.00862},
archivePrefix={arXiv},
primaryClass={cs.SE},
url={https://arxiv.org/abs/2612.00862},
}
@misc{wang2026swereview,
title = {SWE-Review: Closing the Loop on Issue Resolution with Agentic Code Review},
author = {Ruoyu Wang and Jierun Chen and Shaowei Wang and Chaofan Tao and Sidi Yang and Yuxin Jiang and Kim-Hui Yap and Lifeng Shang and Xiaohui Li and Haoli Bai},
year = {2026},
url = {https://github.com/LegoX/SWE-Review}
}
- Downloads last month
- 71
Model tree for Lego-X/LegoReview-35B-A3B
Base model
Qwen/Qwen3.5-35B-A3B-Base