{"name":"Lyra: Train and Run a 326M Decoder-Only Transformer","description":"Lyra-326M is a decoder-only Transformer trained from scratch on 6.4B tokens, with pretraining, fine-tuning, and terminal inference code. It suits people studying or adapting small language models, but its instruct weights are non-commercial and the project is very new.","github":"https://github.com/luka0x12/Lyra","url":"https://osrepos.com/repo/luka0x12-lyra","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/luka0x12-lyra","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/luka0x12-lyra.md","json":"https://osrepos.com/repo/luka0x12-lyra.json","topics":["python","llm","machine-learning","terminal","decoder-only-transformer","language-model-training","supervised-fine-tuning"],"keywords":["python","llm","machine-learning","terminal","decoder-only-transformer","language-model-training","supervised-fine-tuning"],"stars":null,"summary":"Lyra-326M is a decoder-only Transformer trained from scratch on 6.4B tokens, with pretraining, fine-tuning, and terminal inference code. It suits people studying or adapting small language models, but its instruct weights are non-commercial and the project is very new.","content":"## Overview\n\nLyra is a 326M-parameter decoder-only Transformer trained from scratch on 6.4B tokens. The repository provides the pipeline for streaming data, pretraining, supervised fine-tuning, and chatting with the resulting models in a terminal. The project reports training on a single NVIDIA RTX 3060 Ti, while users can download the base or instruct weights from [Hugging Face](https://huggingface.co/luka0x12/Lyra-326M-Instruct) rather than train their own.\n\nIts value is as a compact, end-to-end example of building and running a language model under limited hardware constraints. It is aimed at learners and experimenters who want to inspect the training process, not teams seeking a mature, broadly supported inference service.\n\n## Key Features\n\n- Custom decoder-only GPT architecture with RMSNorm, SwiGLU, QK-norm, and residual scaling.\n- Streaming pretraining data builder with crash-safe handling and zero-copy memory mapping.\n- Pretraining loop with a terminal dashboard and VRAM management.\n- SFT data preparation and training, including assistant-only loss masking and length-bucketed batches.\n- Terminal chat interface with live context gauges, plus one-shot text generation for the base model.\n- Export tooling for safetensors and a technical architecture write-up with a failure ledger.\n\n## Use Cases\n\n- A student or hobbyist can study how a small decoder-only model is trained and fine-tuned from scratch.\n- A researcher can use the code as a starting point for experiments with data mixtures, model architecture, or SFT.\n- A developer with compatible hardware can try the downloadable instruct model through the included terminal chat interface.\n- An educator can demonstrate practical training constraints and debugging lessons from a single-GPU project.\n\n## Our Take\n\nLyra is a useful learning and experimentation project, but its newness and concentrated maintenance make it a poor choice for production reliance.\n\n**Good fit if:**\n- You want to inspect or adapt a complete small-model training and SFT pipeline.\n- You can use the instruct weights for non-commercial purposes under their CC-BY-NC-4.0 license.\n- You are comfortable with a very new project whose recent activity comes mostly from one contributor.\n\n**Look elsewhere if:**\n- You need a mature project with a release history, CI, or an established test suite.\n- You need commercially usable instruct weights.\n- You need a supported production inference service rather than a terminal chat tool and model code.\n\n## Project Health\n\n| Signal | Value |\n|---|---|\n| Status | **New**: less than six months old |\n| Last commit | 2026-12-03 (today) |\n| Commits, last 90 days | 12 |\n| Releases, last 12 months | 0 |\n| Contributors | 2 (top contributor: 58% of commits) |\n| Issues closed, last 90 days | 0 |\n| Pull requests merged, last 90 days | 1 |\n| Project age | 1 days |\n\nChecked on 2026-12-04 with the GitHub API.\n\n## Project Facts\n\n- Language: Python\n- License: Apache-2.0\n- Stars: 560\n- Forks: 61\n- Archived: no\n\n## What You Need\n\nDetected in the repository:\n\n- Python (main language on GitHub)\n\n## Getting Started\n\nTo use the instruct model, follow the repository's Hugging Face-based setup:\n\n```bash\ngit clone https://huggingface.co/luka0x12/Lyra-326M-Instruct\ncd Lyra-326M-Instruct\npip install torch sentencepiece safetensors numpy\npython chat.py\n```\n\nSee the [GitHub repository](https://github.com/luka0x12/Lyra) for training details and documentation.\n\n## License in Plain Words\n\n**Apache-2.0** (permissive).\n\n- Commercial use: yes\n- Modify and redistribute: yes\n- You must keep: the license, the NOTICE file and a note of your changes\n- Share your changes: no\n- Includes an explicit patent grant from the contributors\n\nA summary, not legal advice: the LICENSE file is what applies.\n\n## Alternatives\n\n- [Qwen3](https://osrepos.com/repo/qwenlm-qwen3): Qwen3 offers open-weight models for inference and fine-tuning rather than a small model training-from-scratch project.\n- [Qwen](https://osrepos.com/repo/qwenlm-qwen): Qwen provides pretrained model checkpoints and workflows for inference and adaptation, rather than Lyra’s from-scratch training focus.\n\n| Project | Language | License | Stars | Status |\n|---|---|---|---|---|\n| **Lyra** | Python | Apache-2.0 | 560 | New |\n| [Qwen3](https://osrepos.com/repo/qwenlm-qwen3) | Python | – | 27.7k | Quiet |\n| [Qwen](https://osrepos.com/repo/qwenlm-qwen) | Python | Apache-2.0 | 21.9k | Quiet |\n\n## Considerations\n\nThe project is less than six months old and has no releases yet. Recent commits show active development, but only two contributors are recorded and most contributions come from one person; issue closure data is not yet available. The repository also reports no CI or tests, so adopters should validate changes and behavior themselves.\n\nTraining was performed on an RTX 3060 Ti with 8 GB of VRAM and took about 180 hours. The README's local-use instructions focus on downloading weights, but do not specify a general hardware requirement for inference. Licensing differs by artifact: code is Apache-2.0, the custom identity dataset is CC0, and the weights are CC-BY-NC-4.0. The README says the SFT mixture includes datasets with non-commercial restrictions, so the final weights are not suitable for commercial products.","metrics":{"detailViews":1,"githubClicks":0},"dates":{"published":null,"modified":"2026-12-04T00:40:25.000Z"}}