Small assistants (~40M and ~150M parameters on the 32k tokenizer lineage) trained end-to-end with PyTorch — custom BPE tokenizer, transformer decoder architecture, pretraining, a format stage and SFT, no pretrained backbone. The previous 1.0 generation (34M/70M, 16k tokenizer) is documented in the archive section of the architecture page.
Training runs on NVIDIA GPUs (CUDA).
The 150M 1.1 (models/digit32k/) is the current cloud recipe: digit-split
tokenizer, 2048-token context, system-prompt format, a format stage before SFT,
arithmetic / date following / markdown / multi-turn SFT, ~7B-token pretraining
budget — see
training and
cloud GPU.
Training scale translates directly into output quality: base val loss drops from 3.030 (70M, ~1.4B tokens) to 2.941 (150M, ~4.5B tokens) — larger models are markedly more fluent and better formatted. Conformance and factual accuracy are tracked continuously with the evaluation suite, which runs from this repository once a checkpoint exists.
Full documentation: Petal documentation
Requires uv and Python 3.11+.
git clone https://github.com/Chloris-Lab/Petal
cd Petal
uv sync
uv run prep # tokenizer + data
uv run pretrain 300 # short smoke run
uv run sft 1
uv run chat
The Python package is petal; mini_llm remains importable as a compatibility alias.
Old checkpoints named mini-llm-* are still found by checkpoint resolution.
On the Linux GPU server, cloud/run.sh eval evaluates the freshly trained assistant
against the reference models; nothing to pull or configure.
To speed up Hugging Face downloads, create a free token and export it before running
prep or sft: export HF_TOKEN=....
Full training runs go through the cloud GPU workflow — see Cloud GPU. Everything else — architecture, checkpoints, data sources, Hugging Face export, design notes — lives in the documentation.