Downloads · 30 days
0
ajaxdavis/kuku-dambun
kuku-dambun is a machine learning model from ajaxdavis. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
A character-level Transformer language model, trained and sampled by a single statically-linked 32-bit ELF that was assembled by a self-hosted compiler for a tiny stack language called kuku.
Downloads · 30 days
0
Access
Public
Updated Apr 19, 2026
Repo size
268 KB
Likes
0
Public
Click a slice to open those files.
.kuku-gpt-model268 KB · 40%
From the Hugging Face model README
A character-level Transformer language model, trained and sampled by a single statically-linked 32-bit ELF that was assembled by a self-hosted compiler for a tiny stack language called kuku.
No Python. No C. No libc. No imports. No pretrained anything. Just
Linux int 0x80 syscalls, x87 FPU doubles, and ~1,750 lines of source
that compile down to a 32 kB ELF.
Upstream: github.com/australia/kukuos.
| file | size | what it is |
|---|---|---|
ngunnga.kuku | 44 KB | source of the kuku compiler (self-hosting) |
ngunnga | 24 KB | the compiler, as a 32-bit Linux ELF |
dambun.kuku | 61 KB | source of the GPT |
dambun | 32 KB | the GPT, as a 32-bit Linux ELF |
dambun.kuku-gpt-model | 262 KB | trained weights (4,192 params, FP64) + Adam state |
names.txt | 222 KB | training corpus — 32,032 lowercase names |
Identical shape to Karpathy's minGPT / microGPT:
vocab_size = 27 — 26 lowercase letters + BOSn_embd = 16n_layer = 1n_head = 4, head_dim = 4block_size = 16lm_headValue cells)Built from the FPU up: a 48-byte Value struct with .data, .grad,
.child1/2, and local gradients; a topologically-sorted reverse pass
driven by bana-@/bana-! FPU loads/stores; a bump allocator for the
per-step graph; Gaussian init via Box–Muller seeded from /dev/urandom.
The binaries are 32-bit x86 ELFs built for Linux. On a 64-bit host you
need IA32 emulation enabled (CONFIG_IA32_EMULATION=y, default on
Ubuntu). On most modern distros this just works; no sudo apt install
needed.
chmod +x ngunnga dambun
./dambun binalku names.txt
Command: binalku means "remember/learn" — this is the training subcommand.
Argument: a path to a text file with one lowercase name per line
(26-letter alphabet; uppercase and other characters are tokenised as
BOS). We ship names.txt (32k US first names, the standard
makemore/minGPT benchmark).
What it does:
/dev/urandom.Value cells in the persistent params pool and
Gauss-initialises them with std 0.08.names.txt and reads it into memory.N training steps (default 100), takes the next line, tokenises
[BOS, c₁, …, cₙ, BOS], runs one forward + backward + Adam step.warri {step} birru*1000 {loss × 1000} to stdout.{params, Adam m, Adam v} to
/tmp/dambun.kuku-gpt-model as a flat 262 KB blob of IEEE-754 doubles.Expected output on names.txt:
bana mana, binalku jakalbaku...
warri 0 birru*1000 3296
warri 10 birru*1000 1879
warri 20 birru*1000 1412
...
warri 90 birru*1000 1006
bayan balkal kunbayn.
Cross-entropy falls from ≈ log(27) = 3.30 to about 1.01 in 100 steps at the default lr = 1e-3. Wall clock on one x86 core: ≈ 1 s.
To change the step count or hyper-parameters: they're compiled
into the binary. Edit dambun.kuku (100 binalku-narmba near the
bottom; kuku-lr near the top) and recompile with ./ngunnga --bama dambun dambun.kuku.
If you already have the trained weights in this folder, skip
training: cp dambun.kuku-gpt-model /tmp/ and jump to inference.
./dambun balkalaway
Command: balkalaway means "let us speak together" — inference.
Prerequisite: /tmp/dambun.kuku-gpt-model must exist (either from
binalku above or copied from this folder).
What it does:
/dev/urandom.Value arena and loads weights from disk.dambun.kuku to change).[BOS] at position 0.BOS is produced again, or after 16 characters.BOS markers) and a newline.Expected output (with the trained model that ships in this repo):
lauosvzlu
llllfka
llt
llab
lllllalkmll
...
A 4,192-parameter model on a character-level task with single-example SGD produces character bigrams, not English names. This is a faithful port of a tiny teaching model; the training loss curve and the sampling mechanics are what's being demonstrated.
./dambun ngana-warri
Runs gradient descent on f(x) = (x − 3)² starting at x = 0 for
3,000 steps. Should print:
ngana-warri: jakalbaku x * 1000 = 0
ngana-warri: kunbayn x * 1000 = 3000
i.e. x starts at 0 and converges to 3.0 (printed × 1000 because the
built-in number printer is integer-only). If this doesn't produce
3000, something is wrong with your floating-point setup before you
even get to the Transformer.
# 1) Rebuild the compiler (self-host).
./ngunnga --bama ngunnga-new ngunnga.kuku
chmod +x ngunnga-new
# ngunnga-new should byte-compile identically to ngunnga.
# 2) Rebuild the GPT.
./ngunnga-new --bama dambun-new dambun.kuku
chmod +x dambun-new
--bama means "produce a Linux ELF." Without the flag the compiler
emits a bare-metal kernel ELF for the kuku-os boot target.
| word | role |
|---|---|
balkalaway … kunbayn | function definition / end |
yabarrka / janay | loop / break |
yala / yinya | if / else |
kujil / wuljil / wundil | dup / drop / swap (data stack) |
muru / dumbarril | int add / subtract |
bana-* | f64 (FPU) variants: bana-muru, bana-*, bana-/, bana-sqrt, bana-log, bana-exp, … |
@ / ! | load / store (int); bana-@ / bana-! load/store FP64 |
binalku | training subcommand |
balkalaway (as subcommand) | inference subcommand |
jurra | softmax |
jalkar | RMSnorm |
miyil | attention |
dukurr | Adam optimiser |
wumba | RNG |
bayan | the model |
bana | floats |
MIT.