Downloads · 30 days
0
MachadoDeCastro/krull-nano
krull-nano is a text generation model from MachadoDeCastro. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
KRULL means Knowledge Running Under Lightweight Language.
Downloads · 30 days
0
Access
Public
Updated May 21, 2026
Repo size
855 KB
Likes
0
Public
Click a slice to open those files.
.data364 KB · 40%
From the Hugging Face model README
KRULL means Knowledge Running Under Lightweight Language.
KRULL-Nano is a lightweight decoder-only Small Language Model (SLM) architecture designed for embedded devices, edge AI, offline inference, and privacy-preserving applications.
Unlike cloud-oriented LLMs optimized for massive datacenters, KRULL-Nano is designed from the ground up for:
KRULL-Nano uses a compact decoder-only transformer architecture with multiple optimizations for edge execution.
KRULL replaces LayerNorm with RMSNorm to:
Instead of full multi-head attention:
Benefits:
KRULL uses a gated FFN inspired by modern efficient transformer architectures.
Benefits:
krull_nano_simple/
├── krull/
│ ├── __init__.py
│ ├── model.py
│ └── tokenizer.py
├── scripts/
│ ├── train_tokenizer.py
│ ├── train_lm.py
│ ├── generate.py
│ └── export_onnx.py
├── configs/
│ └── krull_nano.json
├── data/
│ └── tiny_corpus.txt
├── artifacts/
├── requirements.txt
├── LICENSE
└── README.md
Open PowerShell or CMD:
cd C:\workspace\krull_nano_simple
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
cd krull_nano_simple
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python scripts/train_tokenizer.py --input data/tiny_corpus.txt --out artifacts/tokenizer.json
python scripts/train_lm.py --config configs/krull_nano.json --tokenizer artifacts/tokenizer.json --data data/tiny_corpus.txt --out artifacts/krull_nano.pt --epochs 10 --device cpu
python scripts/generate.py --model artifacts/krull_nano.pt --tokenizer artifacts/tokenizer.json --prompt "KRULL is" --device cpu
python scripts/export_onnx.py --model artifacts/krull_nano.pt --out artifacts/krull_nano.onnx
This repo is for learning and experimentation. The default dataset is tiny, so the generated text will not be intelligent. Replace data/tiny_corpus.txt with a larger corpus to train a better model.
MIT