Skip to content

Back to the catalog

Show HN: Made an open-source Lego AI generator
github.comrepo

Show HN: Made an open-source Lego AI generator

ldraw-nova is an open-source agentic pipeline where an LLM agent (tested with models like Claude Opus 5.5 and GPT-6 Astra) takes a build prompt, reads LDraw-building instructions, and produces a plan.json describing a model's geometry. From that plan it writes a Python generator script that, when executed, outputs an LDraw (.mpd) 3D CAD source file, viewable in 3D/VR (Meta Quest 3) or exportable to Blender-editable glTF. The agent uses jev-rerank, a semantic search tool with reranking backed by TypeSafe's Jev System One model, to find suitable LEGO parts and example models, falling back to full-text search without an API key; it also uses headless rendering and collision/gap detection to self-inspect and iterate on designs.

TL;DR An agent plans and codes Python generators that emit LDraw LEGO models, using semantic-search reranking to find parts and iterative render-based self-inspection.
Document

What it claims

ldraw-nova gives an LLM agent the tooling, examples and instructions to design LEGO models from real LDraw parts. It ships as a dockerized web app. Each finished build produces:

  • LDraw source
  • a 3D viewer, a 3D player and VR on Meta Quest 3
  • rendered images
  • a Blender-editable .glb file, with metadata stored as Blender Custom Properties
  • the full chat history and the agent's thinking

How it works

The design comes from three earlier attempts by the same author: ldbuilder-ai, py2bricks and py4bricks. The author drew two conclusions from them:

  • Agents should not do geometry math directly. They do better writing Python that computes rotations and positions than emitting that math themselves.
  • Agents learn better from generator code than from finished models.

So the agent does not place parts directly, except when prototyping or modifying an existing example. Instead it:

  1. Gathers information from experiments, the docs and its own planning.
  2. Writes one or more plan.json files describing each model and submodel, including geometry.
  3. Writes generate.py, which outputs the .mpd file.
flowchart TD
    P[prompt + instructions.md] --> S{TYPESAFE_API_KEY set?}
    S -- yes --> R[jev-rerank semantic search]
    S -- no --> F[full-text search fallback]
    R --> PL[plan.json]
    F --> PL
    PL --> G[generate.py] --> M[model.mpd]
    M --> V[headless render + collision/gap check]
    V -- adjust --> PL
    V -- done --> D[deliver]

The author also wrote jev-rerank, the parts search tool. Without the key, the page says the fallback "could (maybe) yield worse models".

How to use it

You need Git and Docker. Clone both repos side by side at the same tag. The image build takes a while and needs about 5 GB of disk.

git clone --branch v0.6.0 https://github.com/anteloc/ldraw-nova.git
git clone --branch v0.6.0 https://github.com/anteloc/ldraw-nova-docker.git
cd ldraw-nova-docker
docker compose build
docker compose up -d
  • https://localhost:8443 uses a self-signed certificate and is required for VR on Quest 3.
  • http://localhost:8765 is plain HTTP; VR does not work over it.
  • Other devices on your network can connect using your machine's IP.
  • Set TYPESAFE_API_KEY in the app's Settings section.
  • Stop the app with docker compose down.

Limits

These are the author's own limitations for this first release:

  • There is no login. Only run the app on networks you trust.
  • Only expensive, high-end models can generate large, correct models. The models named are Claude Opus 5.5 and GPT-6 Astra. Adapting it for low-end models (e.g. Haiku) is still open work.
  • Generation is slow.
  • VR on Quest 3 is rough. It has model-handling and performance issues.
  • Several model families are weak. Spaceships are "not very good", and minifigs and Technic models still need work.
  • Building from manuals only partly works. It does better when manual pages are given as images.
  • No benchmarks or success rates are published. Quality evidence is limited to the demo video and example files such as atlas-crane.mpd.
  • LEGO trademark. The LEGO Group does not sponsor, authorize or endorse the project.

Organisations named here

  • TypeSafe
  • LEGO Group
  • LDraw Community
  • Harold Martin
  • LDCad
  • ldraw.rs
  • LDView
  • LeoCAD
  • Leonardo Zide
  • Meta Quest 3
  • Park Joon-Kyu
  • pyldraw3
  • Roland Melkert
  • Travis Cobbs

Technologies named here

  • Jev System One
  • ldraw-nova
  • GPT-6 Astra
  • jev-rerank
  • ldraw-nova-docker
  • Claude Opus 5.5
  • ChatGPT
  • Docker
  • Claude
  • ldbuilder-ai
  • py2bricks
  • Luna
  • Haiku
  • py4bricks
  • Blender
  • Python

Techniques named here

  • Plan-to-generator-to-model pipeline
  • Sidestepping geometry math via code generation
  • Learning from code examples rather than model examples
  • Iterative render-inspect-adjust loop
  • Semantic re-ranked search with FTS fallback