Skip to content
pubscout

executorch_flutter

0.9.1, released 5 days ago by zcreations.info

On-device ML inference for Flutter using PyTorch ExecuTorch and dart:ffi.

WASM-ready
$ flutter pub add executorch_flutter
Source repository

What it does

ExecuTorch Flutter provides a Dart API for loading and running ExecuTorch machine learning models (.pte files) and experimental streaming LLMs directly on-device. It handles native platform integration across Android, iOS, macOS, Windows, Linux, and Web.

AI-written summary of version 0.9.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to run PyTorch machine learning models locally on mobile, desktop, or web.
  • You want support for streaming on-device LLMs or real-time camera inference.

Skip it when

  • You prefer running heavy inference on remote servers rather than on-device.
  • You are using BERT-family tokenizers (WordPiece) which are unsupported by the native tokenizer.

Strengths

  • Cross-platform support including Android, iOS, macOS, Windows, Linux, and Web.
  • Supports multiple backends like XNNPACK, CoreML, Metal, and experimental Vulkan or MLX.
  • Includes experimental streaming text generation for on-device LLMs.

Weaknesses

  • Requires platform configuration and native build hooks setup.
  • Tokenizers do not support WordPiece/BERT-family models.
  • Some backends like Vulkan or MLX are experimental or platform-restricted.

Setup

Kind
Plugin (native code)
Effort
High
Code generation
No
Direct dependencies
2

Requires native build configuration under pubspec.yaml hooks.user_defines, setting iOS/macOS deployment targets, and running setup_web for web targets.

import 'package:executorch_flutter/executorch_flutter.dart';

final model = await loadModelFromAsset('assets/models/model.pte');
final outputs = await model.forward([inputTensor]);
await model.dispose();

Alternatives

Packages that do the same job and could replace executorch_flutter.

  • tflite_flutter

    Choose this if you prefer TensorFlow Lite models over PyTorch ExecuTorch for on-device inference.

  • llamadart

    Choose this if you want a dedicated Dart library for LLaMA model inference without the ExecuTorch dependency.

Works with

Packages commonly used together with executorch_flutter: ones it builds on, ones built on it, and its own family.