A 14-Year-Old Trained the 326M Lyra LLM From Scratch on an 8 GB RTX 3060 Ti
On this page 9 sections
TL;DR
A 14-year-old in Serbia trained Lyra-326M, a 326M-parameter decoder-only language model, from random weights on 6.4B tokens using a single RTX 3060 Ti with 8 GB of VRAM. Pretraining took about 180 hours and 57 kWh of electricity, and every layer of the stack is public: the streaming data builder, the training loop, the fine-tune, both checkpoints, a terminal chat UI, and a ledger of the nine bugs that nearly killed the run. The repo passed 1,400 GitHub stars in under three days, and the two checkpoints have roughly 1,200 combined downloads on Hugging Face.
The build, in numbers
Lyra is a small, orthodox GPT: 24 layers, 16 attention heads, 1024 hidden width, a 1024-token context window, a 16,384-token SentencePiece vocabulary with byte fallback, RMSNorm, SwiGLU, QK-norm, scaled residuals, tied embeddings. Nothing exotic, which suits the goal: it is the shape of a modern LLM shrunk until one consumer card can carry it, so you can read the entire model in model.py in one sitting.
The pretraining run, PTL-1 in the technical docs, consumed 6.4B tokens over 195,312 steps at a sustained ~10,000 tokens per second and finished at a validation loss of 2.32 nats, a perplexity of 10.19. AdamW, 6e-4 peak learning rate with cosine decay to 6e-5, 32,768 tokens per optimizer step, bf16 autocast with fp32 master weights. The whole thing ran on the 8 GB card plus 32 GB of system RAM, with full activation checkpointing on every layer to fit.
Activation checkpointing is what makes the budget work: instead of keeping every intermediate result from the forward pass in memory for the backward pass, you drop them and recompute. It is doing your sums on a whiteboard you keep erasing, paying extra compute for memory you do not have.
Two phases, one card
Phase two, named Second Voice in the docs, turns the raw text completer into something conversational. Roughly 78,000 examples drawn from Tulu-3, OpenOrca, SciQ, DailyDialog, and Python-18k, plus a hand-built 1,000-example identity and honesty set released as CC0. Loss is masked to assistant tokens, so the model is never penalized for failing to predict the user's prompt. Three epochs at a 5e-5 peak learning rate.
The data diet
The pretraining mixture is 70% FineWeb-Edu, 20% Cosmopedia v2, 10% Python-Edu. If that looks familiar, those are the dataset families behind Hugging Face's SmolLM recipes, which the maker credits in the Show HN thread. He cooked a published recipe on hardware people already own, which is why anyone can repeat it.
The failure ledger is the best artifact in the repo
The nine-entry ledger in the docs is worth reading even if you never train anything. Entry one: the dashboard claimed a training loss of 35.2 while validation sat at 4.4, an 8x gap that looks exactly like a model on fire. The model was fine; the dashboard was the one hallucinating. The accumulator summed one mean loss per micro-step, eight per optimizer step, and the readout divided by optimizer steps only.
Entry two cost real compute. The --resume flag loaded the checkpoint with the best validation loss, which had gone stale during a flat stretch, and silently rewound the run by 20,000 steps, about 10 hours. The fix is a separate last.pt written every 500 steps regardless of metrics, with resume preferring it.
The rest is the standard gauntlet of small-scale training: CUDA graph collisions from PyTorch's torch.compile in max-autotune mode, a 134 MB fp32 tensor materialized by one manual .float() cast, a tokenizer regex that stopped splitting chat markers until the model emitted punctuation soup, and an SFT batcher with hundreds of unique sequence lengths that forced constant recompilation until lengths were snapped to six fixed buckets. One entry is almost flattering: at 1.5B tokens the base model declared, with full confidence, that the capital of France is Luxembourg. That is the expected stage where syntax arrives before facts bind, not a bug.
What Lyra can and cannot do
The maker's own HN description: the instruct model "handles simple questions and still confidently makes things up." At 326M parameters with 1024 tokens of context, that is the honest ceiling. It is also a custom architecture, so Hugging Face's transformers library will not load it; you use the provided model.py and chat.py, or grab Lyra-326M-base for the raw completer.
Licensing is split three ways: training code under Apache-2.0, the 1,000-example identity set under CC0, and the weights under CC-BY-NC-4.0 because the SFT mixture includes DailyDialog and non-commercial Tulu-3 subsets. Fork it and retrain it on your own card; the weights themselves cannot ship in a commercial product.
Why this matters for builders
The usual answers to how LLMs get made are a paper or a training report from a warehouse of GPUs. Lyra is a third answer: one repo where the data pipeline, training loop, fine-tune, and failure modes are small enough to hold in your head at once. The failure ledger alone would have saved plenty of adult teams a weekend, and the 57 kWh total puts the exercise within reach of anyone with a gaming card and a free week.
Adoption moved fast for a three-day-old repo: 1,410 stars and 145 forks on GitHub by December 5, coverage in newsletters like AlphaSignal, and a compatriot in the HN thread asking, in Serbian, whether Luka's parents could call him to discuss collaboration. Internet stardom is arriving before the learner's permit.
Caveats
- Every performance figure here is self-reported in the README and docs; nobody independently metered the wall socket. The docs say 178 hours, the README "about 180," so treat wall-clock as approximate.
- The age and location come from the maker's own README, repeated by secondary coverage; there is no independent verification.
- Lyra is an educational model: it hallucinates by its maker's account, holds only 1024 tokens of context, and its weights carry a non-commercial license.
- Stars and download counts are December 5 snapshots and will keep moving.
Key Takeaways
- Lyra-326M is a 326M-parameter decoder-only LLM pretrained from random weights on 6.4B tokens, on one 8 GB RTX 3060 Ti, in about 180 hours and 57 kWh.
- The whole pipeline is public: streaming data builder, pretraining loop, SFT stage, both checkpoints, chat UI, and technical docs, under Apache-2.0 code with CC-BY-NC-4.0 weights.
- The data recipe is deliberately unoriginal: 70% FineWeb-Edu, 20% Cosmopedia v2, 10% Python-Edu, the same families as the SmolLM recipes.
- The nine-bug failure ledger, from dashboard loss math to stale resume checkpoints to SFT shape thrashing, is the most reusable part of the project.
- Traction in under three days: 1,410 stars, 145 forks, roughly 1,200 checkpoint downloads.
- The instruct model still "confidently makes things up"; the takeaway is the readable pipeline, not chat quality.
Sources: Lyra GitHub repository, Lyra technical documentation, Show HN thread, Lyra-326M-Instruct model card, Lyra-326M-base model card, AlphaSignal.