Skip to content
Projekte

Über uns

LEGO Design Agent

KI und maschinelles Lernen

So werden diese Zahlen gemessen

Gemessener Sternzuwachs

in 24h
0
in 7 days
+5
in 15 days
+5
in 1 month
+9

Nettoänderungen in überlappenden Zeiträumen, keine Tagessummen. Fehlende Messwerte bleiben leer. Sterne zeigen Interesse, nicht Qualität.

README.md

Original

Pip, the BrickBuilder building buddy

BrickBuilder

A LEGO® building agent. Tell Pip what you want to build, or give it a reference image. BrickBuilder uses an LLM to design the model, checks the build, and gives you a 3D preview, building instructions, a parts list, and downloadable LDraw files. You can ask for changes and keep building from the result.

Use in ChatGPT

Add the BrickBuilder plugin to ChatGPT to build with BrickBuilder from your chats.

Build with Pip

At brickbuilder.ai, describe a build, optionally upload an image, and press Create. Try “Build a small red lighthouse with a blue door, about 20 studs tall.” Pip can build from the full parts catalog or from your own parts inventory.

Run locally

Install Node.js 18+, Python 3.10+, and Git.

npm install
npm start

npm install downloads the official LDraw parts library to ~/ldraw if needed. To use a different library folder, set LDRAW_DIR. Open the local URL printed by the frontend server. The app saves models on your computer and runs without a BrickBuilder account by default. If Pip needs an OpenAI project key, the app prompts you to save one locally in backend/.env. You can also set OPENAI_API_KEY in that file yourself and then restart the app. Describe a model and press Create to build with Pip on GPT-6.2 Sol.

The setup prompt also accepts an optional Jev API key. Jev helps Pip find more relevant build examples. Pip uses keyword search when you skip it. Add or change either key in Settings, or set TYPESAFE_API_KEY in backend/.env for Jev. Get an OpenAI key · Get a Jev key

See the backend setup guide for local API details. For explicit Nova testing, see the Nova setup guide.

Build locally with Astrology

Astrology is an independent image-to-LDraw agent. It designs with physical parts from the Brickwith catalog, renders both sides of its model, and revises the design against the reference and its stud connections. It also accepts a text brief or an edit to a saved Astrology design.

On the website, approved accounts can choose Astrology in Generation settings → Building agent with All parts selected. The backend reads the comma-separated ASTROLOGY_ALLOWED_EMAILS setting and defaults to Nova when there is no allowlist.

Install the backend dependencies with npm run install:backend, install LeoCAD, and set OPENAI_API_KEY in your environment or backend/.env. LeoCAD can use its bundled parts library. Set LDRAW_DIR for a separate LDraw installation. On a headless Linux host, run the command under a virtual display such as xvfb-run -a.

npm run astrology -- "Build the house in this photo with fewer than 600 pieces" --image ./house.jpg --out ./house-build
npm run astrology -- "Make the door red" --edit ./house-build/design.json --out ./house-with-red-door

Each run uses a new output directory. Open model.ldr or model.mpd in BrickBuilder's importer, Studio, or LeoCAD. Both files contain construction steps. The directory also contains front and rear PNGs, a BrickBuilder parts CSV, and the editable design.json. Interrupted runs retain the last structurally checked design and the latest attempted revision in draft.json. Either can be passed to --edit. A completed run writes result.json with the piece count, visual assessment and estimated API cost for that run.

The engine supports upright bricks, plates, slopes, tiles, window frames, and other modeled details. It checks exact part/color availability, occupied space, the total piece limit and connectivity through vertical studs. Physical balance and assembly clearance still need a hands-on review.

Build with Fable

Fable is a second independent All parts agent, in backend/fable_agent. The model writes one build script against a kit that measures every part from the LDraw library. Each change to the script is checked for overlapping, unattached and unavailable parts, and the model reviews renders before it may publish. It runs on Claude or OpenAI models.

On the website, the accounts allowed to use Astrology also see the Fable options in Generation settings → Building agent with All parts selected. Both agents share the ASTROLOGY_ALLOWED_EMAILS allowlist, and other accounts never see the selector. Fable needs ANTHROPIC_API_KEY for its Claude options and OPENAI_API_KEY for its OpenAI options, plus the LeoCAD and LDraw installation Astrology already uses.

Because the model writes the build script, the API runs it as untrusted code: in a restricted dialect, in a separate process with no credentials and hard limits, and under an unprivileged account (FABLE_SANDBOX_USER, created in the API image) that cannot read the API's environment. If that account is unavailable, Fable refuses to build rather than run a script as the API's own user.

Each option is one of two methods on one model. Thorough is a single long conversation in which the model looks parts up, edits and renders as often as it likes. Lean is a few short rounds that each show only the current script, its report and pictures, which costs much less. The v2 options add helpers (18 functions such as roof(), deck(), chassis(), furniture() and tree() that place a ready-made piece of the model in one of 381 styles) and an automatic repair that cuts plain parts back where they overlap and swaps colors a part is not sold in; thorough v2 is also given part measurements up front and batches its edits, so it takes fewer turns. The v2 options are also held to stricter publication rules: solid plastic may not share space, a declared joint needs evidence, and instructions come in steps of at most five connected pieces. They can read example builds of the request's kind first, an option that is off by default. The first versions are unchanged. The Pip agent is lean v2 with a choice of model (GPT-6.2 Sol, GPT-6.2 Astra, Claude Opus 5.5, Claude Sonnet 5.5 or Claude Fable 5.2), picked in a second list under Building agent; it replaced Fable Lean v2 · GPT-6.2 Sol, and its Claude Fable 5.2 choice has not been test-run. Every change to an agent is recorded in docs/agent-changes. These are the results of one run each on the same photo of a lake house, with the one-line prompt "Build my lake house from this photo."

Building agent option Method Model AI cost Model turns Minutes Parts Parts cost
Fable · Claude Fable 5.2 thorough claude-fable-5-2 $3.65 8 12 572 $90
Fable · GPT-6.2 Sol thorough gpt-6.2-sol $1.20 39 12 1,161 $177
Fable Thorough v2 · GPT-6.2 Sol thorough v2 gpt-6.2-sol $0.46 15 9 1,282 $164
Fable · GPT-6.1 Sol thorough gpt-6.1-sol $0.62 38 13 1,437 $204
Fable Lean · Claude Fable 5.2 lean claude-fable-5-2 $0.90 2 3 415 $78
Fable Lean · Claude Fable 5.2 (low effort) lean, low effort claude-fable-5-2 $0.53 2 3 427 $84
Fable Lean · GPT-6.2 Sol lean gpt-6.2-sol $0.22 5 4 1,073 $147
Pip agent · GPT-6.2 Sol (default) lean v2 gpt-6.2-sol $0.18 5 3 988 $146
Pip agent · GPT-6.2 Astra lean v2 gpt-6.2-astra $0.58 5 2 844 $102
Pip agent · Claude Opus 5.5 lean v2 claude-opus-5-5 $0.40 3 3 527 $97
Pip agent · Claude Sonnet 5.5 lean v2 claude-sonnet-5-5 $0.12 3 1 290 $63
Fable Lean · GPT-6.1 Sol lean gpt-6.1-sol $0.18 6 3 932 $135

The lake house built by each Fable option

Every build passed its checks. One run per option shows what each costs and roughly how it looks, not which is better on average. At low effort Claude built a plainer model, without the siding color and white trim. Lean on GPT-6.2 Sol kept the roof shape, dormer and lattice skirt but laid an olive ground instead of a green lawn. The thorough GPT-6.2 Sol run was made before a prompt-caching fix that would have saved about half of its cost. With that fix its cost is estimated at about $0.60, so thorough v2 at $0.46 is roughly a quarter cheaper, in 15 turns instead of 39.

To run Fable locally, install the backend dependencies with npm run install:backend, install LeoCAD and an LDraw parts library (LDRAW_DIR, default ~/ldraw), and set the model's API key in your environment or backend/.env.

cd backend
python -m fable_agent build "Build my lake house from this photo" --image ./house.jpg --out ./house-build
python -m fable_agent build "A red fishing boat" --method lean --model gpt-6.1-sol --out ./boat-build
python -m fable_agent edit ./house-build "Make the roof dark red"

Each run writes a session directory with published/001/model.ldr, its build script, a parts list, the check report and renders. See the Fable guide for how it works, what its checks do and do not prove, and its limits.

License

BrickBuilder is open source. Different parts of it carry different licences:

What Licence
Everything not listed below: the website, the iOS app, the API and the building agents MIT, Copyright (c) 2026 Jake Johnson
backend/fable_agent/toolkit/: connector, Technic and vehicle review code copied from ldraw-nova by Carlos Antelo and contributors AGPL-3.0; see its NOTICE
The data folders under "Third-party data" CC BY-SA 4.0

The backend as a whole is offered under AGPL-3.0. It runs the AGPL-3.0 code above and uses the pyldraw3 library (GPL-3.0-or-later), so when you run it, or a modified version of it, as a service, you must offer your users its source under AGPL-3.0, as BrickBuilder does: the service at brickbuilder.ai is built from the main branch of this repository. Commercial use is allowed. The MIT files stay MIT: you may reuse any of them on their own under MIT.

The optional Nova agent runs as its own service, built from two pinned forks whose source is public: jjohnson5253/ldraw-nova (AGPL-3.0 code, CC BY-SA 4.0 material) and jjohnson5253/ldraw-nova-docker. The exact commits are in backend/setup_nova.cjs.

Third-party data

These folders hold material adapted from other projects. Each has the licence text, a NOTICE.md that names the authors, the source and what was changed, and a list of its files. They are licensed CC BY-SA 4.0, and nothing in this repository restricts reusing them under that licence. Everything else stays under the licences above.

Folder What it is
backend/fable_agent/data/shadow/ The LDCad shadow library: connector data for LEGO parts, and a seat table derived from it
backend/fable_agent/examples/library/ Example build scripts converted from official-set models of the LDraw Official Model Repository and from ldraw-nova's example atlases
backend/fable_agent/guides/ Building guides adapted from ldraw-nova's agent guides

LEGO® is a trademark of the LEGO Group, which does not sponsor, authorize, or endorse this project.

Ähnliche Projekte entdecken

Wird geladen…