Basic usage samples and end-to-end demonstrations for LiteRT APIs.
- CompiledModel API: Code examples in C++, C, Python, Kotlin, Swift, and Rust.
- End-to-End Demos: Showcases for ASR, TTS, Vision, and other model capabilities.
- Feature Demos: Miscellaneous demonstrations highlighting LiteRT features.
Each row is one sample directory; the Model column says where the sample gets its model files, with a link for every model hosted in litert-community. Each sample's own README has the build and run steps.
| Sample | Task | API | Platform | Model |
|---|---|---|---|---|
digit_classifier/ |
Handwritten digit classification | CompiledModel API | Android | an MNIST .tflite, downloaded by Gradle |
flutter/ |
Voice chat with an LLM (spoken questions as audio, photos, a local knowledge base, agent skills) and a live camera assistant with object detection and a visual memory, in one Flutter app | LiteRT-LM and CompiledModel API, from Dart (flutter_edge_ai, flutter_litert) |
Android (GPU, Qualcomm NPU), iOS (GPU), macOS (GPU), Linux (GPU or CPU; Qualcomm NPU on VENTUNO Q; incl. Raspberry Pi 5, Jetson Orin) | chat model chosen in the app, e.g. Gemma 4 E2B from litert-community/gemma-4-E2B-it-litert-lm, on the GPU or CPU or, with a per-SoC build, the Qualcomm NPU; built in, fetched by tool/fetch_models.sh, on the CPU: EmbeddingGemma 2, Whisper base, moonshine tiny, Inflect-nano-v2 with the Matcha-TTS G2P; on the GPU (or the CPU, if chosen): a YOLO26n detector derived from Arm/yolo26n-fp16-litert (AGPL-3.0) |
flutter_intel_npu/ |
The same Gemma model on the CPU, GPU and NPU of an Intel Core Ultra laptop, in three acts: a speed race, a 45-minute transcript in context with cited answers, and a 3D scene on the GPU narrated live by the model | LiteRT-LM, from Dart (flutter_gemma) |
Windows 11 on Intel Core Ultra (CPU, GPU, NPU), macOS (CPU, GPU) | litert-community/gemma-4-E2B-it-litert-lm and litert-community/gemma-4-12B-it-litert-lm, downloaded by the user; on the NPU, an NPU build of Gemma 4 E2B (NPU_MODEL_PATH) |
google/sample_app_tpu/ |
Multimodal chat with an LLM on the Google Tensor TPU | LiteRT-LM | Android (Pixel 10) | litert-community/gemma-4-E2B-it-litert-lm (gemma-4-E2B-it_Google_Tensor_G5.litertlm) |
image_classification/ |
Image classification from the camera | CompiledModel API | Android | efficientnet_lite0.tflite and efficientnet_lite2.tflite, downloaded by Gradle |
image_cutout/ |
Cut out what you name in words from a photo, as a transparent PNG; the same app detects, points, counts and reads text (WeVisOne-VL-2B) | CompiledModel API | Android (GPU) | litert-community/WeVisOne-VL-2B (cutout/), downloaded by the user and copied to the phone by install_to_device.sh |
image_generation/ |
Text to image (Bonsai Image 4B) | CompiledModel API | iOS, macOS | litert-community/Bonsai-Image-ternary-4B |
image_segmentation/ |
Image segmentation | CompiledModel API | Android (Kotlin on CPU/GPU and NPU; C++), iOS | Kotlin, CPU/GPU and the NPU variants' fallback: litert-community/MediaPipe-Selfie-Segmentation, downloaded by Gradle; Kotlin NPU: per-SoC models through an AI Pack; C++: models/selfie_multiclass_256x256*.tflite in the tree; iOS: selfie_multiclass_256x256.tflite from Kaggle |
ocr_verification/ |
Read a photo of printed text line by line and give each line's text a score from 0 to 1 that it is correct, so only the doubtful lines need a person (MiniCPM-OCR-Jev; ML Kit reads the lines) | CompiledModel API | Android (GPU) | litert-community/MiniCPM-OCR-Decision-2B-LiteRT (five files), downloaded by the user and copied to the phone by install_to_device.sh |
photo_voice_chat/ |
Ask about a photo or a short video out loud and hear the answer, then ask again by voice, with no network (LFM3-Omni-2B: one model sees the photo or the video, hears the question and the video's sound, and speaks) | CompiledModel API | Android (CPU, GPU) | litert-community/LFM3-Omni-2B-LiteRT (the .litertlm bundle and three .tflite graphs), pushed with adb |
phototalk_sample_app/ |
Classify a photo, then chat about it with an LLM | CompiledModel API and LiteRT-LM | Android | classifier: efficientnet_lite0.tflite, downloaded by Gradle; LLM: litert-community/gemma-4-E2B-it-litert-lm, litert-community/Gemma3-1B-IT, litert-community/FastVLM-0.5B |
qualcomm/gemma3/cpu_gpu/ |
Chat with Gemma 3 1B | LiteRT-LM | Android (CPU, GPU) | litert-community/Gemma3-1B-IT (gemma3-1b-it-int4.litertlm) |
qualcomm/gemma3/npu/ |
Chat with Gemma 3 1B on the Qualcomm NPU | LiteRT-LM | Android (Qualcomm NPU) | litert-community/Gemma3-1B-IT (Gemma3-1B-IT_q4_ekv1280_sm8750.litertlm) |
qualcomm/fast_vlm/ |
Chat with FastVLM 0.5B | LiteRT-LM | Android (CPU, GPU, Qualcomm NPU) | FastVLM-0.5B.litertlm or FastVLM-0.5B.sm8850.litertlm, pushed to /data/local/tmp/fastvlm |
qualcomm/gemma4/cpu_gpu/ |
Multimodal chat with Gemma | LiteRT-LM | Android | litert-community/gemma-4-E2B-it-litert-lm (gemma-4-E2B-it.litertlm) through the in-app downloader, or gemma3-1b-it-int4.litertlm pushed with adb, the README's default |
qualcomm/llm_chatbot_npu/ |
Multimodal chat (text, image, audio) on the Qualcomm NPU | LiteRT-LM | Android (Qualcomm NPU) | litert-community/gemma-4-E2B-it-litert-lm (gemma-4-E2B-it_qualcomm_sm8750.litertlm), litert-community/FastVLM-0.5B (FastVLM-0.5B.qualcomm.sm8750.litertlm) |
qualcomm/mobilenet_v2/ |
Image classification on the Qualcomm NPU (JIT) | CompiledModel API | Android (Galaxy S25 Ultra for the NPU; an emulator for CPU) | Qualcomm's MobileNet-v2 float .tflite, downloaded by Gradle (qualcomm/MobileNet-v2) |
qualcomm/object_detection/efficientdet/kotlin_npu/ |
Object detection from the camera on the Qualcomm NPU | CompiledModel API | Android (Qualcomm NPU) | efficientdet_lite0_detection.tflite (TF Hub EfficientDet-Lite0) in the app's assets |
semantic_similarity/ |
Semantic similarity of two sentences | LiteRT (C++) | Linux, Android | litert-community/embeddinggemma-300m |
speech_recognition/ |
Speech recognition (Parakeet TDT, CTC and TDT-CTC ja; Moonshine; Whisper; Qwen3-ASR) | CompiledModel API | Android; Python for conversion | litert-community/parakeet-tdt-0.6b-v3, parakeet-ctc-0.6b, parakeet-tdt_ctc-0.6b-ja, moonshine-tiny, whisper-tiny, Qwen3-ASR-0.6B |
text_classification/ |
Text classification | CompiledModel API | Android | bert_classifier.tflite and average_word_classifier.tflite, downloaded by Gradle |
text_to_speech/ |
Text to speech (Matcha-TTS) | CompiledModel API | Android | litert-community/Matcha-TTS, or built by conversion/ |
text_to_speech_lm/ |
Text to speech with voice cloning (Qwen3-TTS) | CompiledModel API | Python, Android | litert-community/Qwen3-TTS-12Hz-0.6B-Base |
text_to_speech_streaming/ |
Streaming text to speech (KittenTTS nano) | CompiledModel API (G2P, vocoder) and Interpreter API (predictor, prosody) | Android, Python | built by conversion/ from KittenTTS nano; the G2P graph from litert-community/Matcha-TTS |
voicemail_summary/ |
An English voicemail (an example, a recording or a file) told back to you in your language, as text and speech: who called, why, and the number to call back (LFM3-Audio-2B) | CompiledModel API | Android (CPU, GPU; the Qualcomm NPU on an SM8850) | the LFM3-Audio-2B .litertlm bundle and four .tflite graphs on litert-community/LFM3-Audio-2B-LiteRT, pushed with adb |
zero_shot_classification/ |
Zero-shot text classification with questions defined at run time (choice, score, yes/no) | CompiledModel API | Android (Kotlin on GPU/CPU and NPU) | litert-community/Laya-Multilingual-LiteRT (mmBERT-base), downloaded by the app |
colab/ holds the AOT compilation tutorial notebook.