laya-zig: a from-scratch, dependency-free Zig CPU runtime for Laya
Tokenizer, mmBERT-base encoder and decision head in one binary for the 322M multilingual checkpoint. No Python, torch or BLAS; forward pass checked against a reference.
Author calls it about two hours of work and a work in progress.
# laya-zig — a pure-Zig CPU runtime for the Laya decision model **English** | [简体中文](README.zh-CN.md) > ### Status: work in progress > > This is about **two hours of work**, from "can this model run outside Python?" > to a working port. It runs end to end and the forward pass is checked against an > independent reference implementation, and it has had one serious performance > pass (see *Measured* — a Snake decision costs ~200 ms on a laptop CPU), but > treat it as a **half-finished project**: expect rough edges and missing > features. It has not been used in anything real. > > Issues, corrections and pull requests are welcome. A from-scratch Zig runtime for the [Laya](https://github.com/NandhaKishorM/laya) System-1 decision model (`convaiinnovations/laya-multilingual`, 322M). No Python, no torch, no BLAS: it reads `model.safetensors` directly and runs the whole forward pass — tokenizer included — on the CPU, in a single process. It ships with a CLI, a local browser UI, and a Snake probe that measures what a zero-shot decision model actually does on a task it was never trained for. ## What this is Laya is a **System-1 decision model**: one forward pass, non-autoregressive, no text generation. You give it a state (text, JSON, or a conversation) and typed questions, and it returns option probabilities directly — nothing to parse, nothing to hallucinate. The reference implementation is Python (`pip install laya`); the model and its training come from [Convai Innovations](https://github.com/NandhaKishorM/laya). This repository is an independent **Zig re-implementation of the same weights**, aiming at a single dependency-free binary that reads 614 MB of weights and starts answering in about half a second, offline. ## Highlights - **No dependencies** — no torch, nump