sate_ai library

SATE AI — Fault Injection Framework for On-Device AI.

Import this library to access all public APIs:

import 'package:sate_ai/sate_ai.dart';

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

Classes

AIInput
Text or binary input payload for an AI model inference call.
AIModelAdapter
Abstract interface that wraps any on-device AI model.
AIOutput
Output produced by an AI model inference call.
Failure
Records an unexpected exception that prevented a fault cycle from running.
FaultInjector
Abstract base class for all SATE AI fault injectors.
FaultResult
The result of a single fault injection + inference cycle.
MalformedInputInjector
Injects malformed, boundary-violating, and random inputs to test that an AI model handles bad data without crashing or producing corrupt output.
MemoryPressureInjector
Simulates memory pressure to test how an AI model behaves near or beyond its available RAM budget.
MockAdapter
A fully-in-process mock implementation of AIModelAdapter for testing.
OnnxAdapter
AIModelAdapter implementation backed by the ONNX Runtime.
QuantizationDriftInjector
Simulates gradual precision loss in model outputs.
SateAI
Top-level convenience API for running SATE AI stress tests.
StressReport
The aggregated result of a full SATE AI stress test run.
StressRunner
Orchestrates a sequence of FaultInjector runs against an AIModelAdapter.

Enums

FaultType
Types of faults that can be injected into AI model stress tests.
MalformedInputKind
The variants of malformed input that MalformedInputInjector generates.

Extensions

FaultTypeX on FaultType
Extension helpers on FaultType.

Typedefs

OrtSessionFactory = OrtSession Function(Uint8List bytes)
Signature for a factory that produces an OrtSession from raw model bytes.

Exceptions / Errors

AIInferenceError
Thrown when an AI model inference call fails.