Elijah, hands-on: run a 1.5M transformer written in pure HolyC — no TempleOS required
A 1.5M-parameter transformer trained from scratch in pure HolyC inside TempleOS now runs on plain Linux — no Python, no PyTorch, no GPU. Build the HolyC compiler, compile the model, and get it talking in under ten minutes.
- Model: 1,509,696 parameters; 7 layers, dim 128, 4 Q heads / 2 KV heads (GQA), QK-Norm, SwiGLU, tied embeddings; context 128, YaRN-extended to 2048; byte-level BPE, 1,024 vocab.
- Training data: the King James Bible (4,164,671 bytes, 1,513,113 tokens); SFT on 337 Bible Q&A pairs.
- Verified in a sandbox (Dec 2): hcc builds in ~19 s; holyllama compiles in seconds; /bench 438.6 tok/s on 1 core; one-shot prompt 304.6 tok/s; train 1-step loss 6.95; SFT 1-step loss 0.41.
- Cost: $0. No GPU, no Python, no accounts, no API keys.
- Honest limits: 1.5M parameters on one book — output is Bible-flavored word salad; the TempleOS/QEMU path is documented, not verified here (no KVM in the sandbox); the repo is 3 days old.

On November 30, a repository appeared on GitHub with a premise that reads like a joke: a transformer, trained from scratch, in pure HolyC, inside TempleOS — the operating system Terry Davis wrote single-handedly, running everything in Ring 0 with no memory protection, no processes, and no apologies. By the next day, the Reddit thread tracking it had passed 700 upvotes and was still climbing. The model is tiny — 1.5 million parameters, trained on the Bible — and its output is gloriously garbled. But the engineering is real, and the whole thing runs on plain Linux in under ten minutes, with no Python, no PyTorch, and no GPU.
That is the project: ELIJAH-1.5M. And this tutorial runs it end to end the way a reader would — building the HolyC compiler it needs, compiling the model, generating text, asking the oracle, and running a training step. Every command below was executed in a sandbox on December 2, and every output is quoted verbatim, including the nonsense.
What you'll need#
- An x86-64 Linux machine. Any recent distribution. The build was verified on a 2-core sandbox VM.
gcc,cmake,make, andgit. On Debian/Ubuntu:sudo apt install build-essential cmake git.- About 50 MB of disk and 15 minutes. The model weights are 12 MB. There is nothing to download from a model hub beyond the two repositories.
- No GPU, no Python, no accounts, no API keys. Nothing here phones home. The total spend is zero.
What Elijah actually is, in sixty seconds#
ELIJAH-1.5M is a 1,509,696-parameter transformer written entirely in HolyC — the C-like language of TempleOS — and trained from scratch inside TempleOS V5.03. No PyTorch. No Python. No libc. No SIMD. The training loop, the optimizer, the tokenizer, and the inference engine are all HolyC source files in one repository. The model reads the King James Bible (4,164,671 bytes, 99,254 lines), tokenizes it with a byte-level BPE vocabulary of 1,024 tokens, and learns to continue it.
| Piece | What it is |
|---|---|
| Architecture | 7 layers, dim 128, 4 query heads / 2 KV heads (grouped-query attention), QK-Norm, SwiGLU MLP, tied embeddings, YaRN RoPE |
| Context | 128 tokens pretrained, extended to 2,048 with YaRN |
| Weights | 1,509,696 float64 weights, 12.1 MB on disk, quantized to Q8 at load time |
| Tokenizer | Byte-level BPE, 1,024 vocab, trained on the Bible itself (1,513,113 tokens) |
| Fine-tuning | 337 Bible Q&A pairs, formatted as System: Speak as God / User: … / God: … |
| Optimizer | "Terry v2.2" — 5-step Newton-Schulz orthogonalization plus Nesterov momentum on matrices, sign-momentum on norms and embeddings |
The repository has two faces. The main branch is the native TempleOS version: HolyC files you #include inside TempleOS itself, running on the bare metal of a VM. The linux branch is a port that compiles the same HolyC sources with hcc, an open-source HolyC compiler written in C, and runs them as ordinary Linux binaries. This tutorial uses the Linux port — it is the same model, the same weights, and the same commands, without needing a TempleOS install. The native path gets its own section at the end.

1. Build the HolyC compiler#
Elijah's sources are HolyC, so the first step is a HolyC compiler. The port uses hcc from the holyc-lang project — a from-scratch HolyC compiler in C that writes native object files. It builds in seconds. Clone it, pick an install prefix, and build:
git clone --depth 1 https://github.com/Jamesbarford/holyc-lang
cd holyc-lang
mkdir -p ~/hcc/lib
make INSTALL_PREFIX=$HOME/hcc -j4
make install INSTALL_PREFIX=$HOME/hcc
Two details matter, and both cost me a failed attempt before I understood them. First, the install prefix is baked in at build time: the prefix you pass to make is the prefix the compiler will look in at runtime, so use the same prefix for the build and the install. Second, the install step copies the standard library into $PREFIX/lib but does not create that directory — pre-create it with mkdir -p ~/hcc/lib or the install fails halfway, after installing the binary. With those two in place, the sequence above succeeds on the first try. Verify it:
ls ~/hcc/bin/hcc ~/hcc/include/tos.HH ~/hcc/lib/libtos.a
~/hcc/bin/hcc --version
Expect the three files to list, and a version line — hcc v0.0.17-beta at the time of writing. Then put the compiler on your path for the rest of the session:
export PATH=$HOME/hcc/bin:$PATH
A word on expectations: hcc is a young compiler, and its own README says it is "more for fun than for serious software development", with error messages that are "a bit hit and miss". For compiling Elijah it works. If a compile fails with a confusing error, the fix is almost always a missing tos.HH — check that ~/hcc/include/tos.HH exists before debugging anything else.
2. Get Elijah and compile the model#
Clone the Linux branch of Elijah. It is small — the weights are 12 MB and the sources are a handful of HolyC files:
git clone --depth 1 --branch linux https://github.com/veriepicc/Elijah
cd Elijah
ls src train weights data
You should see src/ (the model and inference code), train/ (the trainer and optimizer), weights/ (the tokenizer and the fine-tuned checkpoint), and data/ (the Bible text and the Q&A pairs). Compile the three binaries — inference, trainer, and fine-tuner:
hcc -O -o holyllama src/holyllama.HC
hcc -O -o elijah_train train/TRAIN.HC
hcc -O -o elijah_sft train/SFT.HC
ls -la holyllama elijah_train elijah_sft
Each compile takes a few seconds and produces a binary around 170–180 KB. The linker will print a warning about a missing .note.GNU-stack section; it is harmless. If hcc instead errors with Failed to open file: .../include/tos.HH, your install prefix does not match the one the compiler was built with — rebuild hcc with the same prefix for both steps.
3. Your first generation#
Run the benchmark first. It generates 50 tokens and reports throughput:
./holyllama /bench
ELIJAH-1.5M (Q8 | SFT | 2048 ctx | 1 cores | 0.04s) /help
[bench 50 tokens]
of?<|ene the LORD said, forem: of thou hast restmounted ing until into heavents.<|>
God: but if the LORD strong holy man?
God
[0.11s | 438.6 tok/s | 1 cores]
That is a real result on a 2-core sandbox VM: 50 tokens in 0.11 seconds, 438.6 tokens a second on a single core, weights quantized to Q8 in 0.04 seconds at startup. The project's own README claims 1,241 tokens a second on an i7-11800H with 8 cores inside TempleOS — the gap is core count, not a different model. Now ask it something:
./holyllama "Who slew Goliath?"
ELIJAH-1.5M (Q8 | SFT | 2048 ctx | 1 cores | 0.04s) /help
God> the strait fiof l, a man that can thing wer and Hebrews say of Pharaoh, whom he will presented unto his word.
[0.17s | 304.6 tok/s | ctx=85/2048]
The answer is word salad — David is not in it, and "fiof" is not a word. That is the honest output of a 1.5-million-parameter model trained on 1.5 million tokens of a single book, and it is worth seeing unedited: this is a demonstration of a training pipeline, not a chatbot. The interesting part is that it runs at all, on a CPU, from HolyC, in 0.17 seconds.
Run it interactively to see the controls. Type /help for the command list — temperature, top-K, top-P, repetition penalty, max tokens, the /god oracle, and telemetry:
./holyllama /help
Commands:
/sys <txt> Set System: prompt
/raw Toggle SFT chat vs raw (1)
/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)
/bench 50-token throughput test
/god Reseed RNG & speak oracle
/stats Throughput & KV context telemetry
/reset Clear KV cache
/quit Shutdown workers & exit
Start an interactive session, set a system prompt, and ask the oracle a question:
./holyllama
ELIJAH-1.5M (Q8 | SFT | 2048 ctx | 1 cores | 0.04s) /help
User> /stats
[toks=0 | avg=0.0 tok/s | ctx=0/2048 | cores=1]
User> /temp 0.9
[temp=0.90]
User> /sys Speak as God.
[System: set, KV reset]
User> Who created the heavens?
God> the righteous day, he casting a little ewe countrinuth, and a find cer cleanseth They price.
[0.23s | 202.6 tok/s | ctx=73/2048]
The /god command reseeds the generator from the CPU timestamp counter and speaks an "oracle" — one-shot, it works the same way:
./holyllama /god
Oracle> the sword of marriage on the other of all the light of the LORD.
[0.12s | 225.8 tok/s | ctx=55/2048]
Try /temp 0.2 for more deterministic output and /temp 1.2 for wilder output; the difference is visible within a line or two. /len caps the reply length, and /reset clears the context when a conversation goes off the rails — which, at this scale, it will.
4. Train it yourself#
Inference is the warm-up. The point of Elijah is that the training loop is right there, in HolyC, and it runs on the same machine. The trainer takes five arguments — steps, batch size, threads, learning rate, sequence length. Run one step to prove the whole pipeline works:
./elijah_train 1 2 4 0.015 128
training bpe vocab=1024 on 4164671 bytes...
encoded 1513113 tokens (2.75x) | cores=2 | batch=2 | seq=128
step 0/1 | loss 6.9530 | lr 0.00150 | 57 tok/s | 4.5s
saved elijah.bin
That single step retrains the tokenizer on the Bible (1,513,113 tokens, exactly as the project documents), runs one optimizer step, and saves a 12 MB checkpoint as elijah.bin — in about ten seconds. The loss, 6.95, is what a randomly initialized model looks like after one step; it is supposed to be terrible. The fine-tuner works the same way. One step, using the shipped checkpoint as the starting point:
./elijah_sft 1 2 4 0.003 weights/elijah_sft_2048.bin /tmp/sft-test.bin
SFT encoded 337 samples (from 337 pairs) | cores=2 | batch=2
sft step 0/1 | loss 0.4092 | lr 0.00030 | 46 tok/s | 3.3s
saved /tmp/sft-test.bin

With the smoke tests passing, the full recipe is the project's documented three-stage run. All three commands below come from the project's training notes, with the Linux binary argument forms from the port's README — the training code is identical; only the invocation differs from the TempleOS version:
# Stage 1 — pretrain: 215 steps x batch 60 x seq 128 = 1,651,200 tokens
./elijah_train 215 60 15 0.015 128
# Stage 2 — YaRN context extension, 128 to 2048 tokens
./elijah_train 20 18 15 0.002 2048 elijah.bin elijah_yarn.bin
# Stage 3 — SFT on the 337 Q&A pairs
./elijah_sft 150 30 15 0.003 elijah_yarn.bin elijah_sft_2048.bin
Budget honestly. The project reports 650–780 tokens a second for pretraining on 15 cores, which puts stage 1 at roughly 35–40 minutes, and 222 tokens a second for the YaRN stage (about 55 minutes for its 737,280 tokens; the project measured the loss falling from 3.33 to 3.15 there). On the 2-core sandbox used here, the one-step smoke test ran at 57 tokens a second — a full pretrain on hardware that small would take hours. Run the full recipe on a machine with real cores, or treat the one-step runs as the verified version and leave the full training as an overnight job.
5. The TempleOS path (optional)#
Everything above is the Linux port. The native path — the one that made the project famous — runs the same code inside TempleOS itself, and it is worth knowing about even if you never boot it. The project's documented quick start, from its main-branch README:
# 1. Install TempleOS V5.03 in a VM
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
# 2. Pack the project onto a 128 MB FAT32 disk image
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/* ::
# 3. Boot with enough RAM and cores for the long-context stages
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
Then, inside TempleOS, mount the second drive, change into it, and include the inference file:
Cd("E:/");
#include "holyllama.HC";
Be clear about what is verified here and what is not: every step in sections 1–4 above was run in a sandbox and produced the outputs shown. The TempleOS path was not — the sandbox has no KVM, and QEMU without it would be unusably slow for a 15-core workload. The commands above are the project's own, quoted from its README, and the hardware bar is real: give YaRN 8 GB of RAM and 12–15 cores, or expect out-of-memory errors. If you do boot it, the screenshots in this article are what the session looks like.
When to use this vs alternatives#
| Project | What you get | Pick it when |
|---|---|---|
| Elijah | A 1.5M transformer, HolyC, no frameworks, CPU-only | You want to see every line of a training pipeline, or you care about the TempleOS/HolyC story itself |
| MiniMind | Train a small LLM from scratch in PyTorch in about 2 hours | You want a model you can actually extend, scale, and use — with a normal Python stack |
| llm-asm | Qwen3 0.6B inference in pure assembly | You want bare-metal inference of a real, useful model and do not need training |
| llama.cpp / Transformers | Production local inference for real models | You need a model that answers questions correctly |
Elijah is the wrong tool for every practical job on that list. Its value is elsewhere: it is the shortest complete path from "nothing" to "a transformer I trained myself" that involves no framework at all. MiniMind teaches you LLM training inside PyTorch; Elijah teaches you what PyTorch is hiding. Read it as a teaching artifact and a stunt with real engineering inside, not as a model to deploy.
Reading the results honestly#
- The output is bad, and that is expected. 1.5 million parameters, 1.5 million training tokens, one book. The model produces Bible-flavored word salad with occasional correct names. Nothing in this tutorial makes it smarter.
- The throughput numbers are the project's claims, not mine, except where labeled. The 1,241 tokens-a-second figure is the README's measurement on an i7-11800H under QEMU/KVM. My measured numbers — 438.6 tok/s on one sandbox core for the benchmark, 57 tok/s for a training step — are the ones I observed, and the gap is core count and batch size.
- The project is three days old. It had 103 stars when checked on December 2, against 700-plus Reddit upvotes. The signal here is discussion, not adoption. Expect rough edges: the
hccinstall quirk in step 1 is one, and the compiler's own README warns its errors are hit and miss. - The Linux port is a port. The native TempleOS version is the project's real artifact; the Linux branch exists so you can run it without a VM. The training math is the same, but if you want the authentic experience — or the 1,241 tok/s number — boot TempleOS.
The takeaway#
You now have a transformer that was written in a language most programmers have never touched, trained in an operating system that runs everything in Ring 0, running on your Linux machine with no frameworks and no GPU. The model itself will not answer your questions. But you have compiled a HolyC compiler, compiled a transformer from HolyC source, run a benchmark at 438 tokens a second on one core, asked an oracle, and verified a training step end to end — and you can read every line of the pipeline that did it. For a weekend project, that is the whole point.
Frequently asked questions
Do I need TempleOS installed?
No. The linux branch runs on plain Linux with the hcc compiler. TempleOS in QEMU is optional — it is the native path, documented in section 5, but everything in this tutorial uses the Linux port.
Do I need a GPU?
No. Inference is Q8 on CPU with a 12 MB checkpoint; the benchmark in this tutorial ran at 438.6 tokens a second on a single sandbox core. Training is CPU-only too.
Why is the output gibberish?
The model has 1.5 million parameters and trained on 1.5 million tokens from a single book. It is a demonstration of a complete training pipeline, not a chatbot — expect Bible-flavored word salad, not answers.
How long does full training take?
The project reports 650–780 tokens a second for pretraining on 15 cores, putting the 1.65M-token pretrain at roughly 35–40 minutes, plus about 55 minutes for the YaRN stage. On the 2-core sandbox used here the one-step smoke test ran at 57 tokens a second, so budget hours on small hardware.
Can I train it on my own text?
Not through a documented option. The pipeline is built around BIBLE.TXT and QNA.TXT, and the training notes describe only that corpus. Swapping in your own text would mean rebuilding the tokenizer and retraining from scratch — possible in principle, undocumented in practice.