edgepulse

Flutter plugin for EdgePulse — runtime observability for on-device AI.

pub package

EdgePulse captures real-time device metrics (Memory RSS, thermal state, battery draw, and CPU usage) on Android and iOS via native platform channels during on-device AI inference execution.


Features

  • Real Device Metrics: Captures actual process memory (RSS), thermal state, battery current draw/level, and CPU utilization.
  • Android & iOS Support: Kotlin native plugin (Debug.getPss(), PowerManager, /proc/stat) and iOS Swift native plugin (mach_task_basic_info, ProcessInfo, host_statistics).
  • Core Compatibility: Seamlessly integrates with edgepulse_core models, PulseRunner, and exporters (JSON, Markdown, CSV).

Installation

Add edgepulse to your pubspec.yaml:

dependencies:
  edgepulse: ^0.2.0

Usage

import 'package:flutter/material.dart';
import 'package:edgepulse/edgepulse.dart';

Future<void> main() async {
  final pulse = EdgePulse(
    collector: PlatformMetricCollector(),
    config: const TraceConfig(
      measuredRuns: 5,
      warmupRuns: 1,
      collectThermal: true,
      collectBattery: true,
      collectCpu: true,
    ),
  );

  await pulse.initialize();

  final traces = await pulse.traceMany(
    modelId: 'mobilenet_v3',
    modelFormat: 'tflite',
    run: () async {
      // Execute your model inference here
      await Future<void>.delayed(const Duration(milliseconds: 120));
    },
  );

  await pulse.dispose();

  final markdownReport = pulse.exportMarkdown(traces);
  print(markdownReport);
}

Documentation

For full documentation and core utilities, visit the EdgePulse GitHub repository.

Libraries

edgepulse
EdgePulse Flutter plugin — runtime observability for on-device AI.