Skip to content
Back to search

litert-samples

LiteRT and LiteRT-LM sample apps, model recipes, agent skills and utilities.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/google-ai-edge/litert-samples with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/google-ai-edge/litert-samples'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/google-ai-edge--litert-samples/badge.svg)](/listings/google-ai-edge--litert-samples)

HTML

<a href="/listings/google-ai-edge--litert-samples"><img src="/api/listings/google-ai-edge--litert-samples/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

**Prerequisites**

* **Android**: Android Studio (latest stable version). * **iOS**: Xcode (latest version). * **Python**: Python 3.9+ and `pip install ai-edge-litert`. * **Web / WASM**: Modern browser with WebGPU / WebAssembly support.

**Running a Sample**

**For Samples Using Compiled Model API**

1. Navigate to `samples/litert/<sample_name>`. 2. Ensure you have a device with a supported NPU/GPU (e.g., modern Pixel, Samsung, or Qualcomm/MediaTek devices). 3. Follow the specific setup instructions in the sample's `README.md`.

**For Web / Tensor API Playground**

Visit ["Interactive Web"](https://google-ai-edge.github.io/litert-samples/) tab, or open `samples/tensor_api_playground/index.html` or run `index.html` at the repository root via a local HTTP server.

---

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 343 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. <div align="center">
  2. <img src="https://raw.githubusercontent.com/google-ai-edge/LiteRT/main/docs/sources/litert_logo.png" alt="LiteRT Logo" width="320"/>
  3. # Google AI Edge — LiteRT & LiteRT-LM Samples
  4. **Official sample applications, end-to-end model conversion recipes, model benchmarks, and AI coding agent skills for on-device ML & GenAI.**
  5. [![Interactive Web Demos](https://img.shields.io/badge/🌐_Live_Demos-WebGPU_%26_WASM-4285F4?style=for-the-badge)](https://google-ai-edge.github.io/litert-samples/)
  6. [![HF LiteRT Community](https://img.shields.io/badge/🤗_Hugging_Face-litert--community_(400%2B_Models)-FFD21E?style=for-the-badge)](https://huggingface.co/litert-community)
  7. [![Find Your Models](https://img.shields.io/badge/🔍_Explore_Models-Find_Your_Models-FF6F00?style=for-the-badge)](https://huggingface.co/spaces/litert-community/find-your-models)
  8. [![Leaderboard](https://img.shields.io/badge/🏆_Benchmarks-Test_Yourself-34A853?style=for-the-badge)](https://github.com/google-ai-edge/litert-samples/tree/main/benchmark/developer_device_platform)
  9. [![License](https://img.shields.io/badge/License-Apache_2.0-slate?style=for-the-badge)](LICENSE)
  10. [🌍 Ecosystem](#-the-google-ai-edge--litert-ecosystem) •
  11. [🤗 Hugging Face Hub](#-hugging-face-litert-community-hub) •
  12. [🚀 Quickstart (Level 1–5)](#-getting-started-from-zero-to-production) •
  13. [📱 Sample Apps](#-level-3--explore-sample-applications) •
  14. [🧪 Model Recipes](#-level-4--convert--quantize-models-models) •
  15. [🤖 Agent Skills](#-level-5--automate-with-ai-agent-skills--ddp-benchmarks) •
  16. [📂 Repo Map](#-repository-structure)
  17. </div>
  18. ---
  19. Welcome to **`litert-samples`** — the central developer hub for
  20. * **[LiteRT](https://github.com/google-ai-edge/LiteRT)** (Google's high-performance, cross-platform, production-proven on-device inference, powering Google and 3P applications globally, succeeding TensorFlow Lite) and
  21. * **[LiteRT-LM](https://github.com/google-ai-edge/LiteRT-LM)** (Google's specialized orchestration layer for running LLMs with LiteRT, unlocking maximum performance and efficiency).
  22. Whether you want to **try a model in your browser in 30 seconds**, **drop a pre-converted model from [Hugging Face `litert-community`](https://huggingface.co/litert-community) into a mobile/desktop/web app**, or **convert, quantize, verify, and benchmark a new checkpoint on CPU, GPU, and NPU**, this repository takes you from first run to production deployment.
  23. ---
  24. ## 🔥 What's New
  25. * 🦋 **Cross-Platform Flutter & Intel NPU Showcases**: Added a full multimodal Flutter app ([`samples/litert/flutter/`](samples/litert/flutter/)) running voice chat, live camera detection, RAG, and agent skills across Android, iOS, macOS, Linux, Raspberry Pi 5, Jetson Orin, and Qualcomm VENTUNO Q — plus a 3-act **Intel Core Ultra NPU** showcase ([`samples/litert/flutter_intel_npu/`](samples/litert/flutter_intel_npu/)) running Gemma 4 across CPU, GPU, and NPU.
  26. * 📱 **LiteRT Model Zoo (34 Tasks in One App)**: Expanded [`samples/litert_model_zoo/`](samples/litert_model_zoo/) to **21 Vision, 8 Audio, and 5 Text Decision models** via the LiteRT `CompiledModel` API, streaming verified weights on-demand from [`litert-community`](https://huggingface.co/litert-community).
  27. * 🎙️ **Offline Voice Assistant & Embodied Robotics**: Added an offline Android voice assistant with tool calling ([`samples/litert_lm/voice_assistant/`](samples/litert_lm/voice_assistant/)) and a Raspberry Pi Reachy voice robot that sees, hears, reasons, and speaks ([`samples/litert_lm/reachy-voice-robot/`](samples/litert_lm/reachy-voice-robot/)).
  28. * 🌐 **Client-Side WebGPU Demos & Chrome Extension**: Added 5 zero-server browser demos built on `@litertjs/core` ([`samples/web_demos/`](samples/web_demos/): **SAM 2.1**, **CLIPSeg**, **MoGe-2 3D**, **PP-OCRv5**, **Matcha-TTS**) and a [Chrome Extension](samples/web_demos/chrome_extension/) for on-page OCR, TTS, and 3D photo hover.
  29. * 🧪 **End-to-End Model Conversion Cookbook & Recipes**: Added [`models/conversion.md`](models/conversion.md) and reproducible conversion/verification pipelines under [`models/`](models/) for **MiniCPM5-2B**, **Hunyuan Hy-MT2-1.8B**, **Nemotron-3-Nano-4B**, **Bonsai Image 4B**, **Qwen3-TTS**, **SAM 3**, **Zipformer ASR**, **wav2vec2 KWS**, and **GLiNER2.5**.
  30. * 🏆 **Real-Device Cloud Benchmarking & AI Agent Skills**: Added [Google Cloud Developer Device Platform (DDP) Colab notebooks](benchmark/developer_device_platform/), the [LiteRT Performance Leaderboard](benchmark/leaderboard/), and **9 end-to-end `SKILL.md` playbooks** ([`skills/`](skills/)) for AI coding agents.
  31. ---
  32. ## 🌍 The Google AI Edge & LiteRT Ecosystem
  33. `litert-samples` connects the entire **[`google-ai-edge`](https://github.com/google-ai-edge)** open-source stack with the **[Hugging Face `litert-community`](https://huggingface.co/litert-community)** model ecosystem:
  34. ```mermaid
  35. flowchart LR
  36. subgraph Source["1. Author & Convert"]
  37. PT["PyTorch / JAX / TF<br/>& HF Safetensors"] --> TORCH["litert-torch &<br/>ai-edge-quantizer"]
  38. REC["litert-samples/models/<br/>Conversion Recipes"] -.->|Scripts & Gates| TORCH
  39. end
  40. subgraph Hub["2. Model Hub (Hugging Face)"]
  41. TORCH -->|".tflite & .litertlm"| HF["🤗 litert-community<br/>400+ Ready-to-Run Models"]
  42. end
  43. subgraph Runtime["3. On-Device Runtimes & CLI"]
  44. HF --> RT["LiteRT Runtime<br/>CompiledModel & Tensor API"]
  45. HF --> LM["LiteRT-LM Engine<br/>LLMs, VLMs & Tool Calling"]
  46. HF --> CLI["LiteRT-CLI (litert)<br/>1-Command Run & Benchmark"]
  47. end
  48. subgraph Silicon["4. Hardware Acceleration"]
  49. RT & LM --> HW["CPU (XNNPACK)<br/>GPU (ML Drift / OpenCL / Metal / WebGPU)<br/>NPU (Qualcomm, Google Tensor, MediaTek, Intel)"]
  50. end
  51. subgraph Apps["5. Apps, Web & Benchmarks (This Repo)"]
  52. HW --> SAMP["📱 samples/ • 🌐 web_demos/<br/>🏆 benchmark/ • 🤖 skills/"]
  53. end
  54. ```
  55. ### Ecosystem Repositories at a Glance
  56. | Repository / Hub | Role in the Stack | Artifact / API |
  57. | :--- | :--- | :--- |
  58. | **[`google-ai-edge/LiteRT`](https://github.com/google-ai-edge/LiteRT)** | Core on-device runtime featuring the **CompiledModel API** (V2), **C++ Tensor API**, **LiteRT.js** (WebGPU/WASM), and unified GPU/NPU acceleration. | `.tflite` |
  59. | **[`google-ai-edge/LiteRT-LM`](https://github.com/google-ai-edge/LiteRT-LM)** | Production inference engine for LLMs & VLMs (prefill/decode orchestration, KV cache, multimodal vision/audio towers, tool calling). | `.litertlm` |
  60. | **[`huggingface.co/litert-community`](https://huggingface.co/litert-community)** | Official community hub hosting **400+ pre-converted, quantized, and verified** `.tflite` and `.litertlm` models ready for on-device deployment. | `.tflite`, `.litertlm` |
  61. | **[`google-ai-edge/litert-samples`](https://github.com/google-ai-edge/litert-samples)** *(You are here)* | Reference apps (Android, iOS, Flutter, Web, Linux/Pi), conversion recipes (`models/`), DDP benchmarks (`benchmark/`), and agent skills (`skills/`). | End-to-End Code |
  62. | **[`google-ai-edge/LiteRT-CLI`](https://github.com/google-ai-edge/LiteRT-CLI)** | Unified command-line tool (`litert`) to download, convert, quantize, run, and benchmark models locally or on cloud device farms (`--ddp`). | `litert` CLI |
  63. | **[`google-ai-edge/litert-torch`](https://github.com/google-ai-edge/litert-torch)** & **[`ai-edge-quantizer`](https://github.com/google-ai-edge/ai-edge-quantizer)** | PyTorch-to-LiteRT converter, Generative Torch API for re-authoring LLMs, and accuracy-safe PTQ/quantization toolkit (`fp16` / `int8` / `int4`). | Python SDK |
  64. | **[`google-ai-edge/gallery`](https://github.com/google-ai-edge/gallery)** & **[`model-explorer`](https://github.com/google-ai-edge/model-explorer)** | End-user showcase app for trying local GenAI models (`gallery`) and interactive hierarchical graph visualizer/debugger (`model-explorer`). | App & Visualizer |
  65. ---
  66. ## 🤗 Hugging Face `litert-community` Hub
  67. Every sample application, web demo, and recipe in this repository is tightly integrated with **[Hugging Face `litert-community`](https://huggingface.co/litert-community)** — no manual conversion is required to get started, and no heavy model weights are bloated into git history.
  68. ### 🧭 Discover & Compare Models Instantly
  69. | Interactive Portal | What You Can Do | Source in This Repo |
  70. | :--- | :--- | :--- |
  71. | **[🤗 `litert-community` Organization](https://huggingface.co/litert-community)** | Browse **400+ pre-converted models** across LLMs, VLMs, ASR, TTS, Image Generation, Detection, Segmentation, and Depth. | [`models/`](models/) |
  72. | **[🔍 Find Your Models (HF Space)](https://huggingface.co/spaces/litert-community/find-your-models)** | Filter every `litert-community` model by family, parameter size, task, on-device latency/tokens-per-sec, conversion recipe, and copy ready-to-run `litert` CLI commands. | [`community/models_page/`](community/models_page/) |
  73. | **[📈 Trending & Weekly Picks (HF Space)](https://huggingface.co/spaces/litert-community/trending-models)** | Track trending & newest edge models, weekly community picks, matching apps in `litert-samples`, and live browser Spaces. | [`community/trending_page/`](community/trending_page/) |
  74. ### 🌟 Featured Model Families on `litert-community`
  75. | Modality | Featured Models on `litert-community` | Format | Matching Sample / Recipe in `litert-samples` |
  76. | :--- | :--- | :---: | :--- |
  77. | **Multimodal & Text LLMs** | [Gemma 4 (E2B / E4B / 12B)](https://huggingface.co/collections/litert-community/gemma-family), [Gemma 3 1B](https://huggingface.co/litert-community/Gemma3-1B-IT), [Qwen 3.5 & Qwen 3 (0.6B–4B)](https://huggingface.co/collections/litert-community/qwen-family), [DeepSeek-R1-Distill-Qwen-1.5B](https://huggingface.co/litert-community/DeepSeek-R1-Distill-Qwen-1.5B), [Phi-4-mini](https://huggingface.co/litert-community/Phi-4-mini-instruct), [MiniCPM5-2B](https://huggingface.co/litert-community/MiniCPM5-2B), [Nemotron-3-Nano-4B](https://huggingface.co/litert-community/Nemotron-3-Nano-4B), [Hy-MT2-1.8B](https://huggingface.co/litert-community/Hy-MT2-1.8B), [FastVLM-0.5B](https://huggingface.co/litert-community/FastVLM-0.5B) | `.litertlm` | [`flutter/`](samples/litert/flutter/), [`flutter_intel_npu/`](samples/litert/flutter_intel_npu/), [`voice_assistant/`](samples/litert_lm/voice_assistant/), [`qualcomm/`](samples/litert/qualcomm/), [`google/sample_app_tpu/`](samples/litert/google/sample_app_tpu/), [`models/`](models/) |
  78. | **Embeddings & NLP** | [EmbeddingGemma 2 (270M / 440M / 740M)](https://huggingface.co/litert-community/embeddinggemma-2-740m-litert-lm), [Laya Multilingual](https://huggingface.co/litert-community/Laya-Multilingual-LiteRT), [GLiNER2.5-Small](https://huggingface.co/litert-community/GLiNER2.5-Small-LiteRT), [GLiClass-Edge](https://huggingface.co/litert-community/GLiClass-Edge-v3.0-LiteRT) | `.litertlm` / `.tflite` | [`semantic_similarity/`](samples/litert/semantic_similarity/), [`zero_shot_classification/`](samples/litert/zero_shot_classification/), [`litert_model_zoo/`](samples/litert_model_zoo/), [`models/gliner/`](models/gliner/gliner2_5_small/) |
  79. | **Speech & Audio (ASR / TTS)** | [Parakeet TDT & CTC 0.6B](https://huggingface.co/collections/litert-community/asr), [Whisper Tiny/Base](https://huggingface.co/litert-community/whisper-tiny), [Moonshine Tiny](https://huggingface.co/litert-community/moonshine-tiny), [Zipformer CR-CTC](https://huggingface.co/litert-community/Zipformer-medium-CR-CTC-LiteRT), [Qwen3-ASR-0.6B](https://huggingface.co/litert-community/Qwen3-ASR-0.6B), [Qwen3-TTS-0.6B](https://huggingface.co/litert-community/Qwen3-TTS-12Hz-0.6B-Base), [Matcha-TTS](https://huggingface.co/litert-community/Matcha-TTS), [KittenTTS Nano](https://huggingface.co/litert-community/kitten-tts-nano-0.8) | `.tflite` | [`speech_recognition/`](samples/litert/speech_recognition/), [`text_to_speech_lm/`](samples/litert/text_to_speech_lm/), [`text_to_speech_streaming/`](samples/litert/text_to_speech_streaming/), [`text_to_speech/`](samples/litert/text_to_speech/), [`web_demos/matcha-tts/`](samples/web_demos/) |
  80. | **Image Gen & Vision** | [Bonsai-Image-ternary-4B](https://huggingface.co/litert-community/Bonsai-Image-ternary-4B), [FLUX.2-klein-4B](https://huggingface.co/litert-community/FLUX.2-klein-4B-LiteRT), [SAM 2.1 Tiny](https://huggingface.co/litert-community/SAM2.1-Hiera-Tiny-Image-Encoder), [CLIPSeg](https://huggingface.co/litert-community/CLIPSeg-rd64-LiteRT), [MoGe-2 3D](https://huggingface.co/litert-community/MoGe-2-LiteRT), [PP-OCRv5](https://huggingface.co/litert-community/PP-OCRv5-LiteRT), [RF-DETR Nano](https://huggingface.co/litert-community/RF-DETR-Nano-LiteRT), [Depth Anything 3](https://huggingface.co/litert-community/Depth-Anything-3-Small-LiteRT) | `.tflite` | [`image_generation/`](samples/litert/image_generation/), [`image_segmentation/`](samples/litert/image_segmentation/), [`litert_model_zoo/`](samples/litert_model_zoo/), [`web_demos/`](samples/web_demos/), [`models/bonsai/`](models/bonsai/bonsai_image_4b/) |
  81. > 💡 **Browse by Hardware & Platform Collections on Hugging Face:**
  82. > [Android](https://huggingface.co/collections/litert-community/android-models-68c1d00fa08404b27e420a2e) •
  83. > [iOS](https://huggingface.co/collections/litert-community/ios-models-68c1d24793b4f12a3d948a21) •
  84. > [Web LLM](https://huggingface.co/collections/litert-community/web-llm-models-68c1d5e66b5461ef41bc4943) •
  85. > [Web Classical](https://huggingface.co/collections/litert-community/web-classical-models-6a1fc1ba70a35860474350ad) •
  86. > [Desktop](https://huggingface.co/collections/litert-community/desktop-models-68c1d70d39c6ba3310f6e194) •
  87. > [Google Tensor TPU](https://huggingface.co/collections/litert-community/google-tensor-69fd6b0b02e7eee8a3ab9ff6) •
  88. > [Qualcomm NPU](https://huggingface.co/collections/litert-community/qualcomm-69f263c83ee387580cb6d118)
  89. ---
  90. ## 🚀 Getting Started: From Zero to Production
  91. We organized this repository **progressively** so you can start at the depth that matches your goal:
  92. 1. **[Level 1 — Zero Install (30s)](#-level-1--try-in-your-browser-zero-install)**: Run client-side WebGPU/WASM demos right in your browser.
  93. 2. **[Level 2 — 3-Minute CLI Quickstart](#-level-2--run--benchmark-from-the-terminal-3-minutes)**: Download, run, and benchmark any `litert-community` model in 3 commands.
  94. 3. **[Level 3 — Run & Build Sample Apps](#-level-3--explore-sample-applications)**: Build full apps for Android, iOS, Flutter, macOS, Windows, Linux, Web, and Raspberry Pi.
  95. 4. **[Level 4 — Convert & Quantize Models](#-level-4--convert--quantize-models-models)**: Turn Hugging Face / PyTorch checkpoints into verified `.litertlm` and `.tflite` artifacts.
  96. 5. **[Level 5 — Agent Skills & Cloud Device Farm](#-level-5--automate-with-ai-agent-skills--ddp-benchmarks)**: Automate the entire lifecycle with AI coding agents and benchmark on real cloud phones.
  97. ---
  98. ### 🌐 Level 1 — Try in Your Browser (Zero Install)
  99. Experience LiteRT running **100% client-side** in your browser via **[LiteRT.js](https://www.npmjs.com/package/@litertjs/core)** (WebGPU + multi-threaded WASM) with weights streamed directly from `litert-community`:
  100. * **[Interactive Samples Portal (`google-ai-edge.github.io/litert-samples`)](https://google-ai-edge.github.io/litert-samples/)**: Unified showcase of web demos and interactive playgrounds.
  101. * **[Client-Side Web Demos (`samples/web_demos/`)](samples/web_demos/)** *(also available on [HF Spaces Demos](https://huggingface.co/collections/litert-community/demos-68efdb213c93efee10c2116f))*:
  102. * 🖱️ **[SAM 2.1 Click-to-Segment](https://huggingface.co/spaces/litert-community/sam2-1-tiny-click-to-segment)** (`~60 ms` encoder / `~4 ms` per click on WebGPU) — [Source](samples/web_demos/src/sam2/)
  103. * 🎯 **[CLIPSeg Open-Vocabulary Segmentation](https://huggingface.co/spaces/litert-community/clipseg-text-prompted-segmentation)** (Segment any photo by typing text prompts) — [Source](samples/web_demos/src/clipseg/)
  104. * 🧊 **[MoGe-2 Photo-to-3D Point Cloud](https://huggingface.co/spaces/litert-community/moge-2-photo-to-3d)** (Monocular geometry rendered in interactive Three.js) — [Source](samples/web_demos/src/moge/)
  105. * 📄 **[PP-OCRv5 Document & Screenshot OCR](https://huggingface.co/spaces/litert-community/pp-ocrv5-image-to-text)** (Text detection + recognition in browser) — [Source](samples/web_demos/src/ppocr/)
  106. * 🗣️ **[Matcha-TTS Neural Speech Synthesis](https://huggingface.co/spaces/litert-community/matcha-tts-text-to-speech)** (Flow-matching TTS + HiFi-GAN vocoder at 22 kHz) — [Source](samples/web_demos/src/matcha-tts/)
  107. * 🧩 **[LiteRT Chrome Extension](samples/web_demos/chrome_extension/)**: Run MoGe-2 3D hover, PP-OCRv5, and Matcha-TTS on any webpage you browse.
  108. * **[C++ Tensor API Web Playground (`samples/tensor_api_playground/`)](samples/tensor_api_playground/)**: Interactive browser sandbox demonstrating C++ LiteRT Tensor API programs compiled to WebAssembly (Gemma 3, Image Segmentation, Mandelbrot, Game of Life).
  109. ---
  110. ### ⚡ Level 2 — Run & Benchmark from the Terminal (3 Minutes)
  111. Use **[LiteRT-CLI (`litert`)](https://github.com/google-ai-edge/LiteRT-CLI)** or **[LiteRT-LM (`litert-lm`)](https://github.com/google-ai-edge/LiteRT-LM)** to pull any model from `litert-community` and run or benchmark it immediately:
  112. ```bash
  113. # 1. Install LiteRT-CLI and LiteRT-LM
  114. pip install litert-cli-nightly
  115. # 2. Run an LLM (.litertlm) from Hugging Face litert-community
  116. litert download litert-community/Qwen3-0.6B
  117. litert lm run Qwen3-0.6B.litertlm --prompt "Explain on-device AI in two sentences."
  118. # 3. Benchmark any .tflite or .litertlm model locally or on real cloud phones (--ddp)
  119. litert download litert-community/efficientnet_b1
  120. litert benchmark efficientnet_b1.tflite --gpu
  121. ```
  122. > ☁️ **No phone attached?** Run benchmarks on real physical Android & iOS devices in Google Cloud's **Developer Device Platform (DDP)** directly from Colab — see **[`benchmark/developer_device_platform/`](benchmark/developer_device_platform/)**.
  123. ---
  124. ### 📱 Level 3 — Explore Sample Applications
  125. All runnable applications live under **[`samples/`](samples/)**. New applications use the **LiteRT `CompiledModel` API** (for `.tflite` models with automatic GPU/NPU acceleration and zero-copy buffers) and **LiteRT-LM** (for `.litertlm` generative models).
  126. #### 🌟 Flagship Multi-Model & Cross-Platform Apps
  127. | Sample App | Highlights & Modality | Platforms & Accelerators | Models Used (`litert-community`) |
  128. | :--- | :--- | :--- | :--- |
  129. | **[`samples/litert_model_zoo/`](samples/litert_model_zoo/)** | **34 Tasks in One Android App** (21 Vision, 8 Audio, 5 Text Decision). On-demand SHA-256 verified downloads from HF, live latency/backend cards, 122 JVM tests. | Android (`CompiledModel` GPU / CPU) | 34 repos on `litert-community` (RF-DETR, PIDNet, MODNet, DINOv2, PP-OCRv5, Depth Anything 3, Zipformer, Matcha-TTS, Laya, etc.) |
  130. | **[`samples/litert/flutter/`](samples/litert/flutter/)** | **All-in-One Edge AI Assistant**: Spoken voice chat, live camera object detection + visual memory, local RAG knowledge base, and function-calling agent skills. | Android, iOS, macOS, Linux, Windows, Raspberry Pi 5, Jetson Orin, Qualcomm VENTUNO Q, Intel Core Ultra PCs (CPU / GPU / NPU) | [Gemma 4 E2B](https://huggingface.co/litert-community/gemma-4-E2B-it-litert-lm), [EmbeddingGemma 2](https://huggingface.co/litert-community/embeddinggemma-2-740m-litert-lm), [Whisper Base](https://huggingface.co/litert-community/whisper-base), [Moonshine Tiny](https://huggingface.co/litert-community/moonshine-tiny), [Inflect-Nano-v2](https://huggingface.co/litert-community/Inflect-Nano-v2), YOLO26n |
  131. | **[`samples/litert/flutter_intel_npu/`](samples/litert/flutter_intel_npu/)** | **3-Act Hardware Showcase**: Compare CPU vs. GPU vs. Intel Core Ultra NPU in a live speed race, 45-min transcript Q&A, and live 3D scene narration. | Windows 11 (Intel Core Ultra CPU / GPU / NPU), macOS (CPU / Metal GPU) | [Gemma 4 E2B](https://huggingface.co/litert-community/gemma-4-E2B-it-litert-lm) & [Gemma 4 12B](https://huggingface.co/litert-community/gemma-4-12B-it-litert-lm) |
  132. | **[`samples/litert_lm/voice_assistant/`](samples/litert_lm/voice_assistant/)** | **100% Offline Voice Agent**: Listens to speech, executes device tool calls (alarm, timer, calendar), and speaks back offline. | Android (Kotlin) | [Gemma 4 E2B](https://huggingface.co/litert-community/gemma-4-E2B-it-litert-lm) + [Zipformer CR-CTC](https://huggingface.co/litert-community/Zipformer-medium-CR-CTC-LiteRT) + [KittenTTS Nano](https://huggingface.co/litert-community/kitten-tts-nano-0.8) |
  133. | **[`samples/litert_lm/reachy-voice-robot/`](samples/litert_lm/reachy-voice-robot/)** | **Embodied Voice Robot**: Sees via camera, hears questions, reasons with Gemma, and speaks aloud on Raspberry Pi. | Raspberry Pi (Python) | [Gemma 4 E2B](https://huggingface.co/litert-community/gemma-4-E2B-it-litert-lm) + [Moonshine Tiny](https://huggingface.co/litert-community/moonshine-tiny) + [Inflect-Nano-v2](https://huggingface.co/litert-community/Inflect-Nano-v2) + YOLO26 |
  134. | **[`samples/litert/phototalk_sample_app/`](samples/litert/phototalk_sample_app/)** | **Vision + LLM Pipeline**: Combines `CompiledModel` image classification with `LiteRT-LM` multimodal conversation. | Android (Kotlin) | EfficientNet-Lite0 + [Gemma 4 E2B](https://huggingface.co/litert-community/gemma-4-E2B-it-litert-lm) / [Gemma 3 1B](https://huggingface.co/litert-community/Gemma3-1B-IT) / [FastVLM-0.5B](https://huggingface.co/litert-community/FastVLM-0.5B) |
  135. #### ⚡ NPU & TPU Hardware-Accelerated Samples
  136. | Sample Directory | Target Silicon | What It Demonstrates |
  137. | :--- | :--- | :--- |
  138. | **[`samples/litert/google/sample_app_tpu/`](samples/litert/google/sample_app_tpu/)** | **Google Tensor TPU** (Pixel) | Multimodal chat with [Gemma 4 E2B (`gemma-4-E2B-it_Google_Tensor_G5.litertlm`)](https://huggingface.co/litert-community/gemma-4-E2B-it-litert-lm) on Pixel Tensor TPU. |
  139. | **[`samples/litert/qualcomm/llm_chatbot_npu/`](samples/litert/qualcomm/llm_chatbot_npu/)** | **Qualcomm Snapdragon NPU** | Multimodal chat (text, image, audio) with [Gemma 4 E2B](https://huggingface.co/litert-community/gemma-4-E2B-it-litert-lm) and [FastVLM-0.5B](https://huggingface.co/litert-community/FastVLM-0.5B) on Snapdragon 8 Elite NPU. |
  140. | **[`samples/litert/qualcomm/gemma3/`](samples/litert/qualcomm/gemma3/)** & **[`gemma4/`](samples/litert/qualcomm/gemma4/)** & **[`fast_vlm/`](samples/litert/qualcomm/fast_vlm/)** | **Qualcomm NPU / GPU / CPU** | Dedicated [Gemma 3 1B](https://huggingface.co/litert-community/Gemma3-1B-IT), [Gemma 4 E2B](https://huggingface.co/litert-community/gemma-4-E2B-it-litert-lm), and FastVLM 0.5B Android apps with NPU compilation guides. |
  141. | **[`samples/litert/qualcomm/mobilenet_v2/`](samples/litert/qualcomm/mobilenet_v2/)** & **[`object_detection/`](samples/litert/qualcomm/object_detection/efficientdet/kotlin_npu/)** | **Qualcomm NPU (JIT & AOT)** | Zero-config on-device JIT NPU compilation (MobileNet-v2) and live camera NPU object detection (EfficientDet-Lite0). |
  142. | **[`samples/litert/colab/`](samples/litert/colab/LiteRT_AOT_Compilation_Tutorial.ipynb)** | **Multi-Vendor NPU AOT** | Interactive Colab tutorial for Ahead-of-Time (AOT) NPU compilation with LiteRT. |
  143. #### 🎨 Vision, Speech, Audio & Text Task Samples (`samples/litert/`)
  144. | Sample | Task | Platforms | `litert-community` Model(s) |
  145. | :--- | :--- | :--- | :--- |
  146. | **[`speech_recognition/`](samples/litert/speech_recognition/)** | Multi-model Automatic Speech Recognition (ASR) | Android, Python | [Parakeet TDT/CTC 0.6B](https://huggingface.co/litert-community/parakeet-tdt-0.6b-v3), [Whisper Tiny](https://huggingface.co/litert-community/whisper-tiny), [Moonshine Tiny](https://huggingface.co/litert-community/moonshine-tiny), [Qwen3-ASR-0.6B](https://huggingface.co/litert-community/Qwen3-ASR-0.6B) |
  147. | **[`text_to_speech_lm/`](samples/litert/text_to_speech_lm/)** | LLM-based TTS with zero-shot voice cloning | Android, Python | [Qwen3-TTS-12Hz-0.6B-Base](https://huggingface.co/litert-community/Qwen3-TTS-12Hz-0.6B-Base) |
  148. | **[`text_to_speech_streaming/`](samples/litert/text_to_speech_streaming/)** | Ultra-light (15M, 32 MB) sentence-streaming TTS with live TTFA/RTF metrics | Android, Python | [KittenTTS Nano](https://huggingface.co/litert-community/kitten-tts-nano-0.8) + [Matcha-TTS G2P](https://huggingface.co/litert-community/Matcha-TTS) |
  149. | **[`text_to_speech/`](samples/litert/text_to_speech/)** | Fast neural Text-to-Speech | Android, iOS | [Matcha-TTS](https://huggingface.co/litert-community/Matcha-TTS) |
  150. | **[`image_generation/`](samples/litert/image_generation/)** | On-device Text-to-Image diffusion | iOS, macOS | [Bonsai-Image-ternary-4B](https://huggingface.co/litert-community/Bonsai-Image-ternary-4B) |
  151. | **[`image_segmentation/`](samples/litert/image_segmentation/)** | Real-time camera segmentation (CPU, GPU, NPU JIT/AOT) | Android (Kotlin & C++), iOS (Swift) | [MediaPipe-Selfie-Segmentation](https://huggingface.co/litert-community/MediaPipe-Selfie-Segmentation) |
  152. | **[`zero_shot_classification/`](samples/litert/zero_shot_classification/)** | Runtime-defined zero-shot text decisions (choice, score, yes/no) | Android (CPU / GPU / NPU JIT) | [Laya-Multilingual-LiteRT](https://huggingface.co/litert-community/Laya-Multilingual-LiteRT) |
  153. | **[`semantic_similarity/`](samples/litert/semantic_similarity/)** | C++ sentence embedding & similarity | Linux, Android (C++) | [embeddinggemma-300m](https://huggingface.co/litert-community/embeddinggemma-300m) |
  154. | **[`image_classification/`](samples/litert/image_classification/)**, **[`text_classification/`](samples/litert/text_classification/)**, **[`digit_classifier/`](samples/litert/digit_classifier/)** | Starter `CompiledModel` API templates for Vision & Text | Android | EfficientNet-Lite, BERT Classifier, MNIST |
  155. | **[`samples/end_to_end/imagenet/`](samples/end_to_end/imagenet/)** | End-to-end PyTorch conversion → preprocessing → evaluation pipeline | Python / Android | ImageNet classifiers |
  156. #### 🖥️ Dedicated Hardware & Platform Setup Guides (`samples/platforms/`)
  157. Step-by-step instructions to build, deploy, and run LiteRT & LiteRT-LM demos on specific hardware targets:
  158. * 🤖 **[Android Phones (`samples/platforms/android/`)](samples/platforms/android/)** — GPU, CPU, and Snapdragon NPU setup.
  159. * 🍎 **[iPhone / iOS (`samples/platforms/ios/`)](samples/platforms/ios/)** — Xcode signing and Metal GPU acceleration.
  160. * 🟢 **[NVIDIA Jetson Orin (`samples/platforms/nvidia/`)](samples/platforms/nvidia/)** — Edge Linux GPU deployment.
  161. * 🔌 **[Qualcomm / Arduino VENTUNO Q (`samples/platforms/qualcomm/ventuno/`)](samples/platforms/qualcomm/ventuno/)** — Development board NPU/CPU guide.
  162. * 🍓 **[Raspberry Pi 5 (`samples/platforms/raspberry/`)](samples/platforms/raspberry/)** — Embedded Linux setup for voice & vision agents.
  163. * 💻 **[Intel Core Ultra PCs, Windows (`samples/platforms/intel/`)](samples/platforms/intel/)** — Windows build with the Intel NPU, GPU and CPU.
  164. ---
  165. ### 🧪 Level 4 — Convert & Quantize Models (`models/`)
  166. Want to bring a new Hugging Face checkpoint to LiteRT and publish it to `litert-community`? Start with the **[Model Conversion Cookbook (`models/conversion.md`)](models/conversion.md)**.
  167. #### Two Conversion Lanes + C++ Tensor API
  168. | Model Type | Output Artifact | Target Runtime | Guide & Tooling |
  169. | :--- | :---: | :--- | :--- |
  170. | **Text LLMs & Multimodal VLMs** | `.litertlm` bundle | [LiteRT-LM](https://github.com/google-ai-edge/LiteRT-LM) | [Cookbook §1–11](models/conversion.md) + [`litert-conversion-workflow`](skills/litert-conversion-workflow/) |
  171. | **Vision, Audio, Diffusion & Encoders** | `.tflite` graph(s) | [LiteRT `CompiledModel` API](https://github.com/google-ai-edge/LiteRT) | [Cookbook §12](models/conversion.md#12-other-models-the-tflite-lane) + [`utilities/litert_gpu_toolkit/`](utilities/litert_gpu_toolkit/) |
  172. | **Zero-Converter C++ Graphs** | Native C++ binary / WASM | [LiteRT Tensor API](https://github.com/google-ai-edge/LiteRT/tree/main/tensor) | `models/*/tensor_api/` & [`samples/tensor_api_playground/`](samples/tensor_api_playground/) |
  173. #### Worked Model Recipes in `models/`
  174. Each directory under [`models/`](models/) is a complete, reproducible recipe containing export scripts, numerical parity checks against the source checkpoint, and published weights on Hugging Face:
  175. | Recipe Directory | Task & Architecture | Artifact | Source Checkpoint | Published Weights on Hugging Face |
  176. | :--- | :--- | :---: | :--- | :--- |
  177. | **[`models/minicpm/minicpm5_2b/`](models/minicpm/minicpm5_2b/)** | Chat LLM with optional `<think>` reasoning (CPU & GPU) | `.litertlm` | [`openbmb/MiniCPM5-2B`](https://huggingface.co/openbmb/MiniCPM5-2B) | [`litert-community/MiniCPM5-2B`](https://huggingface.co/litert-community/MiniCPM5-2B) |
  178. | **[`models/hunyuan/hy_mt2_1_8b/`](models/hunyuan/hy_mt2_1_8b/)** | 33-language Translation LLM (CPU & GPU) | `.litertlm` | [`tencent/Hy-MT2-1.8B`](https://huggingface.co/tencent/Hy-MT2-1.8B) | [`litert-community/Hy-MT2-1.8B`](https://huggingface.co/litert-community/Hy-MT2-1.8B) |
  179. | **[`models/nemotron/nemotron_3_nano_4b/`](models/nemotron/nemotron_3_nano_4b/)** | Mamba2-Attention Hybrid Reasoning LLM | `.litertlm` | [`nvidia/NVIDIA-Nemotron-3-Nano-4B-BF16`](https://huggingface.co/nvidia/NVIDIA-Nemotron-3-Nano-4B-BF16) | [`litert-community/Nemotron-3-Nano-4B`](https://huggingface.co/litert-community/Nemotron-3-Nano-4B) |
  180. | **[`models/bonsai/bonsai_image_4b/`](models/bonsai/bonsai_image_4b/)** | Ternary 4B Text-to-Image Diffusion (3 graphs + host loop) | `.tflite` | [`prism-ml/bonsai-image-ternary-4B-unpacked`](https://huggingface.co/prism-ml/bonsai-image-ternary-4B-unpacked) | [`litert-community/Bonsai-Image-ternary-4B`](https://huggingface.co/litert-community/Bonsai-Image-ternary-4B) |
  181. | **[`models/qwen/qwen3_tts/`](models/qwen/qwen3_tts/)** | Qwen3-TTS 0.6B Speech Synthesis (3 graphs + C++ Tensor API) | `.tflite` & Tensor API | [`Qwen/Qwen3-TTS-12Hz-0.6B-Base`](https://huggingface.co/Qwen/Qwen3-TTS-12Hz-0.6B-Base) | [`litert-community/Qwen3-TTS-12Hz-0.6B-Base`](https://huggingface.co/litert-community/Qwen3-TTS-12Hz-0.6B-Base) |
  182. | **[`models/sam3/sam3_image/`](models/sam3/sam3_image/converted/)** | Text-prompted Detection & Segmentation (3 GPU-resident graphs) | `.tflite` | [`facebookresearch/sam3`](https://github.com/facebookresearch/sam3) | [`mlboydaisuke/SAM3-LiteRT`](https://huggingface.co/mlboydaisuke/SAM3-LiteRT) |
  183. | **[`models/zipformer/zipformer_ctc/`](models/zipformer/zipformer_ctc/)** | Streaming/Offline Speech Recognition (Zipformer-medium CR-CTC) | `.tflite` | [`Zengwei/icefall-asr-...`](https://huggingface.co/Zengwei/icefall-asr-librispeech-zipformer-medium-cr-ctc-20241018) | [`litert-community/Zipformer-medium-CR-CTC-LiteRT`](https://huggingface.co/litert-community/Zipformer-medium-CR-CTC-LiteRT) |
  184. | **[`models/wav2vec2/wav2vec2_kws/`](models/wav2vec2/wav2vec2_kws/)** | Keyword Spotting (wav2vec2 2-graph split) | `.tflite` | [`superb/wav2vec2-base-superb-ks`](https://huggingface.co/superb/wav2vec2-base-superb-ks) | [`litert-community/wav2vec2-keyword-spotting`](https://huggingface.co/litert-community/wav2vec2-keyword-spotting) |
  185. | **[`models/gliner/gliner2_5_small/`](models/gliner/gliner2_5_small/)** | Zero-shot Named Entity Extraction (GLiNER2.5 Small) | `.tflite` | [`fastino/gliner2.5-small-v1`](https://huggingface.co/fastino/gliner2.5-small-v1) | [`litert-community/GLiNER2.5-Small-LiteRT`](https://huggingface.co/litert-community/GLiNER2.5-Small-LiteRT) |
  186. | **[`models/sam2/sam2_hiera_tiny_video/`](models/sam2/sam2_hiera_tiny_video/)** | Video & Image Object Tracking (C++ Tensor API, iOS & Web Demo) | Tensor API | SAM 2.1 Hiera-Tiny | [`SAM2.1-Hiera-Tiny-Image-Encoder`](https://huggingface.co/litert-community/SAM2.1-Hiera-Tiny-Image-Encoder) |
  187. | **[`models/llada/llada_8b/tensor_api/`](models/llada/llada_8b/tensor_api/)** | Diffusion Language Model Denoise Step (LLaDA-8B) | Tensor API | LLaDA-8B | — |
  188. ---
  189. ### 🤖 Level 5 — Automate with AI Agent Skills & DDP Benchmarks
  190. #### 1. AI Coding Agent Skills (`skills/`)
  191. Point your AI coding agent (Claude Code, Gemini CLI, Cursor, etc.) at **[`skills/`](skills/)** to automate model conversion, GPU surgical patching, quantization, verification, benchmarking, and Android app generation.
  192. * **Model Lifecycle Skills (in execution order)**:
  193. 1. [`skills/litert-conversion-workflow/`](skills/litert-conversion-workflow/) — Convert HF LLM/VLM checkpoints into verified `.litertlm` bundles (architecture classification, export, chat templates, quality gates).
  194. 2. [`skills/gpu-clean-conversion/`](skills/gpu-clean-conversion/) — Convert PyTorch/HF models into 100% GPU-resident `.tflite` graphs using [`utilities/litert_gpu_toolkit/`](utilities/litert_gpu_toolkit/).
  195. 3. [`skills/accuracy-safe-quantization/`](skills/accuracy-safe-quantization/) — Quantize (`fp16` / `int8` / `int4`) with `ai-edge-quantizer` while enforcing numerical parity against float reference.
  196. 4. [`skills/on-device-verification/`](skills/on-device-verification/) — Verify GPU residency, numerical accuracy, and multi-turn stability on physical devices.
  197. 5. [`skills/benchmark-on-ddp/`](skills/benchmark-on-ddp/) — Benchmark models on Google Cloud Developer Device Platform (DDP) phones or macOS and update the leaderboard.
  198. 6. [`skills/compiled-model-app-scaffolding/`](skills/compiled-model-app-scaffolding/) — Scaffold a production Android app (Kotlin, Jetpack Compose, `CompiledModelRunner`) around a verified model.
  199. 7. [`skills/litert-compiled-model-migration/`](skills/litert-compiled-model-migration/) — Migrate legacy TensorFlow Lite (`Interpreter`) Android apps to LiteRT `CompiledModel` V2 with zero-copy buffers and NPU JIT.
  200. * **Android App Developer Skills (a mirror of [`android/skills`](https://github.com/android/skills/tree/main/device-ai/litert) `device-ai/litert`, device-tested via [`skills/android/tests/`](skills/android/tests/))**:
  201. * [`skills/android/litert-runtime/`](skills/android/litert-runtime/) — Build an Android app running a `.tflite` model on CPU/GPU via `CompiledModel`.
  202. * [`skills/android/litert-lm/`](skills/android/litert-lm/) — Build an Android app running a `.litertlm` model from `litert-community` with streaming multi-turn chat.
  203. #### 2. Real-Device Cloud Benchmarking (`benchmark/`)
  204. Don't have a fleet of test phones? Run reproducible benchmarks on real phones in Google Cloud's **Developer Device Platform (DDP)** straight from your browser:
  205. | Resource | Description | Launch |
  206. | :--- | :--- | :---: |
  207. | **[`litert_cli_benchmark.ipynb`](benchmark/developer_device_platform/litert_cli_benchmark.ipynb)** | Benchmark any `litert-community` `.tflite` or `.litertlm` model on cloud phones with `litert benchmark --ddp`. | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/google-ai-edge/litert-samples/blob/main/benchmark/developer_device_platform/litert_cli_benchmark.ipynb) |
  208. | **[`ddp_cli_benchmark.ipynb`](benchmark/developer_device_platform/ddp_cli_benchmark.ipynb)** | Multi-device fleet benchmarking for [Gemma 4 E2B](https://huggingface.co/litert-community/gemma-4-E2B-it-litert-lm) using `gcloud beta device-run` with warmup & cooldown control. | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/google-ai-edge/litert-samples/blob/main/benchmark/developer_device_platform/ddp_cli_benchmark.ipynb) |
  209. | **[`embedding_gemma_ddp_benchmark.ipynb`](benchmark/developer_device_platform/embedding_gemma_ddp_benchmark.ipynb)** | Benchmark tri-modal (text + image + audio) [EmbeddingGemma](https://huggingface.co/litert-community/embeddinggemma-2-740m-litert-lm) on DDP devices. | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/google-ai-edge/litert-samples/blob/main/benchmark/developer_device_platform/embedding_gemma_ddp_benchmark.ipynb) |
  210. | **[`benchmark/leaderboard/`](benchmark/leaderboard/)** & **[`benchmark/ios/`](benchmark/ios/)** | Data-driven [Performance Leaderboard](https://google-ai-edge.github.io/litert-samples/benchmark/leaderboard/) and iOS XCTest / Metal benchmark harness. | [View Leaderboard](https://google-ai-edge.github.io/litert-samples/benchmark/leaderboard/) |
  211. ---
  212. ## 📂 Repository Structure
  213. ```text
  214. litert-samples/
  215. ├── samples/ # 📱 Runnable sample applications across platforms
  216. │ ├── litert/ # Core LiteRT CompiledModel API & NPU/GPU samples (Android, iOS, Flutter, C++, Python)
  217. │ ├── litert_model_zoo/ # 34-task Android Model Zoo app streaming on-demand from HF litert-community
  218. │ ├── litert_lm/ # LiteRT-LM agentic showcases (Offline Android Voice Assistant, Raspberry Pi Reachy Robot)
  219. │ ├── web_demos/ # Client-side WebGPU/WASM demos (@litertjs/core) + Chrome Extension
  220. │ ├── tensor_api_playground/ # Interactive browser playground for the C++ LiteRT Tensor API
  221. │ ├── platforms/ # Hardware setup guides (Android, iOS, NVIDIA Jetson, Qualcomm VENTUNO Q, Raspberry Pi, Intel PCs)
  222. │ ├── end_to_end/ # Full conversion-to-deployment pipelines (ImageNet)
  223. │ └── litert_interpreter/ # Legacy TensorFlow Lite Interpreter API reference samples (maintenance mode)
  224. ├── models/ # 🧪 End-to-end model conversion recipes & verification gates
  225. │ ├── conversion.md # Step-by-step Model Conversion Cookbook (.litertlm & .tflite)
  226. │ └── <family>/<model>/ # Reproducible export, quantization & verification recipes linked to litert-community
  227. ├── skills/ # 🤖 SKILL.md playbooks for AI coding agents (convert, quantize, verify, benchmark, scaffold)
  228. ├── benchmark/ # 🏆 Real-device performance benchmarking suite
  229. │ ├── leaderboard/ # Live performance leaderboard UI & measurement datasets (Android, iOS, macOS)
  230. │ ├── developer_device_platform/ # Colab notebooks for benchmarking on Google Cloud DDP real phones
  231. │ ├── ios/ # Xcode / XCTest benchmark framework for local & DDP iPhones
  232. │ └── driver/ # Matrix runners and result collectors for building leaderboard rows
  233. ├── community/ # 🤗 Source apps for Hugging Face litert-community Spaces
  234. │ ├── models_page/ # Powers huggingface.co/spaces/litert-community/find-your-models
  235. │ └── trending_page/ # Powers huggingface.co/spaces/litert-community/trending-models
  236. └── utilities/ # 🛠️ Shared libraries & conversion toolkits
  237. ├── common/ # Shared Kotlin helpers for Android (CompiledModelRunner, camera, audio, tensor math)
  238. └── litert_gpu_toolkit/ # PyTorch pre-conversion surgical patches & post-conversion GPU residency checker
  239. ```
  240. ---
  241. ## 🛑 AI Coding Directives (For Developers & Coding Agents)
  242. When authoring new application or inference code with LiteRT:
  243. * ✅ **MUST USE**: The **LiteRT `CompiledModel` API** for `.tflite` models (Kotlin, C++, Swift, Python, JS) and **[LiteRT-LM](https://github.com/google-ai-edge/LiteRT-LM)** for `.litertlm` LLM/VLM bundles.
  244. * ❌ **DO NOT USE**: The legacy TensorFlow Lite `Interpreter` API (`tflite::Interpreter`, `org.tensorflow.lite.Interpreter`, `tf.lite.Interpreter`) or manual delegate wiring. Samples under [`samples/litert_interpreter/`](samples/litert_interpreter/) are preserved only for legacy migration reference.
  245. * 🔄 **MIGRATING**: Follow the [LiteRT Migration Guide](https://ai.google.dev/edge/litert/migration) or run the [`litert-compiled-model-migration`](skills/litert-compiled-model-migration/) agent skill.
  246. ---
  247. ## 📚 Official Documentation & Resources
  248. * **LiteRT Developer Docs**: [ai.google.dev/edge/litert](https://ai.google.dev/edge/litert)
  249. * **LiteRT-LM Developer Docs**: [ai.google.dev/edge/litert-lm](https://ai.google.dev/edge/litert-lm)
  250. * **Unified NPU Acceleration**: [ai.google.dev/edge/litert/next/npu](https://ai.google.dev/edge/litert/next/npu)
  251. * **LiteRT for Web (`LiteRT.js`)**: [ai.google.dev/edge/litert/web](https://ai.google.dev/edge/litert/web)
  252. * **Hugging Face Community Hub**: [huggingface.co/litert-community](https://huggingface.co/litert-community)
  253. ---
  254. ## 🤝 Contributing & License
  255. Contributions of new sample apps, model conversion recipes, and community models are welcome!
  256. 1. Read [CONTRIBUTING.md](CONTRIBUTING.md) and [GOVERNANCE.md](GOVERNANCE.md).
  257. 2. To contribute a converted `.tflite` or `.litertlm` model, follow the [Model Conversion Cookbook](models/conversion.md) and publish to [Hugging Face `litert-community`](https://huggingface.co/litert-community).
  258. 3. Licensed under the **Apache License 2.0** — see [LICENSE](LICENSE) for details.
  259. *Disclaimer: This is a sample repository maintained by Google. It is provided "as is" without warranty of any kind.*

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.