Forge-S1
Forge-S1 is a small "System 1" model for CAD. Given a plan (a list of features with their sizes), it builds the part step by step inside FreeCAD. At every step it reads the plan and the current state of the CAD session and chooses:
- the next command,
- which plan item the command works on, and where each of its values comes from,
- whether the last step was a mistake that should be undone,
- when the part is finished.
The result is an ordinary FreeCAD model with its full feature history, not a mesh.
Model
| Parameters | 2,619,801 |
| Architecture | Transformer encoder, 6 layers, width 160, over typed rows (plan items, document objects, sketch shapes, session, solid, candidate commands) |
| Output | A score per candidate command, a pointer to a plan item, and a source for each argument |
| File | forge-s1.pt (PyTorch checkpoint: weights, vocabulary, training configuration, optimiser state) |
| Hardware | Runs on a laptop CPU; no GPU needed |
It reads no text and no object names. It does not write the plan; a plan must be given to it.
What it builds
Single parts made of one base and features on its top face.
- Bases: block, cylinder, hexagon, ring.
- Features: through hole, blind hole, counterbored hole, round boss, rectangular pad, rectangular pocket, slot, circle of holes, row of holes, mirrored pairs of holes, bosses and pockets.
- Edge treatments: rounded corners, top chamfer, top fillet, shell.
- Plans of 1 to 16 items.
Training
Trained from scratch by imitation on sessions recorded in FreeCAD by a scripted builder, with wrong steps injected so that the model also sees mistakes and their repair. About 12.4 million training steps from about 144,000 sessions, 3 passes.
Part of the training data is published as Forge-D1.
Evaluation
The model drives FreeCAD by itself on parts it has not seen; a part counts only if the finished solid equals the reference solid. These figures are from our own tests and have not been independently reviewed.
| Test set | Clean start | Start from a messy document, with wrong steps injected |
|---|---|---|
| Parts like the training parts | 300 of 300 | 295 of 300 |
| Feature combinations not in training | 300 of 300 | 297 of 300 |
| Plans of 7 to 13 items | 300 of 300 | 294 of 300 |
| Plans of 14 to 16 items (longer than any in training) | 299 of 300 | 271 of 300 |
| Freely generated parts | 300 of 300 | 300 of 300 |
| Sizes and decimals outside the training ranges | 281 of 300 | 278 of 300 |
| Feature orders not in training | 300 of 300 | 298 of 300 |
| Kinds of starting document not in training | 300 of 300 | 298 of 300 |
Each cell is 300 parts: 100 parts in each of three runs with different random seeds.
Limits
- Single parts only: no assemblies or multi-part structures.
- Features on the top face only: no side-face features, no hole through a boss, no stacked bosses, no rotated rectangles, no revolved or lofted shapes.
- It follows the plan in the given order.
- When it does make a wrong choice of its own, it often does not recover.
- Less reliable on sizes far outside the ranges it was trained on.
- It needs a list of the commands that are valid in the current session state.
Use
The checkpoint is plain data and opens with weights only:
import torch
checkpoint = torch.load("forge-s1.pt", map_location="cpu", weights_only=True)
weights = checkpoint["model"] # the network's parameters
vocabulary = checkpoint["vocab"] # the closed vocabulary of the input encoding
settings = checkpoint["config"] # model and training settings
Running the model needs the Forge-S1 code (the input encoder and the FreeCAD session driver), https://github.com/yrevash/forge, and FreeCAD 1.1. The repository's README lists every plan item and shows how to use a language model as the planner that writes the plan. With the code installed, write a plan as a list of items:
{"name": "a block with rounded corners",
"plan": [
{"kind": "block", "slots": {"length": 320.0, "width": 320.0, "height": 30.0}},
{"kind": "corner_radius", "slots": {"radius": 20.0}}
]}
and let the model build it:
uv run python -m forge.s1.third.probe --checkpoint forge-s1.pt --arguments model plan.json
This starts one FreeCAD process without a window. The model builds the part from an empty document, choosing every command and every value itself, and the result says whether the finished solid matches the plan.
Licence and credit
Apache License 2.0. You may use, change and share it, also commercially. The one condition is credit: say "Forge-S1 by Yash Tiwari (yrevash)" and link to https://github.com/yrevash/forge.