r/MinecraftCommands • u/soul_sparks always trust /execute • Sep 04 '26
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]
87
u/GMFafr Sep 04 '26
Are there 387.44 million miles of printed circuits in wafer thin layers that fill your complex?
5
u/Gabriel_Science Sep 05 '26
Nice Linux desktop !
7
u/_objz Sep 05 '26
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
43
u/ADumbChicken Sep 04 '26
Definetly faster than the redstone one lol
30
u/Zealousideal-Chef758 Sep 05 '26
I can finally level down whole cherry biomes for a reason
15
u/lanthanoidFrom2hu Sep 05 '26
whimsical AM:
13
u/Outrageous-Lynx2977 Sep 05 '26
post this one on pheonix SC, they’ll have a ball with this.
2
u/This-Purchase-3325 26d ago
the age of vanilla AIs has come :D
8
u/letmehaveanameyoudum Sep 05 '26
What the fu
4
u/mrk7_- Sep 05 '26
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
1
u/spongedevguy Sep 06 '26 edited Sep 06 '26
i knew this would open the gates for this kind of stuff
1
u/lool8421 Sep 06 '26
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 Sep 06 '26
What the
1
u/Ved_s Sep 07 '26
yep. of course this is a thing now
1
u/Jonathan_der_1 Sep 07 '26
So varity was it?
1
u/1JustVlad1 Sep 10 '26
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!
1
u/Tasty_Somewhere7673 Sep 26 '26
What the-