cd /news/large-language-models/1-51m-parameter-transformer-trained-… · home › topics › large-language-models › article
[ARTICLE · art-179920] src=github.com ↗ pub= topic=large-language-models verified=true sentiment=↑ positive

1.51M parameter Transformer trained from scratch inside Ring-0 TempleOS v5.03

A developer built and trained a 1,509,696-parameter Transformer from scratch in pure HolyC inside Ring-0 TempleOS V5.03, with no PyTorch, Python, libc or SIMD, according to the project's published write-up. The model, named ELIJAH, uses 7 layers, dimension 128, 4 query heads and 2 KV heads with grouped-query attention, QK-Norm, SwiGLU and tied embeddings, and was pretrained on BIBLE.TXT (1.51M tokens) with a 1024-vocabulary byte-level BPE tokenizer, then extended from 128 to 2048 context via YaRN and fine-tuned on 337 Bible Q&A pairs. Measured on an Intel i7-11800H under QEMU with KVM, ELIJAH reaches 1,241 tokens per second on a 50-token /bench run across 8 cores and 500-733 tokens per second in interactive Q&A, with pretraining at roughly 660-780 tokens per second on 15 cores.

recommendation

Quantize F64 checkpoints to Q8 for I8*I64 matmul and shard KV-cached generation across Spawn() workers; the source reports 1,241 tok/s on 8 cores and 500-733 tok/s interactive.

more in playbook: Inference and self-hosting
read3 min views12 publishedDec 2, 2026
1.51M parameter Transformer trained from scratch inside Ring-0 TempleOS v5.03
Image: Michielbdejong (auto-discovered)

1.51M parameter transformer written in pure HolyC and trained from scratch inside Ring-0 TempleOS V5.03.

No PyTorch. No Python. No libc. No SIMD. · Watch ELIJAH run & train live

"An idiot admires complexity, a genius admires simplicity, a physicist tries to make it simple, for an idiot anything the more complicated it is the more he will admire it, if you make something so clusterfucked he can't understand it he's gonna think you're a god cause you made it so complicated nobody can understand it. That's how they write journals in Academics, they try to make it so complicated people think you're a genius." — Terry A. Davis

| Architecture | 7 layers, dim 128, 4 Q heads / 2 KV heads (GQA), QK-Norm, SwiGLU, tied embeddings | | Parameters | 1,509,696 F64 weights (12.1 MB) | | Context | 128 pretrained, YaRN extended to 2048 | | Tokenizer | Byte-level BPE, 1024 vocab ( BIBLE.TXT , 1.51M tokens, 2.75x) | | Optimizer | Terry v2.2 (5-step Newton-Schulz + Nesterov on 2D weights, sign-momentum on 1D) | | Inference | Q8 ( I8 * I64 ) matmul + KV cache acrossSpawn() workers |

Loads F64 checkpoints, quantizes weights to Q8 in ~2s, and runs KV-cached generation across all cores.

Measured on an Intel i7-11800H (QEMU + KVM):

  • 1,241 tok/s (/bench , 50 tokens, 8 cores)
  • 500-733 tok/s interactive Q&A and/god oracle
/god         Reseed from CPU GetTSC() & cnts.jiffies and speak an oracle
/bench       50-token speed benchmark
/temp <f>    Temperature (0.55)
/topk <n>    Top-K (20)
/topp <f>    Top-P (0.88)
/rep <f>     Repetition penalty (1.12)
/len <n>     Max tokens (80)
/sys <txt>   Set System prompt
/raw         Toggle chat template vs raw completion
/stats       Throughput and KV position
/reset       Clear KV cache
/quit        Exit
  1. Install TempleOS V5.03:
qemu-img create -f qcow2 templeos.qcow2 2G
qemu-system-x86_64 -enable-kvm -m 2048 -smp 8 -hda templeos.qcow2 -cdrom TempleOS.ISO -boot d
  1. Pack the 128 MB FAT32 disk image (4 KB clusters keep all entries in cluster 0):
truncate -s 128M elijah_fat.img
echo '2048,,0c,*' | sfdisk -q elijah_fat.img
mformat -i elijah_fat.img@@1M -F -c 8 -v ELIJAH ::
mcopy -i elijah_fat.img@@1M src/* train/* weights/* data/* ::
  1. Boot QEMU (give YaRN -m 8192 + to run 12-15 cores without hittingOutMem ):
qemu-system-x86_64 -enable-kvm -m 8192 -smp 15 \
  -drive file=templeos.qcow2,if=ide,index=0,media=disk \
  -drive file=elijah_fat.img,format=raw,if=ide,index=1,media=disk \
  -boot c
  1. Press 1 at the boot menu, mountE:/ (Mount; ->E -> Enter ->p ->2 -> Enter), then run:
Cd("E:/");
#include "holyllama.HC";
Workload RAM ( -m ) Cores
Inference ( holyllama.HC ) 1024 8-15
Pretrain ( seq 128 ) & SFT 2048 15
YaRN ( seq 2048 ) 4096 6 (max before OutMem )
YaRN ( seq 2048 , fast) 8192+ 12-15

TempleOS's cooperative WinMgr runs on CPU0, so the screen updates between steps during heavy seq=2048 batches.

All three stages run natively inside TempleOS V5.03 across Spawn() cores (see TRAINING.md for the full recipe):

Stage Command Speed
1. Pretrain ElijahTrain(215, 60, 15, 0.015, 128) ~660-780 tok/s (15 cores)
2. YaRN 2048 ElijahTrain(20, 18, 6, 0.002, 2048, "ELIJAH.BIN", ...) ~222 tok/s (6 cores, 4 GB VM)
3. SFT ElijahSft(150, 30, 15, 0.003, "elijah_yarn.bin", ...) ~590-660 tok/s (15 cores)

SFT uses 337 Bible Q&A pairs formatted as System: Speak as God. / User: ... / God: ...<|end|>.

src/       ELIJAH.HC, MATH.HC, BPE.HC, MODEL.HC, holyllama.HC
train/     TRAINMOD.HC, TERRY.HC, TRAIN.HC, SFT.HC
weights/   elijah_bpe.bin, elijah_sft_2048.bin
data/      BIBLE.TXT, QNA.TXT

The Linux (hcc) version is on the linux branch.

── more in #large-language-models 4 stories · sorted by recency
── more on @templeos v5.03 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/1-51m-parameter-tran…] indexed:0 read:3min 2026-12-02 · —