Field notes/pure Rust alternativeMindFFAI

FFAI एक शुद्ध Rust विकल्प है Python AI मीडिया स्टैक के लिए

एक ffai बाइनरी Whisper, piper, PaddleOCR, Ultralytics और transformers के Python मिश्रण की जगह लेती है: वही weights, बिना Python/ONNX runtime, ब्राउज़र builds।

Signed by M·
खिड़की पर आवाज़, दृष्टि और स्क्रिप्ट रोशनी का चित्रित इनडोर सूट
Python AI मीडिया स्टैक में FFAI किसकी जगह लेता है?

FFAI एक Rust टूलकिट में speech recognition, text-to-speech, OCR, object detection और tracking, और vision-language captioning को कवर करता है। यह वही model weights चलाता है जो लोग Python से इस्तेमाल करते हैं, बिना Python runtime, बिना ONNX runtime और बिना gated weights, और इसके engines WebAssembly में भी compile होते हैं।

Related reading

FFAI: Speech, OCR, Detection and Captioning in One Rust Toolkit

FFAI bundles Mercury, Carmenta, Diana, Argus and Minerva in one Rust toolkit: ASR, TTS, OCR, YOLO26, captions and BitNet b1.58 inference, with no Python or ONNX runtime.

Ship it

AI Media On The Device

ASR, OCR, detection, and BitNet b1.58 inference in one Remade suite instead of a Python or C++ stack.

एक आम Python AI मीडिया सेवा अलग-अलग प्रोजेक्ट्स का स्टैक होती है: transcripts के लिए Whisper या WhisperX, आवाज़ों के लिए piper, images में text के लिए PaddleOCR या Tesseract, YOLO detection के लिए Ultralytics, और captions के लिए Hugging Face transformers, और यह सब एक Python interpreter और अक्सर एक ONNX runtime पर बैठा होता है। FFAI उस स्टैक की जगह एक Rust टूलकिट लाता है जो उसी तरह बना है जैसे ffmpeg बनता है: पहले libraries, ऊपर एक ffai binary, और हर engine नाम से चुनने योग्य। FFAI क्या है इसका सामान्य परिचय FFAI field note में है। यह पेज एक चालू Python pipeline को इधर लाने के बारे में है।

Python स्टैक आपको क्या महँगा पड़ता है

एक feature के लिए पाँच runtimes

हर Python package अपने native dependencies, model loader और preprocessing code के साथ आता है। एक सेवा जो कॉल transcribe करती है, screenshot पढ़ती है और frame label करती है, अंततः Python interpreter, PyTorch या ONNX Runtime, OpenCV या PIL, और हर प्रोजेक्ट का अपना glue भेजती है। यह patch करने के लिए एक बड़ी native surface है, जो अलग release cycles वाले प्रोजेक्ट्स में फैली है। यह browser tab में भी नहीं चल सकती, जिससे media सर्वर पर जाना पड़ता है।

मशीन से बाहर जाने वाला data

चूँकि Python स्टैक भारी है, टीमें इसे केंद्र में host करती हैं और audio, scans और frames उस पर भेजती हैं। हर hop उपयोगकर्ता के data की एक copy है ऐसी जगह जो उपयोगकर्ता के नियंत्रण में नहीं। FFAI के browser builds (ffai-wasm, ffai-carmenta-wasm, ffai-mercury-wasm, ffai-argus-wasm) वही engines वहाँ चलाने देते हैं जहाँ file पहले से है। RAG Converter इसका काम करता उदाहरण है: यह इन engines को WebAssembly के रूप में चलाकर emails, PDFs, scans, audio और video को RAG data में बदलता है, बिना कुछ upload किए।

Preprocessing में drift

Python pipelines अक्सर अपनी accuracy preprocessing में छिपी details से पाते हैं, जैसे PIL का resampler। उन details को छोड़ने वाले reimplementations थोड़े अलग जवाब देते हैं। FFAI इसे correctness gate मानता है: Argus captioner PIL के fixed-point resampler को बिल्कुल लागू करता है, इसलिए raw image file से caption Python reference के byte-identical होता है।

हर Python package को FFAI engine से मैप करना

Whisper और WhisperX से Mercury

Mercury candle पर OpenAI Whisper, tiny से medium तक चलाता है। LibriSpeech test-clean पर tiny.en के साथ यह 7.27% WER देता है, जबकि whisper.cpp 7.58% देता है, 27.8x realtime और 179 MiB steady memory पर। WhisperX features बिना Python या gated weights साथ आते हैं: segmentation, CTC forced alignment से --word-timestamps, और 4.21% DER पर ECAPA-TDNN के साथ --diarize। Command है ffai asr -i talk.wav -o talk.srt।

piper से Mercury TTS

Mercury TTS piper की अपनी voice files ONNX से पढ़ता है और candle पर VITS स्टैक चलाता है, एक clean-room phonemizer के साथ, इसलिए कोई GPL code नहीं भेजा जाता। यह wall-clock पर 1.58x तेज़ है और 5% कम CPU लेता है, 0.64 s में load होता है जबकि 6.69 s, और एक ही text और seed के लिए प्रति मशीन एक exact WAV देता है। Voices अभी केवल English (en-US) हैं।

PaddleOCR और Tesseract से Carmenta

Carmenta पाँच OCR engines भेजता है। इसका recognizer 400 real-photo word crops पर 1.5% CER तक पहुँचता है, जबकि PaddleOCR mobile 3.0% देता है। OmniDocBench evaluator पर 1,651 pages में यह 0.116 का text edit distance स्कोर करता है। यह auto-orientation, checkboxes और PDF pages को भी संभालता है जैसे viewer दिखाता है, इसलिए redactions कभी पार नहीं पढ़े जाते।

Ultralytics और transformers से Diana और Argus

Diana पाँचों YOLO26 tiers के लिए official Ultralytics .pt load करता है और candle पर चलाता है, प्रति frame 3.71x कम CPU और ByteTrack tracking के साथ जो MOT17 पर 218 ID switches log करता है, Ultralytics के 800 के मुकाबले। Argus captions के लिए SmolVLM-256M-Instruct चलाता है। इसका preprocessing transformers से 2.6x तेज़ है, लेकिन पूरा caption 1.20x धीमा है, अंतर vision tower में है। यह वह एक engine है जहाँ Python reference समय पर अब भी जीतता है।

Pipeline को switch करना

Engines install करना और list करना

  1. cargo install ffai-cli binary के लिए, या एक engine embed करने के लिए cargo add ffai-mercury (या कोई और component)।
  2. ffai engines चलाएँ और हर engine और उसका status देखें, जैसे ffmpeg -codecs codecs list करता है, और manifests, licenses और cache state के लिए ffai models।
  3. Build machines पर ffai models --fetch <name> से weights पहले से fetch करें ताकि पहला request download पर न रुके।

Cutover से पहले parity सिद्ध करना

FFAI अपना analyzer भेजता है। ffai bench asr --corpus corpora/librispeech-test-clean-v2.toml engine और हर reference को उन्हीं clips पर चलाता है, दोनों को एक ही metric code से score करता है, और bench/ledger.jsonl में record जोड़ता है। Verdict correctness, quality, speed और footprint को कवर करता है, और skip किया गया gate कभी pass नहीं गिना जाता। इसे public corpora के साथ-साथ अपने media के sample पर भी चलाएँ, फिर transcripts और boxes की तुलना करें जो Python सेवा ने बनाए थे।

जानें क्या अभी खुला है

Native builds अभी भी crates.io से candle के ज़रिए onig_sys compile करते हैं जब तक upstream patch न आए; workspace builds इसके बजाय tokenizers को rusty_expressions पर route करते हैं। Optional downloader aws-lc-sys खींचता है। GPU backends feature flags के पीछे हैं। Latest Diana, Argus और Mercury releases के speed figures instruction counts हैं, दोबारा नापा गया wall time नहीं।

Deployment के लिए, mata.network के Disco Party cloud पर apps FFAI को अपनी AI layer के रूप में उपयोग करते हैं, इसलिए वे बिना किसी third-party AI सेवा के transcribe और देखते हैं। Pin FFAI repo landing पर है, source Remade-With-Rust में है, और Mind on Vision बाकी band दिखाता है।

FAQ

क्या FFAI engines Python references जैसे ही परिणाम देते हैं?

हर engine अपने reference के विरुद्ध oracle-gated है। Argus caption Python transformers के output से byte for byte मेल खाता है, Mercury TTS piper की waveform को 3e-5 तक मैच करता है, और Diana के YOLO26 detections पाँच में से चार tiers पर 0.3 px के भीतर Ultralytics के समान हैं।

FFAI गति और मेमोरी पर कैसा तुलनात्मक है?

Mercury ASR साफ़ speech पर whisper.cpp से 1.07x तेज़ चलता है और शोर वाली speech पर 1.70x, Diana Ultralytics की तुलना में प्रति frame 3.71x कम CPU और 1.6 से 5.6x कम मेमोरी लेता है, और Carmenta recognition की latency PaddleOCR mobile से 2.6x कम है।

Model weights कहाँ से आते हैं?

Weights कभी vendored नहीं होते। ffai models उन्हें TOML manifests से एक local cache में fetch करता है जो हर model का अपना license दिखाते हैं, और हर model बिना account के fetch किया जा सकता है। YOLO26 weights AGPL-3.0 हैं और repository में नहीं हैं।

क्या FFAI build में कोई C बचा है?

wasm32 builds कोई C compile नहीं करते। Native builds अभी भी crates.io से candle के ज़रिए onig_sys खींचते हैं जब तक upstream patch न आए, और aws-lc-sys optional Hugging Face downloader feature के पीछे है।

क्या मैं पूरे toolkit के बिना एक engine इस्तेमाल कर सकता हूँ?

हाँ। हर capability एक crate है: cargo add ffai-mercury, ffai-carmenta, ffai-diana या ffai-argus. CLI में अपना कोई logic नहीं है, और ffai-diana natively 138 transitive crates और wasm32 पर 95 खींचता है।