google-ai-edge/litert-samples

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

What it solves

It provides a comprehensive collection of reference implementations, model recipes, and deployment tools for developers using LiteRT (formerly TensorFlow Lite) and LiteRT-LM. It bridges the gap between having a raw machine learning model and deploying it efficiently on-device (Android, iOS, Web) using hardware acceleration like GPUs and NPUs.

How it works

The repository is organized into four main functional areas:

  • Application Samples: Runnable apps demonstrating various APIs, including the modern CompiledModel API for hardware acceleration, the legacy Interpreter API, and specialized LLM orchestration via LiteRT-LM.
  • Model Recipes: Conversion scripts and "cookbooks" that guide users through transforming models from platforms like Hugging Face into optimized .litertlm or .tflite formats.
  • Utilities: Toolkits for GPU optimization, such as patching PyTorch patterns to be compatible with LiteRT GPU delegates.
  • Agent Skills: Automated workflows that handle the model lifecycle, including conversion, quantization, on-device verification, and app scaffolding.

Who it’s for

Mobile and web developers, as well as ML engineers, who want to deploy high-performance AI models (vision, audio, and LLMs) directly on end-user devices.

Highlights

  • Diverse Modality Support: Includes samples for streaming text-to-speech (KittenTTS), automatic speech recognition (ASR), text-to-image diffusion (Bonsai Image), and multimodal apps (PhotoTalk).
  • Hardware Acceleration: Specific focus on maximizing performance via GPU/NPU acceleration and zero-copy buffers.
  • End-to-End Pipelines: Provides full paths from Hugging Face checkpoints to verified on-device deployment.
  • Interactive Playground: A Web/WASM-based environment to test Tensor API capabilities directly in the browser.

Related

  • Project
  • Project
  • Project
  • Project
  • Project