MA

Case study · AI engineering · Text-to-CAD

NL-CAD

Plain English to CAD models: 46/46 eval cases pass at about $0.01 each.

Describe a mechanical part in plain English and get a parametric CAD model back: STEP and STL files, the CadQuery script, and the plan it compiled from.

Type
Open-source AI engineering project
Built by
Maarij Aqeel
NL-CAD preview

The challenge

LLMs that write CAD code directly fail in two ways: scripts that crash, and scripts that run fine but build the wrong part.

What I built

  • The LLM writes a validated, typed plan (an OpGraph IR) instead of code. A deterministic compiler turns it into CadQuery, so syntax errors are structurally impossible.
  • Geometric validators check bounding boxes and volumes to catch parts that run cleanly but are wrong.
  • Vague requests get clarifying questions instead of guesses.
  • A pool of warm CadQuery workers, so dimension sliders rebuild instantly with no model call.
  • Edits like "make the holes 8 mm" go through a cheaper model as a one-key patch.

Results

  • 46/46eval cases pass, at about $0.011 each
  • ~48 msper build on a warm worker (vs ~2.6 s cold)
  • Real CAD output: STEP files open in FreeCAD

Tools

  • Python
  • CadQuery
  • FastAPI
  • OpenRouter

Want something similar? See ai product builds →

More case studies

Maarij Aqeel