DEV Community

Muhammad Assad Ullah
Muhammad Assad Ullah

Posted on

I Built a Fault Injection Framework for On-Device AI in Flutter - And You Can Help!

I Built a Fault Injection Framework for On-Device AI in Flutter - And You Can Help! ๐Ÿงช

The Problem Nobody Talks About

On-device AI is exploding. Llama 3, Phi-3, Gemma โ€” they're all running directly on phones and edge devices.

But here's the thing: nobody is testing what happens when these models fail.

When your AI model runs on a user's phone, it WILL fail:

  • Memory pressure โ†’ OOM crashes
  • Malformed input โ†’ Silent failures
  • Quantization drift โ†’ Garbage outputs
  • Thermal throttling โ†’ Slow inference

These issues only surface in production. Users experience crashes. Developers scramble to fix them. There's no tooling to test AI reliability before deployment.

Introducing SATE AI

So I built a framework to fix this.

SATE AI (Systematic AI Testing & Evaluation) is a fault injection framework for testing on-device AI models in Flutter applications.

What It Does

import 'package:sate_ai/sate_ai.dart';

final report = await SateAI.stress(
  model: MockAdapter(),  // Replace with your real model
  injectors: [
    MemoryPressureInjector(limitMb: 150),
    MalformedInputInjector(),
  ],
);

if (report.passed) {
  print('โœ… Model passed stress test');
} else {
  print('โŒ Model failed: ${report.failures.length} failures');
  print(report.toMarkdown());
}
Enter fullscreen mode Exit fullscreen mode

Features

  • โœ… Fault injection engine - Simulate memory pressure, malformed inputs, and more
  • โœ… 59 unit tests - Full coverage of core modules
  • โœ… MockAdapter - Test without real AI models
  • โœ… StressReport - JSON + Markdown serialization
  • โœ… Web Dashboard - Visualize test reports with charts
  • โœ… Extensible - Add your own injectors and adapters

Watch It Catch a Failure

SATE AI Demo

The dashboard shows exactly which faults caused the model to fail.

Why I Built This

I've been working with on-device AI and noticed a critical gap:

Every Flutter app tests its UI. Nobody tests its AI.

SATE AI is my attempt to make AI reliability testing as standard as UI testing.

The Tech Stack

  • Flutter/Dart - 100% Dart, no production dependencies
  • Mock Adapter - Pure Dart simulation for testing
  • Chart.js - Web dashboard for report visualization
  • GitHub Actions - CI/CD with 59 passing tests

Current Status

Feature Status
Core Framework โœ… Complete
MemoryPressureInjector โœ… Complete
MalformedInputInjector โœ… Complete
Web Dashboard โœ… Complete
ONNX Runtime Adapter โณ In Progress
Quantization Drift Injector โณ Planned
Thermal Throttle Injector โณ Planned

๐Ÿ“ฆ Published on pub.dev

SATE AI is officially published!

dependencies:
  sate_ai: ^0.1.0
Enter fullscreen mode Exit fullscreen mode

pub package
GitHub stars
CI

๐Ÿš€ How You Can Help

I'm building this solo, and I need YOUR help!

โœ… Star the Repository

โญ Star SATE AI on GitHub - It takes 2 seconds and helps others discover the project.

๐Ÿ”ง Pick a Good First Issue

We have 7 Good First Issues ready for contributors:

  1. Add ONNX Runtime Adapter - Medium
  2. Implement Quantization Drift Injector - Easy
  3. Add TensorFlow Lite Adapter - Medium
  4. Thermal Throttle Injector - Easy
  5. Add Confidence Score Validation - Easy
  6. Improve README Examples - Easy
  7. Create Web Dashboard - Completed! โœ…

๐Ÿ“ Share Your Feedback

  • Try SATE AI and open an issue
  • Suggest new fault injectors
  • Help improve documentation
  • Share the project with others

๐Ÿ’ฌ Join the Discussion

We have active Discussions where we talk about:

  • Feature ideas
  • Technical questions
  • Show & Tell projects built with SATE AI

Join the conversation

Why Contribute?

For Your Career

  • Build your GitHub profile with real contributions
  • Work with Flutter + AI (fast-growing field)
  • Learn about fault injection and reliability testing
  • Get your PR merged into a pub.dev package

For the Community

  • Help make on-device AI more reliable
  • Shape the direction of the project
  • Be part of something from the ground up

Quick Start

# 1. Add the dependency
flutter pub add sate_ai

# 2. Write your first test
import 'package:sate_ai/sate_ai.dart';

final report = await SateAI.stress(
  model: MockAdapter(),
  injectors: [
    MemoryPressureInjector(limitMb: 100),
    MalformedInputInjector(),
  ],
);

print(report.passed ? 'โœ… Passed' : 'โŒ Failed');
Enter fullscreen mode Exit fullscreen mode

๐Ÿ“š Resources

The Future of SATE AI

Here's what's coming:

Feature Planned Status
ONNX Runtime Adapter v0.2.0 In Progress
Quantization Drift v0.2.0 Planned
Thermal Throttle v0.2.0 Planned
GitHub Action v0.3.0 Planned
Research Paper 2026 Planned
More Injectors Ongoing Planned

๐Ÿ’ก My Journey

I built this project in ONE DAY:

  • 59 tests passing
  • 2 working injectors
  • Professional documentation
  • Published to pub.dev
  • First contributor already!

Open source is about community. I can't build this alone.


โญ Star the repo. Share this post. Pick an issue.

Every contribution counts - from reporting bugs to writing code to sharing the project with others.

๐Ÿ‘‰ GitHub Repository ๐Ÿ‘ˆ


Built on research from SATE/AndroTest24. Let's make on-device AI reliable! ๐Ÿš€




---

## ๐Ÿ“‹ Post Settings

| Setting | Value |
|---------|-------|
| **Title** | I Built a Fault Injection Framework for On-Device AI in Flutter - And You Can Help! |
| **Tags** | flutter, ai, testing, opensource |
| **Cover Image** | Upload a screenshot or GIF from the dashboard |
| **Series** | (Optional) "Building SATE AI" |

---

## ๐ŸŽฏ Publishing Checklist

- [ ] Copy the title
- [ ] Add tags: `flutter`, `ai`, `testing`, `opensource`
- [ ] Upload cover image
- [ ] Paste the entire body
- [ ] Click **"Publish"**
- [ ] Share the link on Twitter, LinkedIn, and Reddit

---

## ๐Ÿ”ฅ Bonus: Engagement Tactics

### After Publishing:

1. **Reply to every comment** within 24 hours
2. **Ping me on Twitter** - I'll retweet
3. **Share in Flutter Discord** - #showcase channel
4. **Post to r/FlutterDev** - Link to the DEV.to article
5. **Update your LinkedIn** - "I wrote about building SATE AI"

---

## ๐Ÿ“Š Expected Impact

| Metric | Target | Timeline |
|--------|--------|----------|
| DEV.to Views | 1000+ | Week 1 |
| GitHub Stars | +20 | Week 1 |
| New Issues | +2 | Week 1 |
| Contributors | +1 | Week 2 |

---

## ๐Ÿš€ Ready to Publish!

**Copy everything above and paste it into DEV.to!**

Let me know when you've published it and I'll help you with the next steps! ๐ŸŽ‰
Enter fullscreen mode Exit fullscreen mode

Top comments (0)