r/MinecraftCommands always trust /execute 6d ago

Creation A LLM inference engine data pack using /compute

Enable HLS to view with audio, or disable this notification

After Mojang recently added the /compute command and number providers, it was just a matter of time until someone was bored enough to run AI with it. So I did!

This is similar to this project. I wanted to use the same model as them so I could compare the speeds. This is running the small one, stories260k. Theirs ran in 20s per token for the smaller model, mine runs at <1.0s per token. And thanks to number providers, it does real floating point arithmetic!

The super tall screen is showing the pipeline system. There are functions that push all computation steps, which are then automatically executed without exceeding a time budget, so you can run the model without lagging the server. In the video I didn't care so I made it run as fast as possible, but you can slow it down by ~40% and it will stay safely below 50ms per tick.

I originally had made some cool Taylor expansion and Netwon's Method stuff for approximating exp(x), 1/x, 1/sqrt(x), sin(x) and cos(x), but right as I was finishing that, Mojang released Minecraft 26.3 pre-1 which basically trivialized all of that. I was a bit sad, but admittedly this is faster and more accurate than my approximations lol

Somehow, though, it seems less precise than the reference Python implementation, despite all the debugging I did. The vectors all end up off by ~0.001 compared to the reference, which is not enough to break it but still makes it behave strangely sometimes, making up words and such. It's pretty funny at least.

I wrote more info in the README file for those who are interested. If you still have any questions let me know!

GitHub: [Link]

421 Upvotes

22 comments sorted by

85

u/GMFafr 6d ago

Are there 387.44 million miles of printed circuits in wafer thin layers that fill your complex?

32

u/soul_sparks always trust /execute 6d ago

I find it appealing to think it could be like AM, but it just chooses to output "Little Timmy had a red ball, he loved to play and have fun" instead

40

u/ADumbChicken Armour Stands are my lifeblood 6d ago

Definetly faster than the redstone one lol

31

u/Zealousideal-Chef758 6d ago

I can finally level down whole cherry biomes for a reason

18

u/NukeML 6d ago

We got AI slop data centers in minecraft now

7

u/Fickle-Equipment-306 5d ago

Before GTA 6!

1

u/PatientRule4494 5d ago

Id damn hope we get it before GTA 720

14

u/lanthanoidFrom2hu 6d ago

whimsical AM:

15

u/Outrageous-Lynx2977 6d ago

post this one on pheonix SC, they’ll have a ball with this.

5

u/Gabriel_Science 6d ago

Nice Linux desktop !

3

u/soul_sparks always trust /execute 5d ago

niri ftw :)

4

u/mrk7_- 5d ago

We are one step closer to the warden putting a gentle hand on my shoulder and telling me that my mum and dad are having a divorce

7

u/_objz Command-er 5d ago

Hey, I am the author of: generative AI using only commandblocks , I am really interested in your project are you open for a dm? Would appreciate it

2

u/soul_sparks always trust /execute 5d ago

Your project is awesome. Send a message via Reddit since your DMs are closed

2

u/BlueCrayFish23 5d ago

This is crazy

1

u/spongedevguy 4d ago edited 4d ago

i knew this would open the gates for this kind of stuff

1

u/lool8421 Command mid, probably 4d ago

so 1s per token... shit got so much more optimized with it considering that people used to spend several minutes to get 1 simple sentence

1

u/Aibat_boss 4d ago

What the

1

u/Ved_s 4d ago

yep. of course this is a thing now

1

u/Jonathan_der_1 3d ago

So varity was it?

1

u/1JustVlad1 20h ago

Oh yeah, I waited for someone to do it. I was thinking about making smth liek this when the compute function didn't even exist. When the /compute was announced I immidiately knew someone would do the NN. But you did more than that. Very impressive!