Instructions to use kulibinai/cadena with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kulibinai/cadena with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "image-to-text" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("image-to-text", model="kulibinai/cadena")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("kulibinai/cadena", device_map="auto") - Notebooks
- Google Colab
- Kaggle
| license: mit | |
| library_name: transformers | |
| pipeline_tag: image-to-text | |
| base_model: Qwen/Qwen2-VL-2B-Instruct | |
| tags: | |
| - arxiv:2608.00799 | |
| - cad | |
| - reverse-engineering | |
| - cadquery | |
| - vision-language | |
| # CADENA | |
| CADENA reconstructs a 3D mesh as a parametric CAD program. Instead of emitting | |
| the whole program in one pass, it grows the operation sequence one step at a | |
| time, executing the partial program and comparing the target with the currently | |
| built geometry before choosing the next operation. | |
| - Paper: [arXiv:2608.00799](https://arxiv.org/abs/2608.00799) | |
| - Code: <https://github.com/zhemdi/cadena> | |
| - Benchmark: <https://huggingface.co/datasets/kulibinai/cadena-bench> | |
| ## Checkpoints | |
| This repository holds both training stages as subfolders. | |
| | Subfolder | Stage | | |
| | --- | --- | | |
| | `sft` | Supervised, final checkpoint of the second stage | | |
| | `rl` | Reinforcement learning against executed geometry — the paper's CADENA-RL | | |
| ```python | |
| from transformers import AutoModelForVision2Seq, AutoProcessor | |
| model = AutoModelForVision2Seq.from_pretrained("kulibinai/cadena", subfolder="rl") | |
| processor = AutoProcessor.from_pretrained("Qwen/Qwen2-VL-2B-Instruct") | |
| ``` | |
| Or fetch one stage only: | |
| ```bash | |
| hf download kulibinai/cadena --include 'rl/*' --local-dir ./ckpt | |
| ``` | |
| Both are Qwen2-VL-2B policies, 4.4 GB each in bfloat16. | |
| ## Input | |
| The model observes eight renders of the target tiled into a single image: six | |
| axis-aligned views and two isometric ones. The target occupies the green | |
| channel and the geometry built so far the red channel, so the residual — what | |
| is still missing — is what the policy actually reads. | |
| ## Results | |
| CADENA-RL outperforms prior methods on DeepCAD, Fusion 360, MCB and | |
| CADENA-Bench. The margin grows with geometric complexity: it is modest on | |
| sketch–extrude corpora and substantially larger on real mechanical parts. | |
| Reinforcement learning against executed geometry improves reconstruction | |
| accuracy while lowering the invalid rate, since an operation that fails to | |
| build receives no reward. | |
| See the paper for the full tables. | |
| ## Usage | |
| Inference is stepwise and needs the DSL runtime, so use the repository rather | |
| than a bare `generate` call: | |
| ```bash | |
| git clone https://github.com/zhemdi/cadena && cd cadena | |
| pip install -r requirements.txt | |
| MODEL_PATH=./ckpt/rl DATASET_PATH=data/stepwise_hf/wrapped/meshes ./inference/run.sh | |
| ``` | |
| Defaults reproduce the paper's main-results setting: greedy decoding, an | |
| operation budget of 20, `E = 12` candidates per operation, and the returned | |
| program is the prefix with the highest IoU against the target. | |
| ## Limitations | |
| - Programs are CadQuery, so CADENA inherits its limitations; in corner cases a | |
| construction tree valid in CadQuery does not transfer to industrial CAD. | |
| - Accuracy is uneven across part families — revolved and patterned geometry | |
| (gears, bearings, springs, fasteners) remains the hardest. | |
| ## License | |
| MIT. | |