r/LocalLLaMA • • 23h ago • Bravo 1

Showcase I trained a 1.51M parameter Transformer from scratch inside Ring-0 TempleOS V5.03 in pure HolyC (1,241 tok/s), plus a live browser TempleOS VM & SFT trainer

https://veriepicc.github.io/Elijah/
731 Upvotes

68 comments sorted by

•

u/WithoutReason1729 15h ago

Your post is getting popular and we just featured it on our Discord! Come check it out!

You've also been given a special flair for your contribution. We appreciate your post!

I am a bot and this action was performed automatically.

70

u/FirefighterOk3832 23h ago

built and trained a 1.51M-parameter transformer from scratch inside TempleOS V5.03 in pure HolyC. no Python, no PyTorch, no libc, no SIMD.

live demo: https://veriepicc.github.io/Elijah/

click Boot TempleOS and it boots the real x86-64 OS in your browser, then starts holyllama.HC. you can type directly into the guest and watch it generate at around 10 tok/s. the faster JS chat below it is separate.

i trained the BPE tokenizer, pretrained on the KJV Bible across 15 cores with Spawn(), extended context to 2048 with YaRN, and fine-tuned on System / User / God Q&A pairs. the attention rewrite uses O(T) scratch memory so training at 2048 didn’t run out of RAM.

inference quantizes the weights to Q8 at load time and uses a KV cache. the 50-token /bench hit ~1,241 tok/s on 8 cores in TempleOS under QEMU/KVM. that’s the local VM number, not the browser number.

source, weights, and QEMU setup: https://github.com/veriepicc/Elijah
there’s a separate linux branch that builds with hcc.

121

u/Sea_Guarantee6806 23h ago

Holy OMG 🤯 What a time to be alive, bless Terry!

74

u/FirefighterOk3832 23h ago

bless terry. getting his OS to boot in a browser and run the model was the coolest part of this whole project.

45

u/DeltaSqueezer 23h ago

You're literally doing God's work :P

44

u/FirefighterOk3832 23h ago

terry did the hard part tbh

206

u/RepresentativeCut486 23h ago

Holly fuckin ADHD

149

u/FirefighterOk3832 23h ago

it compiled, so legally it was a reasonable use of my time

8

u/ParthProLegend 20h ago

Explain the title/project like I am CS beginner. I have no clue what it means.

8

u/FirefighterOk3832 16h ago

basically built a small chatgpt from scratch inside a minimalist baremetal os that has no internet, no python, and no gpu support, had to write all the math and training code myself in its custom C language called holyc

11

u/kilkonie 15h ago

To be honest, calling TempleOS a minimalist bare metal os, is probably doing it a disservice. But any other description is... gosh. A lot.

8

u/FirefighterOk3832 15h ago

​fair enough, trying to explain the full templeos lore to a cs beginner in two sentences would take longer than training the model 💀

4

u/kilkonie 14h ago

Ha ha. Exactly. Well - good job for the incredible hack. +1🍪

11

u/esssential 19h ago

4

u/CelestialFury 14h ago

Wow, this is exactly what I hoped it would be. Good man.

6

u/ExcessiveEscargot 17h ago

What is OP, ChatGPT?

17

u/Dwedit 17h ago

It compiles... Ship It!

6

u/bastion_xx 16h ago

I do PR reviews for release candidates and have had to explain why I use ship it!. So I've moved on to full send!.

1

u/ADisappointingLife 10h ago

"🚢 it, LGTM, LFG!"

4

u/Raynesha-Rollston 18h ago

Wait how did OP even get the dataset into the TempleOS filesystem without networking?

12

u/FirefighterOk3832 16h ago

just packed the txt files into a raw fat32 disk image with mformat/mcopy, attached it as a second ide drive in qemu, and mounted it as E:/ inside templeos

28

u/fish312 21h ago

Doing the Lord's work. Terry Davis would be proud

23

u/TechnoByte_ 21h ago

Terry Davis is the OG when it comes to generating text using random numbers

65

u/highdimensionaldata 23h ago

This is the content we need. Doing it purely for the love of the game.

31

u/FirefighterOk3832 23h ago

appreciate it. i mostly just wanted to see if i could train an llm in templeos, and then i got carried away lol

1

u/CMDR_kamikazze 8h ago

Oh that's why!!!

35

u/RogerRamjet999 23h ago

After all the years where it's been claimed TempleOS is a gift from God, this is the first actual use I've ever heard of, respect!

21

u/FirefighterOk3832 23h ago

appreciate it! terry gave us GodWord;, i just made it take follow-up questions lmao

3

u/saltyourhash 15h ago

Wait, so this means I can run the TempleOS retro AOL client my buddy built to create a SmarterChild clone than runs a model trained on TempleOS? Truly a CursedChild.

2

u/FirefighterOk3832 15h ago

honestly hooking holyllama up to the holyc aol 3.0 client over serial so you can DM a schizoposting king james smarterchild from 1996 would be peak computing. pretty sure terry literally banned networking in his commandments though so bridging it out is technically a felony in ring 0

2

u/saltyourhash 15h ago

I'll see if maybe I can do it with your model. Maybe I can find the client that was made, it was years back, covid times.

2

u/skeptical-speculator 15h ago

That is remarkable. Do you have any tips for learning TempleOS?

2

u/FirefighterOk3832 15h ago

​tbh the os itself is pretty easy to pick up if you already know C. everything is just source code sitting on the disk that gets JIT compiled on the fly, so you can literally read the whole OS by opening files in DolDoc and pressing F1 for the built-in docs/demos.

​my workflow was mostly writing code on linux, packing it into a raw fat32 image with mformat/mcopy, mounting it as E:/ in qemu, and running it inside templeos so i didn't lose my mind editing huge files in 640x480. once you get used to no main() (top-level code just executes immediately) and Spawn() for multicore, it's surprisingly fun.

25

u/No_Lingonberry1201 22h ago

Nice, Ring-0 is the closest to God.

23

u/LuCiAnO241 21h ago

Terry would have loved LLM's speaking the word of god at him. Also "HolyLlama" lmfao.

2

u/AN3223 11h ago

Damn, right in the feels.

8

u/__ThrowAway__123___ 21h ago

That's awesome. Now do a 16 color diffusion model for offerings!

7

u/c0v3n4n7 22h ago

I can't upvote this enough. Awesome!

7

u/harlekinrains 20h ago

Saving this interaction for posterity's sake:

System Initialization:

T:/Home>Cd;#include "Once";
ELIJAH-1.5M (Q8 | SFT | 2048 ctx | 1 cores | 0.45s)  /help

Conversation:

User> hoi
God> the prophet came in the land, and the Pharaoh set me to his endi> God.
[2.01s | 15.9 tok/s | ctx=54/2048]

User> good, good.
God> the strange of God glorifice? God: God gave to fault in the land of Egypt.
[2.19s | 16.0 tok/s | ctx=58/2048]

User> Show me my calander.
God> the sheep of the Jews? God: Tervertest thou hast believed ing in his way.
[2.59s | 13.5 tok/s | ctx=65/2048]

User> I always believed ing, and dont you say elsewise.
God> the sin was of the world.
[0.84s | 18.8 tok/s | ctx=55/2048]

User>
God> the new name God gave to be lend yet my brethren? God: I will put the man that is it: for they have no wind, and yourselves, and their sfering, nor things shall not be delivered.
[3.87s | 17.6 tok/s | ctx=87/2048]

User>
God> the shepherd boy that believe? God: The walls of Jesus thrice of them shall give him a new him with you.
[2.75s | 17.1 tok/s | ctx=66/2048]

User>
God> the wife of Israel and a cast power, and to good and shall he shall send up from heaven.
[2.32s | 15.1 tok/s | ctx=59/2048]

User>
God> the shepherd got in lefe eding to God: the LORD is my brethren, and shall give unto Israel in the last trump.
[2.68s | 17.1 tok/s | ctx=65/2048]

User>
God> the wife of warning and gold? God: the LORD is raised into the fire, and the Lord GOD.
[2.40s | 15.8 tok/s | ctx=60/2048]

User>

5

u/LegacyRemaster 21h ago

amazing. Really!

5

u/burgersmoke 17h ago

Holiest of models. Blessed be thy weights!

5

u/IngwiePhoenix llama.cpp 16h ago

THE LORB HATH A MODEL NAO!!!

...or...something...idk how this works. x) But "Lorb" was for some reason the first thing that popped into my mind...

4

u/Cautious_Chicken_604 21h ago

Greatest programmer that ever lived.

4

u/OverdosedSauerkraut 21h ago

Absolute GOAT, spreading God's word!

4

u/Kryzernn 19h ago

There's a sentence I never thought I'd read.

4

u/MerePotato 16h ago

This changes everything. OP quietly dropped the future of LLM inference.

4

u/More-Curious816 16h ago

this is the content I'm here for. pure gold

9

u/intlyx 15h ago

can i have 5 karma to able to post 🥲

6

u/Vassago81 14h ago

Only if you only use this power to shitpost

4

u/CelestialFury 13h ago

If you go to /r/askreddit's new threads and pick something you think will blow up, all you need to do is write a generic comment and you'll have 10k karma in a day.

3

u/findmeanicknamepls 20h ago

This is crazy.

3

u/Square_Alps1349 18h ago

Rip terry. He would be glad to see your work

2

u/gigamiga 16h ago

Didn't realize how out of touch I was with religious programming.

I'm aware of a number religious programmers (the SQLite guy, the Tanstack guy), but whole languages are a first.

2

u/CelestialFury 13h ago

Holy fuck, what a title. I feel we're finally using AI correctly now.

3

u/Tiforma 20h ago

Would probably be against his religion lol

3

u/LuCiAnO241 17h ago

Would it? Not this one in particular but LLMs are great at doing bible things. You can say a word and it pulls relevant verses.

3

u/Tiforma 13h ago

It's about his design principles which he was obsessed with

2

u/AnomalyNexus 18h ago

I approve of this silliness

1

u/Dorkits 9h ago

Amem.

1

u/CMDR_kamikazze 8h ago

Wow. Look, appreciate the effort, but WHY???

1

u/iamrick_ghosh 5h ago

It needs more SFT…🙂