← all repositories
sonos/tract

Sonos’ Rust inference engine trims the fat from neural-net deployment

tract exists to translate ONNX and NNEF models into self-contained, optimized runtimes small enough for embedded devices and browser tabs.

tract
Not currently ranked — collecting fresh signals.
star history

What it does

tract is Sonos’ Rust-based inference engine. It ingests models from ONNX, NNEF, and legacy TensorFlow formats, optimizes them, and executes them across CPUs, Apple Metal, NVIDIA CUDA, and WebAssembly. The project is battle-tested inside Sonos hardware for wake-word detection and streaming speech recognition, and also handles LLMs, stable diffusion, and computer vision.

The interesting bit

The real trick is pulsification: at build time, tract can rewrite a model that expects full sequences into one that processes fixed-size chunks, letting the same network do both batch inference and low-latency streaming without maintaining two versions. It then serializes the result to its NNEF-compatible tract-OPL format, so the runtime only needs a tiny core—no protobuf parsers, no TensorFlow imports, no ONNX baggage.

Key highlights

  • Runs on embedded ARMv6 through Apple Metal and NVIDIA CUDA, plus WebAssembly, using a shared internal representation.
  • Ships hand-rolled SIMD micro-kernels for x86 and ARM in the default CPU runtime.
  • Supports a Python API (PyPI) built atop the same Rust core.
  • Includes first-class pulsified streaming for real-time audio and speech workloads.
  • Offers a companion converter, torch-to-nnef, for skipping the ONNX detour from PyTorch.

Caveats

  • TensorFlow 2 is not directly supported; models must be converted to ONNX first.
  • The tract-OPL extension format is still somewhat in flux, though the underlying NNEF spec is stable.
  • Internal crates like tract-core are not a stable public API; only the top-level tract crate is guaranteed.

Verdict

Worth a look if you need to deploy models to resource-constrained or edge devices and want to leave Python dependencies behind. If you are married to TensorFlow 2 or need a training framework, this is not your tool.

Frequently asked

What is sonos/tract?
tract exists to translate ONNX and NNEF models into self-contained, optimized runtimes small enough for embedded devices and browser tabs.
Is tract open source?
Yes — sonos/tract is an open-source project tracked on heatdrop.
What language is tract written in?
sonos/tract is primarily written in Rust.
How popular is tract?
sonos/tract has 3k stars on GitHub.
Where can I find tract?
sonos/tract is on GitHub at https://github.com/sonos/tract.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.