Downloads · 30 days
62
15% of all-time downloads
yuvit-batra/qwen2.5-coder-7b-cadquery-mlx-4bit
qwen2.5-coder-7b-cadquery-mlx-4bit is a text generation model from yuvit-batra. Use it when you need the model to write or continue text. It is set up for mlx. The card lists the license as cc-by-nc-sa-4.0.
A fine-tune of Qwen2.5-Coder-7B-Instruct that turns natural-language part descriptions into executable CadQuery (Python) scripts producing valid, dimensionally-correct B-rep solids exportable to STEP/STL.
Downloads · 30 days
62
15% of all-time downloads
All-time downloads
416
Public
Parameters
7.6B
4.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors4.3 GB · 100%
How the weights are stored.
U327.6B · 100%
From the Hugging Face model README
A fine-tune of Qwen2.5-Coder-7B-Instruct that turns natural-language part descriptions into executable CadQuery (Python) scripts producing valid, dimensionally-correct B-rep solids exportable to STEP/STL.
Trained with LoRA (rank 16, 16 layers) via mlx-lm on an Apple M4 Max; this
repo contains the fused 4-bit MLX weights. A GGUF build for
llama.cpp/Ollama is published alongside this repo.
Use this exact system prompt (the model was trained with it):
You are a CAD design assistant. Given a description of a mechanical part, respond with a complete CadQuery (Python) script that builds it. Use millimeters. The script must import cadquery as cq and assign the final single-solid model to a variable named
result. Respond with only the code.
Set the stop token to <|im_end|>.
mlx_lm.generate --model yuvit-batra/qwen2.5-coder-7b-cadquery-mlx-4bit \
--prompt "Design a 60mm diameter flange, 10mm thick, with a 20mm bore and six 6mm bolt holes on a 44mm circle." \
--max-tokens 1024 --temp 0.2
12,477 validated text→CadQuery pairs (dataset v1.2):
Generated code is executed; solids are checked for validity and dimensional accuracy vs reference geometry (sorted-bbox within 10%/axis, volume within 15%).
| Metric (n=25 test / n=33 novel) | Base Qwen2.5-Coder-7B | This model |
|---|---|---|
| Test: executes | 28% | 80% |
| Test: valid single solid | 24% | 80% |
| Test: bbox accuracy | 33% | 45% |
| Novel prompts: executes | 64% | 73% |
| Novel prompts: valid solid | 48% | 67% |
The novel-prompt set includes chess pieces, phone docks, organizers, and other consumer parts phrased unlike the training templates.