Flutter On-Device AI With TensorFlow Lite A developer built Butter Skin, a Flutter skincare app that runs a TensorFlow Lite vision model fully on-device, analyzing camera images and returning results in under two seconds without any network round trip. The app uses the tflite_flutter plugin with a reusable interpreter, int8 quantization to cut model size from about 90 MB to 23 MB, and Firebase only for account and progress sync, keeping all AI inference offline. On-device AI used to sound like a research demo. In 2026 it is a shipping strategy. Run a TensorFlow Lite model directly on the phone, skip the network round trip entirely, and keep the user's most sensitive data on the device that collected it. I did exactly this in Butter Skin https://www.uzairxdev.online/projects/butter-skin , an AI skincare coach that analyzes skin conditions straight from the camera and returns personalized results in under two seconds — the model never leaves the phone. The app runs on Flutter and Dart, uses TensorFlow Lite for the vision model, Riverpod for state management, and Firebase Auth, Firestore, Cloud Functions only for account and progress sync — the AI analysis itself is 100% offline. This guide is the practical version of that pipeline: loading a .tflite model with the tflite flutter plugin, preprocessing camera images into the exact tensor the model expects, running inference off the UI thread, and the production habits that keep the feature reliable. Four reasons pushed the Butter Skin analysis on device, and they apply to most mobile AI features: Privacy. Skin photos are about as personal as data gets. On-device inference means they never travel over a network, never sit on a server, and never appear in a request log. Privacy is not a policy page; it is the architecture. Latency. A network round trip for an image upload is measured in seconds. On-device inference on a modern phone is measured in milliseconds, and the whole analysis — capture, preprocess, infer, render — lands under two seconds. Offline. The feature works in airplane mode, on a poor connection, and in regions where mobile data is expensive. If your feature's value depends on connectivity, that is a choice you are making. Cost. No per-request billing, no GPU server to keep warm. Once the model ships inside the app bundle, inference is free at any scale. You need two packages: tflite flutter for the interpreter and image for decoding and resizing photos without a platform channel. dependencies: flutter: sdk: flutter tflite flutter: ^0.10.1 image: ^4.0.0 flutter: assets: - assets/models/skin model.tflite - assets/models/labels.txt The .tflite file comes from your own training pipeline — export from TensorFlow and optionally quantize to shrink it. The labels.txt file holds one class name per line, matching the model's output order. Always verify that the label order matches the training output; a silent mismatch here produces confident, wrong answers. Model size directly affects download size and install conversion. A float32 model that is 90 MB becomes roughly 23 MB as int8 quantized — same architecture, quarter of the weight. Quantization converts weights and optionally activations from 32-bit floats to 8-bit integers, trading a small, measurable accuracy drop for a large size and speed win. Two rules that matter in practice. First, measure accuracy on your own validation set before and after quantization; do not assume the drop is negligible for your task. Second, keep the training-time input preprocessing identical between the float and quantized versions — quantized models are less forgiving of mismatched normalization. If the accuracy drop is unacceptable for your use case, ship the float32 model and accept the larger download. An interpreter is expensive to create and cheap to reuse. Load it at startup, allocate its tensors, and keep it alive for the app's lifetime: import 'package:tflite flutter/tflite flutter.dart'; late final Interpreter interpreter; Future