Skip to main content
Glama
README.md
<h1 align="center">CAD Harness</h1>

<p align="center">
  <strong>Turn engineering drawings into STEP solids. Check the geometry against the drawing.</strong>
</p>

<p align="center">
  <a href="#try-it-with-your-agent">Try it with your agent</a> ·
  <a href="#quick-start">Quick start</a> ·
  <a href="#cadgenbench-results">CADGenBench results</a> ·
  <a href="docs/HARNESS_V11.md">Architecture</a> ·
  <a href="LICENSE">MIT license</a>
</p>

![Three CADGenBench V11.4 outputs: a flanged body, an impeller, and an edited mounting housing](assets/cadgenbench-gallery.png)

| 132 drawing | 147 drawing | 205 starting model |
| :---: | :---: | :---: |
| <a href="https://huggingface.co/datasets/HuggingAI4Engineering/cadgenbench-data/blob/f76f965585817c621d6ea0d150d745adf670e66e/132/input.png"><img src="https://huggingface.co/datasets/HuggingAI4Engineering/cadgenbench-data/resolve/f76f965585817c621d6ea0d150d745adf670e66e/132/input.png" width="260" alt="Engineering drawing for the flanged body"></a> | <a href="https://huggingface.co/datasets/HuggingAI4Engineering/cadgenbench-data/blob/f76f965585817c621d6ea0d150d745adf670e66e/147/input.png"><img src="https://huggingface.co/datasets/HuggingAI4Engineering/cadgenbench-data/resolve/f76f965585817c621d6ea0d150d745adf670e66e/147/input.png" width="260" alt="Engineering drawing for the impeller"></a> | <a href="https://huggingface.co/datasets/HuggingAI4Engineering/cadgenbench-data/blob/f76f965585817c621d6ea0d150d745adf670e66e/205/renders/iso.png"><img src="https://huggingface.co/datasets/HuggingAI4Engineering/cadgenbench-data/resolve/f76f965585817c621d6ea0d150d745adf670e66e/205/renders/iso.png" width="260" alt="Isometric view of the mounting housing before the edit"></a> |

<sub>Above are selected V11.4 STEP outputs and their original CADGenBench inputs. <a href="https://huggingface.co/datasets/HuggingAI4Engineering/cadgenbench-data/tree/f76f965585817c621d6ea0d150d745adf670e66e/205">View the task 205 edit instructions.</a></sub>

CAD Harness gives OpenAI and Anthropic models MCP tools to read drawings, build or edit solids, and check the saved STEP geometry against the task requirements.

## CADGenBench results

![CADGenBench V11.4 results: 0.8315 overall, 0.8633 generation, 0.7828 editing, and 81 CAD-valid outputs](assets/cadgenbench-results.png)

**V11.4 scored 0.8315 overall**, with CAD-valid outputs for all 81 tasks. The leaderboard lists the historical submission as **unvalidated**. [Leaderboard](https://huggingface.co/spaces/HuggingAI4Engineering/CADGenBench) · [Run details](docs/BENCHMARKS.md)

## Try it with your agent

Use the copy button on this prompt, then paste it into your coding agent.

```text
Clone https://github.com/Nik-Horner/cad-harness and follow its README quick start.
Run the included drawing dry run without an API key. Tell me what worked and
where to find the output. Ask me before making any paid model calls.
```

## Quick start

Use Git, [uv](https://docs.astral.sh/uv/), and Python 3.12 on macOS or Linux. The dry run starts the local harness, discovers its tools, and probes drawing input. It needs neither an API key nor benchmark fixtures.

```bash
git clone https://github.com/Nik-Horner/cad-harness.git
cd cad-harness
./infra/bootstrap_v10.sh
.venv_v10/bin/python scripts/run_v11_openai.py \
  --input-png examples/bore-block.png --dry-run
```

V11 shares the pinned V10 CAD runtime. To exercise real CAD construction, rejection, and repair with scripted provider responses, run the [end-to-end tests](tests/test_v11_native_api_e2e.py).

```bash
.venv_v10/bin/python -m pytest tests/test_v11_native_api_e2e.py -q
```

[Run on your own drawings](docs/SETUP_V11.md) · [Install pinned benchmark inputs](docs/SETUP_V10.md#3-bench-fixtures-optional)

<details>
<summary><strong>See the quick-start drawing and STEP model</strong></summary>

![A dimensioned bore-block drawing beside a render of the matching STEP solid](assets/drawing-to-step.png)

[Engineering drawing](examples/bore-block.png) · [Reference STEP model](examples/bore-block.step)

</details>

## How it works

1. **Read the source.** Inspect the drawing, record dimensions and features, and link them to planned checks.
2. **Build or edit a solid.** The model calls CAD tools in a supervised worker. The same workflow drives the OpenAI and Anthropic adapters.
3. **Check the saved file.** The harness reimports the STEP and measures the features and sections against the recorded requirements. Missing or contradicted evidence keeps the task open.
4. **Repair and recheck.** The driver reports the unresolved check and retains the last saved candidate so work can continue from it.

Start with the [V11 harness guide](docs/HARNESS_V11.md) or the [contributor guide](CONTRIBUTING.md).

## License

Project code is [MIT licensed](LICENSE). Third-party prompts and dependencies keep their [original notices](third_party/README.md).

Built by [Nik Horner](https://github.com/Nik-Horner).