Back to all projects

Project #6

Prompt-Based CAD Editor

Client An AI agents company for industrial CAD workflows Year 2025

An AI company building agents for industrial CAD workflows needed a system that edits CAD models using text commands — "change the radius of the upper hole to 3mm" or "add 2 holes to the upper surface." We built a fully on-premise LLM-powered backend that reads .stp files, interprets text commands, and applies programmatic edits.

The Challenge

The client's AI agents need a backend system that receives a .stp (STEP) CAD file and a text editing command, and outputs a modified .stp file with the requested changes applied. The system must run entirely on-premise — no cloud API dependency — because their industrial customers require data sovereignty. The challenge is bridging natural language understanding with precise geometric operations on complex CAD data.

What We Built

A fully on-premise LLM-powered CAD editing backend with three modules:

1. CAD model parser — loads .stp files and extracts all relevant geometric and topological information into structured JSON, using CadQuery and PythonOCC.

2. LLM module — an on-premise model (Mistral-7B, Phi-2, or Llama variant) interprets the structured CAD data and the user's text command, and outputs structured edit operations.

3. CAD modifier module — translates the LLM output into programmatic editing operations applied directly to the .stp file.

Supported operations include: modifying existing features ("change the radius"), global scaling ("scale the entire part down by 10%"), adding new features ("add 2 holes to the upper surface"), and removing features ("remove the hole from the bottom surface").

  • Natural language commands applied to STEP CAD files programmatically
  • Fully on-premise — no cloud API, no internet required
  • Supports modify, scale, add, and remove operations
  • On-premise LLM (Mistral-7B / Phi-2 / Llama variants)
  • CAD parsing via CadQuery and PythonOCC
  • Optional RAG system for handling large CAD files exceeding context window
The Result

The system demonstrates text-to-CAD editing on .stp files with full data sovereignty. It runs on-premise with GPU acceleration. The architecture supports extension to additional CAD operations and model types.