Meet LegoGPT, an AI model that creates custom Lego sets

The designs may be simple, but the possibilities are endless.
 By 
Chance Townsend
 on 
Lego Bricks in child's hands with Lego Duplo blocks and toys background
Credit: Ekaterina79 / Editorial RF/ iStock Editorial via Getty Images

Researchers at Carnegie Mellon University have unveiled something delightfully geeky: LegoGPT, an AI model that builds Lego structures straight from text prompts.

The study, published last Thursday, explains the mechanics in depth. Armed with a massive dataset of Lego builds constructed by the team with captions, the researchers trained a model similar to ChatGPT — but instead of guessing the next word, it predicts the next brick.

[1/2] We've released the code for LegoGPT. Our autoregressive model generates physically stable and buildable designs from text prompts by integrating physics laws and assembly constraints into LLM training and inference. Code: github.com/AvaLovelace1... Website: avalovelace1.github.io/LegoGPT/

[image or embed]

— Jun-Yan Zhu (@junyanz.bsky.social) May 9, 2025 at 10:06 PM

It’s not the first foray into autonomous Lego construction, but the researchers say LegoGPT stands out by generating step-by-step blueprints designed to keep your builds structurally sound. The team’s research, available on GitHub, details how the AI was trained on a dataset of more than 47,000 Lego structures, featuring 28,000 distinct 3D components.


You May Also Like

According to the researchers, designs generated by LegoGPT were physically stable 98 percent of the time.

There’s a hefty dose of math and physics behind it all — more than I can personally vouch for — but according to the paper, LegoGPT sticks to the laws of physics, so the results aren’t especially wild. Most of the team’s sample builds were practical pieces: couches, chairs, tables, and similar home designs.

The tool is available for free on GitHub for anyone who wants to explore or experiment.

Headshot of a Black man
Chance Townsend
Assistant Editor, General Assignments

Chance Townsend is the General Assignments Editor at Mashable, covering tech, video games, dating apps, digital culture, and whatever else comes his way. He has a Master's in Journalism from the University of North Texas and is a proud orange cat father. His writing has also appeared in PC Mag and Mother Jones.

In his free time, he cooks, loves to sleep, and greatly enjoys Detroit sports. If you have any tips or want to talk shop about the Lions, you can reach out to him on Bluesky @offbrandchance.bsky.social or by email at [email protected].

Mashable Potato

Recommended For You
The best Lego deals this week deals take up to $20 off Disney, Star Wars, and Marvel builds
a Lego recycling truck, Lilo and Stich Beach House, and Lego Star Wars Millennium Falcon builds all on a pink and coral-colored background

The new and exclusive Lego Mini Pokémon Center is live — how to claim yours on Pokémon Day
Lego Mini Pokémon Center


New Lego Star Wars Smart Play sets have landed — preorders are live now at Amazon
Lego Start Wars Smart Play sets as seen at CES 2026

Build the love: The best Lego sets for Valentine’s Day 2026
lego heart ornament set hung up on a door

Trending on Mashable
NYT Connections hints today: Clues, answers for April 3, 2026
Connections game on a smartphone

Wordle today: Answer, hints for April 3, 2026
Wordle game on a smartphone


What's new to streaming this week? (April 3, 2026)
A composite of images from film and TV streaming this week.

You can track Artemis II in real time as Orion flies to the moon
Victor Glover and Reid Wiseman piloting the Orion spacecraft
The biggest stories of the day delivered to your inbox.
These newsletters may contain advertising, deals, or affiliate links. By clicking Subscribe, you confirm you are 16+ and agree to our Terms of Use and Privacy Policy.
Thanks for signing up. See you at your inbox!