Learn/Digital FreedomOpen Source

AI on the Edge: The Rust Stack That Keeps Cameras and Microphones at Home

AI on the edge fails when the runtime is Python, ONNX or C. Here is the Rust pipeline that decodes, hears, reads and detects on a family machine, and what it cannot do yet.

Signed by M·
Single-board edge computer beside a compact USB camera and desktop microphone on a brushed metal workbench in soft window light
What does it take to run AI on the edge at home without a cloud?

AI on the edge needs every stage of the pipeline to fit on the device: opening the media, hearing speech, reading text and detecting objects. The Remade with Rust crates rebuild those stages in memory-safe Rust, so a home computer or a browser tab can run them with no Python runtime and no C toolchain.

Most "smart" home devices are only smart in a data center. The doorbell that spots a person streams the frame to its maker first. The speaker that understands you sends your voice to a speech API. The models involved are often small enough to run locally; what stops them is the runtime around them. Python wheels, ONNX Runtime, libavcodec, Tesseract and CUDA userland are a lot to install on a small box, and most of it is C or C++ handling untrusted input.

AI on the edge, in the MATA sense, means the opposite arrangement: the camera frame and the voice clip are processed on a machine the family owns, and only the result, if anything, travels. The crates that make that practical are catalogued at Remade with Rust, and the wider reasoning is in rebuilding the foundation of the internet. This page walks the pipeline stage by stage, with the measured numbers and the gaps.

Why the Runtime Is the Hard Part

Three things break edge projects. The first is weight: an object detector that needs Ultralytics plus PyTorch turns a small home server into a miniature data center. The second is language. Media decoders and document parsers written in C are where the NIST Secure Software Development Framework points when it talks about memory safety, and home devices are among the least-patched computers anyone owns. The third is the trust boundary. If a frame went to a hosted API, the processing was not local, whatever the box says.

For a household, those map onto the three primitives of digital freedom. Trust means the bytes stayed in the house. Security means the code that parses them is memory-safe. Incentive means the crates are permissively licensed, so a builder can ship them without a copyleft surprise; model weights keep their own licenses and the engines surface them. The EFF has written for years about "on-device" claims that fall apart because a helper still phones home. A pipeline built from these crates makes the claim checkable.

The Pipeline, Stage by Stage

A camera or microphone produces a stream. Before any model sees it, the stream has to be opened and decoded. Then come hearing, reading, describing and detecting.

Opening the Media in Rust

That first step is usually FFmpeg, decades of C with a long CVE record. remade_ffmpeg_rs is the clean-room Rust rebuild for decode, encode, transcode, mux and probe. Still images go through rusty_jpeg and rusty_png, audio through rusty-opus and FLAC, and video through H.264, AV1 and research AV2 paths. On a doorbell or a kitchen tablet this is the difference between processing the camera and uploading it: decode has to happen next to the sensor.

Hearing and Speaking

Speech is the most sensitive signal a home device collects. Mercury is OpenAI's Whisper model rebuilt in pure Rust on candle: mel spectrogram, tokenizer, decoder and AVX2 kernels, with no Python by default. Today it ships tiny.en and base.en with greedy decoding; larger models and beam search are listed as next. That covers voice notes and simple commands in English. Text-to-speech sits on the same FFAI surface, so a device can answer out loud without a hosted voice.

Reading, Describing and Detecting

Carmenta reads text from documents, screens and frames, on 4.7 MB of detector weights; photographed receipts are its weak spot. Argus, inside FFAI, turns an image into a caption a later step can store or search. Diana runs YOLO26 at 121 MiB of steady memory against 310 MiB for Ultralytics, with the same 0.7014 mAP50 on its COCO holdout and ByteTrack for following an object across frames. Chained together: the decoder opens the frame, Diana boxes what matters, Carmenta reads any text, Argus describes the scene, Mercury hears the room.

Getting AI on the Edge Into a Real Home

Having engines is half the work. The other half is shipping them onto hardware you do not fully control.

No C Toolchain, and the Browser Counts

The test from Building the New Internet is simple: could this ship to someone who assumes their data is theirs, onto a machine you do not own, with no C toolchain in the build? clang plus libpython fails it. Pure Rust on candle passes, including wasm32 when the edge is a browser tab. RAG Converter already runs Carmenta and Mercury client-side, and Diana's wasm build returned the same detections as native on its test image. GPU support is behind feature flags; CPU-only still builds.

Picking the Right Crate

FFAI is the media AI library: speech in and out, OCR through Carmenta, vision-language through Argus, on one candle backbone with weights fetched from manifests. It also ships Minerva, a pure-Rust engine for BitNet b1.58 ternary models that reads bitnet.cpp's I2_S GGUF and runs on a laptop, a phone, or WebAssembly. The same model file produces the same tokens on every device. Minerva is not on crates.io yet; it builds outside the main FFAI workspace. The race against bitnet.cpp is in Minerva vs bitnet.cpp on CPU. If you only need transcription, take Mercury. If you need the whole kit, take FFAI. If detection is the product, Diana stands alone and does not pull in the others. The FTC keeps finding products that collected more than a feature needed. Processing on the device removes that surface by design rather than by policy.

Where It Lands in the Eras

Cameras and microphones are exactly where digital freedom is tested. A home companion, a shop counter and a set of peer devices all need perception that runs beside the sensor. SpaceDB can hold the resulting embeddings and mID can decide who may query them. The Freedom Guide lists the local-first steps in order, and local AI without uploading your life is the personal version of this page. More is in Learn.

AI on the edge is now mostly an engineering question rather than a research one, because the primitives were rebuilt rather than wrapped. When a coding agent is choosing the stack, pair this page with how to use Mercury, Carmenta and Diana, with the MATA Published Skills on GitHub loaded first, and browse the crate cards on the Remade with Rust catalog.

FAQ

Short answers already in this article.

Which speech models can Mercury run on a home machine today?

Mercury is Whisper rebuilt in pure Rust on candle, with mel, tokenizer, decoder and AVX2 kernels and no Python by default. It ships tiny.en and base.en with greedy decoding. Larger models and beam search are listed as next, not done.

How light is Diana compared with the usual YOLO setup?

Diana runs YOLO26 at 121 MiB of steady memory against 310 MiB for Ultralytics, with the same 0.7014 mAP50 on the measured COCO holdout, and spends 3.71 times less CPU per frame at equal work. At square geometry it is still slower than ONNX Runtime.

Can the same models run inside a browser tab?

Several can. Diana has a wasm build, ffai-wasm, that returned the same detections as native on its test image. RAG Converter already runs Carmenta and Mercury client-side in the browser, which is the edge case where the device is the tab itself.

Does running AI on the edge mean giving up GPUs entirely?

No. GPU support sits behind feature flags in the FFAI engines, and a CPU-only build still compiles. The point is that a GPU becomes optional for the household rather than a rented requirement in someone else's data center.

What is still missing from this edge pipeline?

Mercury has only small English Whisper models and greedy decoding. Carmenta trails PaddleOCR on photographed receipts and has no tested camera input. Diana exercises only COCO's 80 classes. Each README lists these limits rather than hiding them.