IterCAD provides supervised fine-tuning (SFT), reinforcement learning, and agentic evaluation for CadQuery code generation and editing.
- Dataset: KnowledgeXLab/IterCAD_Data
- Model: KnowledgeXLab/IterCAD-RL
Use two isolated Conda environments:
itercad: SFT and RL trainingcadquery: evaluation and the CAD reward server
See docs/INSTALL.md for installation and verification.
Run all commands below from the repository root.
SFT (activate the training environment first):
conda activate itercad
# Set MODEL_PATH and other machine-specific options in the script first.
bash train/IterCAD_SFT.shRL uses the training environment plus a reward server running in the CadQuery environment. Start the server in a second terminal:
conda activate cadquery
bash train/IterCAD_Reward_Server.shThen start RL training:
conda activate itercad
export CAD_REWARD_API_URL=http://127.0.0.1:8765
# MODEL_PATH, NPROC_PER_NODE, and OUTPUT_DIR may be overridden as needed.
bash train/IterCAD_RL.shStart an OpenAI-compatible model server, then run:
conda activate cadquery
export GENERATOR_API=http://127.0.0.1:8000/v1
export OPENAI_API_KEY=EMPTY
export GEN_MODEL=YOUR_MODEL_NAME
python eval/evalution.py --task_type IterCAD-Draw --run_id draw_eval
python eval/evalution.py --task_type IterCAD-Edit --run_id edit_evalEvaluation results are written under results_<model>_unified/ by default.
See eval/README.md for benchmark paths, metrics, resume, and
advanced arguments.
IterCAD is released under the Apache License 2.0. The bundled
ms-swift source retains its own license and attribution notices.