fonnx  by Telosnex

Flutter library for running ONNX models on any platform

Created 1 year ago
280 stars

Top 93.0% on SourcePulse

GitHubView on GitHub
Project Summary

Telosnex/fonnx provides a Flutter library for running ONNX machine learning models natively across multiple platforms, including mobile, desktop, and web. It targets Flutter developers seeking to integrate AI capabilities like text embeddings and voice processing directly into their applications, offering benefits of privacy and low latency by enabling on-device inference.

How It Works

FONNX leverages the ONNX Runtime, integrating with platform-specific acceleration frameworks such as CoreML on iOS, Android Neural Networks API, and WASM SIMD on the web. This approach allows for efficient, native execution of ONNX models, which can be converted from popular frameworks like PyTorch and TensorFlow using tools like Hugging Face's optimum-cli.

Quick Start & Requirements

  • Install: Add fonnx to your Flutter project's pubspec.yaml.
  • Prerequisites: ONNX Runtime dependencies are handled automatically for most platforms. Web deployment requires specific server headers (Cross-Origin-Embedder-Policy: require-corp, Cross-Origin-Opener-Policy: same-origin) for optimal performance.
  • Resources: Example app available at telosnex.github.io/fonnx/.

Highlighted Details

  • Supports ONNX models for text embeddings (e.g., MiniLM L6 V2, MSMARCO MiniLM L6 V3) and voice processing (Whisper, Silero VAD).
  • Achieves low latency inference, with benchmarks showing ~13ms on macOS (M2 Max) and ~41ms on Web WASM SIMD for a MiniLM L6 V2 embedding.
  • Integrates via FFI for macOS/Windows/Linux, ONNX Objective-C library for iOS, and ONNX Android AAR for Android.

Maintenance & Community

  • Recent updates include CI builds on Codemagic and support for Magika and Whisper across platforms.
  • Community links are not explicitly provided in the README.

Licensing & Compatibility

  • Dual-licensed: GPL v2 for the code on GitHub (requiring source code distribution for derivative works) and commercial licenses available upon contact. Commercial use is possible with a paid license, with terms favoring entities with successful, FONNX-dependent applications.

Limitations & Caveats

  • The GPL v2 license may be restrictive for commercial applications without a separate commercial license.
  • Web development requires specific server configurations and workarounds for WASM MIME types and SharedArrayBuffer usage in debug mode.
Health Check
Last Commit

3 months ago

Responsiveness

1+ week

Pull Requests (30d)
0
Issues (30d)
0
Star History
1 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Luis Capelo Luis Capelo(Cofounder of Lightning AI), and
1 more.

tutorials by onnx

0.1%
4k
ONNX model tutorials and examples
Created 7 years ago
Updated 1 year ago
Starred by Tobi Lutke Tobi Lutke(Cofounder of Shopify), Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), and
24 more.

open-webui by open-webui

0.6%
110k
Self-hosted AI platform for local LLM deployment
Created 1 year ago
Updated 1 day ago
Feedback? Help us improve.