lele
Library Listed
Bare-metal machine learning inference library in Rust
- Downloads
- 132
- Dependents
- 1
- Stars
- 183
- Forks
- 15
- Contributors
- 2
- Commits
- 336
- Latest release
- 0.2.0 ·
About
Bare-metal ONNX inference engine in pure Rust.
lele compiles ONNX graphs ahead of time into specialized Rust code and a single weights blob, then runs them with tuned kernels and no runtime dependencies: no interpreter, no ONNX parser at runtime, no C++.
- Ahead-of-time: graph traversal, fusion, buffer allocation and dispatch are resolved at build time. Each node becomes a direct function call.
- One SIMD source: the
fearless_simdkernels compile to NEON (including int8 dot products), AVX2/FMA, AVX-512 and WASM SIMD128, with scalar fallbacks tested on every target. - Quantization: static QDQ, dynamic int8, weight-only int8 and f16 weights.
- Small deployment: with
default-features = falseyou ship only the generated code and the weights; the ONNX parser is left out.
Upgrading from 0.1.x: 0.2.0 moves the generated-code runtime into
lele::runtimeand changes parts of the compiler API. Regenerate your models with the matching compiler version.
Read the full README
Models
| Domain | Model | Task |
|---|---|---|
| ASR | SenseVoice Small | Multilingual speech recognition (int8) |
| ASR | Whisper (base, int8) | Multilingual ASR, encoder/decoder with KV cache |
| ASR | T-one | Streaming Russian telephony ASR (8 kHz, CTC) |
| VAD | Silero VAD, FireRedVAD | Streaming voice activity detection |
| TTS | Supertonic 2 / 3 | 5 / 31 languages, expression tags |
| TTS | Hojo-TTS-Light | Bilingual ZH/EN voice cloning (0.08B token LM) |
| TTS | MOSS-TTS-Nano | End-to-end neural TTS with int8 GEMV |
| Vision | Yolo26, Yolo26n-Seg | Object detection, instance segmentation |
| OCR | PP-OCRv6_tiny | Text detection + recognition |
All of the above also run in the browser via WebAssembly.
Performance
Reference measurements, single thread, Apple M2 Pro, against ONNX Runtime (CPU,
intra_op_num_threads=1, inter_op_num_threads=1). Speech models use
steady-state RTF (warmup plus multi-run average); lower is better.
| Model | ORT | lele | Speedup |
|---|---|---|---|
| Silero VAD | RTF 0.002882 | RTF 0.0022 | 1.31x |
| SenseVoice | RTF 0.0294 | RTF 0.0256 | 1.15x |
| Supertonic 2 | RTF 0.1667 | RTF 0.0550 | 3.03x |
| Yolo26 | 704.50 ms | 534.97 ms | 1.32x |
| Yolo26n-Seg | 126.51 ms | 64.82 ms | 1.95x |
| Hojo-TTS-Light | RTF 8.75 | RTF 6.69 | 1.31x |
| MOSS-TTS-Nano | RTF 0.376 | RTF 0.293 | 1.28x |
| PP-OCRv6 DET | 47.78 ms | 46.83 ms | 1.02x |
| PP-OCRv6 REC | 2.94 ms/region | 2.33 ms/region | 1.26x |
Kernel-level benchmarks: cargo bench --bench kernels.
Quick start
# Cargo.toml
[dependencies]
lele = "0.2"
Generate from a build script (recommended)
# model.toml
[model]
source = "hf-hub"
repo = "your-org/your-model"
files = [{ file = "model.onnx" }]
[codegen]
class_name = "MyModel"
// build.rs
fn main() -> lele_build::Result {
// Downloads the model and writes src/mymodel.rs and
// src/mymodel_weights.bin unless they are up to date.
lele_build::build_model("model.toml", "src")
}
let weights = std::fs::read("src/mymodel_weights.bin")?;
let model = MyModel::new(&weights);
let output = model.forward(input);
build_models handles several models from one model.toml. HF_ENDPOINT
selects a mirror; LELE_SKIP_MODEL_GEN=1 skips generation and
LELE_FORCE_REGEN=1 forces it. A download or codegen error fails the build.
Or use the CLI
cargo install --git https://github.com/miuda-ai/lele --bin lele_gen
lele_gen model.onnx src/ MyModel
This writes src/mymodel.rs and src/mymodel_weights.bin. --shape input=1,512, --dim batch_size=1 and --value sr=16000 compile the model for
fixed inputs (see below).
Compiler
The compiler builds a typed IR and runs its passes on it: constant and shape folding, dead-code and common-subexpression elimination, operator fusion and buffer allocation. Fusions include activations into convolutions and products, SwiGLU feed-forwards, RMSNorm, ScaleNorm pairs, rotary embeddings, SimAM, Snake, QDQ pairs around integer matmuls, and fused quantized linears.
Fixed inputs let it fold more and size the workspace up front:
[codegen.shapes] # input shapes by name
input = [1, 512]
state = [2, 1, 128]
[codegen.dims] # named symbolic dimensions
batch_size = 1
[codegen.values] # inputs compiled in as constants
sr = 16000
The same settings exist on the Compiler builder (with_input_shape,
with_dim, with_input_value). When every shape is known,
<Model>Workspace::BYTES is the exact workspace size.
Models that share weights (e.g. a prefill and a decode step of the same
transformer) can share one weights file with Compiler::with_shared_weights.
Extending it
use lele::compiler::{Compiler, Optimizations};
let compiler = Compiler::new()
.with_name("MyModel")
.with_default_optimizations()
.with_pass_before_fusion(|graph| { /* rewrite the IR */ })
.with_override("MyCustomOp", |codegen, w| {
// Emit Rust code for this operator.
Ok(())
});
// Pick optimizations individually:
let compiler = Compiler::new().with_optimizations(Optimizations {
operator_fusion: false,
..Optimizations::all()
});
Examples
./run_sensevoice.sh # SenseVoice ASR
./run_silero.sh # Silero VAD
./run_supertonic.sh # Supertonic 2 TTS
./run_supertonic3.sh # Supertonic 3 TTS
./run_yolo26.sh # Yolo26 detection
./run_yolo26n_seg.sh # Yolo26n-Seg segmentation
./run_hojo_tts.sh "text" # Hojo-TTS-Light voice cloning
cargo run --release -p ppocr-example -- image.png
cargo run --release -p fireredvad-example -- in.wav
cargo run --release -p tone-example --bin tone -- in.wav
cargo run --release -p whisper-example --bin whisper -- in.wav --lang en
The browser demo (ASR, TTS, detection, segmentation) lives in
examples/web-demo; see its README.
Supported ONNX operators
70+ operators, including:
- Math: Add, Sub, Mul, Div, Mod, Pow, Sqrt, Neg, Exp, Log, Sin, Cos, Erf, Clip, Round, CumSum, Max, Range, Einsum (partial)
- NN: Conv, ConvTranspose, ConvInteger, Gemm, MatMul, MatMulInteger, LSTM, GRU, BatchNormalization, InstanceNormalization, LayerNormalization, MaxPool, AveragePool, GlobalAveragePool, Resize
- Activation: Relu, LeakyRelu, Elu, Sigmoid, Tanh, HardSigmoid, PRelu, Softmax, LogSoftmax, ArgMax, IsNaN
- Tensor: Reshape, Transpose, Concat, Split, Slice, Gather, GatherElements, ScatterND, ScatterElements, Pad, Expand, Tile, Where, TopK, Trilu, Flatten, Squeeze, Unsqueeze
- Reduction: ReduceSum, ReduceMean, ReduceMax, ReduceL2
- Comparison / logic: Equal, Less, Greater, LessOrEqual, GreaterOrEqual, And, Or, Xor, Not
- Quantization: DynamicQuantizeLinear, QuantizeLinear, DequantizeLinear, QLinearMatMul, FakeQuantize
- Control flow / signal: If, STFT
- Other: Shape, Size, Cast, Constant, ConstantOfShape, Identity
Loop is not supported. SiLU is fused into its sigmoid and multiply.
Architecture
ONNX model ──▶ lele-build ──▶ Compiler ──▶ <model>.rs + <model>_weights.bin
(download, (typed IR, (pure Rust, no runtime deps)
cache) folding, │
fusion, ┌────────┼────────┐
allocation) ▼ ▼ ▼
Native WASM Embedded
(NEON/AVX) (SIMD128)
License
MIT
Compatibility
- Runs on
- GPU support unknown
What shows it
- no dependency or feature matches a backend row
- Native code
- None found
- No native code found
- Python bindings
- No Python binding crate found
- License
- MIT
Compare with similar projects
Order: strongest tier first, then most downloads, then name, with unmeasured values last. A library counts downloads over 30 days. An app counts binary downloads per release. An app with none counts its crate downloads over 30 days. ML Rust runs this catalogue, so its closest project always gets a row.
| Project | Downloads | Dependents | Stars | Latest release | Runs on (GPU) | Native code | License |
|---|---|---|---|---|---|---|---|
|
Bare-metal machine learning inference library in Rust |
132 downloads over 30 days | 1 | 183 | 0.2.0 | GPU support unknown | No native code found | MIT |
|
ort Featured
A safe Rust wrapper for ONNX Runtime 1.31 - Optimize and accelerate machine learning inference & training |
3,902,768 downloads over 30 days | 694 | 2,611 | 2.0.0-rc.15 | CUDA, WebGPU, ROCm | Binds native code: onnxruntime, ort-sys. Build uses a native toolchain: pkg-config (feature pkg-config) | Apache-2.0 OR MIT |
|
rten Featured
Tensor library for the RTen machine learning runtime |
496,924 downloads over 30 days | 29 | 360 | 0.27.0 | GPU support unknown | No native code found | Apache-2.0 OR MIT |
|
Generate music based on natural language prompts using LLMs running locally |
7,531 binary downloads per release | Not applicable | 1,471 | 0.3.27 | CUDA | Binds native code: alsa-sys, openssl-sys, ort-sys | MIT |
|
Inference server for LLMs, speech and embeddings: OpenAI-compatible routes with streaming, plus speech synthesis (TTS) and transcription (ASR). Serves Llama, Mistral, Qwen, Mamba2, MLA+MoE and hybrid models from SafeTensors, AWQ, GPTQ and GGUF. |
8 binary downloads per release | Not applicable | 7 | 0.7.1 | CUDA, WebGPU | Binds native code: ring (feature distributed) | Apache-2.0 |
|
Machine Learning Inference Framework and Server Runtime Python bindings |
0 downloads over 30 days | 0 | 153 | 0.2.3 | GPU support unknown | No native code found | MIT |
All projects in Run and serve modelsAll projects in Speech and audio
Why ListedNo archive, New or Featured rule places it, so it is Listed.
What it lacks for Featured
- It has 0 active dependents and 0 new dependents in 365 days. Featured needs 11 active dependents or 9 new dependents in 365 days. The repository route reads 183 stars, 15 forks and 2 contributors. It needs 4,539 stars, 434 forks and 79 contributors together.
What else the check found
- The last activity is on 5 Nov 2026, 4 days ago. The rules expect an update within 365 days. Dormancy rule
Exact rules: Listed, Featured library. The check on applied thresholds version 9.
Every rule outcome, as the check records it
expected-interval: version 0.2.0 base 80, raised to the 365-day floor: E = 365 daysdormancy: last activity 2026-11-05, 4 days ago, E = 365: activefeatured: not featured: active_users 0 < 11 and new_adopters 0 < 9 and repository route stars 183 (needs 4539), forks 15 (needs 434), contributors 2 (needs 79)listed: listed: no archive, new or featured rule applies
Measurements and sources
Each signal row shows the raw value, its source and the fetch date. The Sources list gathers every distinct source on this page. Movement needs more history.
Sources6 sources
- Description: the crates.io description
- crates.io database dump, fetched
- RustSec advisory database, fetched
- GitHub repository, fetched
- crates.io package, fetched
- GitHub contributors, fetched
Adoption0 active dependents, 0 new dependents in 365 days1 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Active dependents | 0 | crates.io database dump | Yes | |
| New dependents (365 days) | 0 | crates.io database dump | Yes | |
| Peak active dependents | 0 | crates.io database dump | Yes | |
| Active dependents as a share of the peak | 1 | crates.io database dump | Yes | |
| Binary downloads per release | Not measured | Yes |
MaintenanceLatest human commit: 4 days ago3 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Latest human commit | 2026-11-05 | GitHub repository | Yes | |
| Latest release | 2026-11-05 | crates.io database dump | Yes | |
| First release | 2026-01-29 | crates.io database dump | Yes | |
| Latest version | 0.2.0 | crates.io database dump | Yes | |
| Days the oldest outside issue waits for a reply | 146 | GitHub repository | Yes | |
| Maintainer replies over 365 days | 0 | GitHub repository | Yes | |
| Repository archived | false | GitHub repository | Yes | |
| Repository gone | false | GitHub repository | Yes | |
| Release commit or manifest in the repo | true | crates.io package | Yes | |
| Published docs | true | crates.io database dump | Yes | |
| Latest release fails cargo check | Not measured | Yes | ||
| Build check date | Not measured | Yes | ||
| Build check toolchain | Not measured | Yes |
SecurityUnpatched vulnerabilities: none
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Unpatched vulnerabilities past the grace window | none | RustSec advisory database | Yes | |
| RustSec unmaintained advisory | none | RustSec advisory database | Yes | |
| Deprecation notice | none | crates.io database dump | Yes | |
| Deprecated requirement | none | crates.io database dump | Yes |
Distribution15 releases, 132 downloads over 30 days5 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Releases | 15 | crates.io database dump | Yes | |
| Downloads over 30 days | 132 | crates.io database dump | Yes | |
| Binary downloads over the last 3 releases | Not measured | Yes | ||
| Homebrew installs on request over 365 days | Not measured | Yes | ||
| Repology repository families | Not measured | Yes | ||
| Docker pull growth over 90 days | Not measured | Yes | ||
| Docker pulls at the growth baseline | Not measured | Yes | ||
| Every version a prerelease | false | crates.io database dump | Yes | |
| Every version 0.0.x | false | crates.io database dump | Yes | |
| Every version yanked | false | crates.io database dump | Yes | |
| Crate deleted from crates.io | false | crates.io database dump | Yes |
Repository183 stars, 15 forks, 2 contributors, 336 commits. Stars alone never qualify a project.
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| GitHub stars | 183 | GitHub repository | Yes — one part of the repository route | |
| GitHub forks | 15 | GitHub repository | Yes — one part of the repository route | |
| Contributors with a GitHub account | 2 | GitHub contributors | Yes — one part of the repository route | |
| Commits on the default branch | 336 | GitHub repository | No | |
| Repository's main crate left out of the entry | none | crates.io database dump | Yes |
Facts that never count
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| License | MIT | crates.io database dump | No | |
| Runs on, from listed crates and their direct dependencies | GPU support unknown | crates.io database dump | No | |
| What shows each backend | no dependency or feature matches a backend row | crates.io database dump | No | |
| Native code, from listed crates and their dependencies | No native code found | crates.io database dump | No | |
| Python bindings, from direct dependencies of listed crates | No Python binding crate found | crates.io database dump | No | |
| Crates that depend on a listed crate directly | 1 | crates.io database dump | No |
Corrections and review history
No correction applies to this entry.
Judgments
A judgment enters only through an approved issue and a merged pull request.
No judgment applies to this entry.