How telosnex/fonnx works
Project type and purpose
• This is a Flutter plugin library (“FONNX”) plus an example Flutter app.
• Purpose: expose ONNX model inference across all major platforms (Android, iOS, Web, macOS, Linux, Windows) with native acceleration (Android NNAPI, iOS CoreML, WASM SIMD, FFI to ONNX C API on desktop).
File structure
• Top-level “lib/”: the Dart API surface, platform interface abstractions, method-channel bridge, FFI bindings, web shim, model-specific classes (Magika, MiniLM, Whisper, etc.).
• Platform plugin code directories:
• android/src/main/kotlin/com/telosnex/fonnx – Kotlin plugin registering a MethodChannel, loading ONNX AAR.
• ios/Classes – Swift plugin hooking into CocoaPods ONNX runtime.
• linux/, windows/ – C++ plugin entry points exposing a C API, loaded via dart:ffi.
• macos/ – Swift/CocoaPods plugin code.
• web (docs/ and example/web/) – JavaScript + WASM workers and glue code for ort-wasm.
• “onnx_runtime/” – headers and FFI config for building/linking the ONNX C API.
• “example/” – full Flutter app that uses FONNX, demonstrating multi-model inference (VAD, Whisper, embeddings, file-ID Magika).
README for context
• Confirms cross-platform support, details per-platform integration (FFI on desktop, pods on iOS, AAR on Android, WASM+SharedArrayBuffer on Web).
• Describes use cases: speech-to-text (VAD + Whisper), file identification (Magika), text embeddings.