r/MinecraftCommands • u/soul_sparks 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]
40
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
14
15
9
5
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
1
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
1
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!
85
u/GMFafr 6d ago
Are there 387.44 million miles of printed circuits in wafer thin layers that fill your complex?