Atome LM
A reference implementation of a ternary-weight tiny language model with a bit-exact Python-to-C99 inference engine, sized to run inside a microcontroller's RAM budget.
Atome LM combines three published ideas into one integration: ternary weights following BitNet b1.58, a hybrid state-space, sparse-attention and local-convolution block routed per token following Hymba and MossNet, and a byte tokenizer at very small scale. The repository provides a complete path from training through ternary export, base-3 weight packing, and a C99 inference engine, with bit-exact parity between the Python and C implementations enforced by tests.
A default 60K-parameter model can be trained from the included script in roughly 30 minutes on a CPU, or a bundled 944K-parameter checkpoint can be run immediately; the README describes that checkpoint as a narrow, sometimes-incoherent research demo meant to show the architecture runs, not a quality benchmark. Its QEMU ARM Cortex-M3 emulation matches FP32 to the expected precision, and the project also demonstrates real hardware inference on a physical ESP32-WROOM-32 board.
Training code, the C inference engine, benchmarks and trained weights are released under Apache-2.0; a separate paid secure-boot integration package is offered outside this repository.