laya-core 0.1.0

Tensor-free core for Laya typed decisions: prompt construction, routing signals, presets and calibration
Documentation

laya-core

The tensor-free core of laya-rs: everything on the CPU side of Laya typed decisions, with no candle dependency.

A gateway that only needs to decide where a request should go — or to build the prompt it would send — can depend on this crate without pulling in a GPU runtime.

What is in here

Module Purpose
prompt Sequence construction: prefixes, [MASK] option markers, state budgeting
question The Choice / Score / Noul question types and their parsing
lang Script detection and the Latin-script language guess
presets Upstream's built-in question presets
calibrate Post-hoc temperature calibration and confidence
email Quoted-history and signature stripping for email states
tokenizer Thin wrapper over tokenizers, with the special-token ids Laya needs

Parity

The tables in lang_tables.rs and preset_tables.rs are generated from the upstream Python package rather than transcribed by hand, and the crate is tested against reference fixtures produced by running that package. CI regenerates both and fails if they drift.

License

Apache-2.0. See NOTICE for attribution: upstream Laya is by Convai Innovations, and the MLX port this is based on is mizorewww/laya-mlx. Neither endorses this project.