Everything K-culture — comebacks to K-beauty, straight to your inboxGet it in your inbox

METAL MEDIA

google-ai-edge/LiteRT-CLI

35PythonApache-2.0

A single command-line tool to convert, shrink, and run edge AI models on any chip

LiteRT-CLI is a Google command-line tool that converts models like PyTorch into the LiteRT (formerly TFLite) format used on phones and desktops, shrinks them via quantization, pre-compiles them for specific chips, and runs, benchmarks, and visualizes them on real devices. It supports CPU, GPU, and NPU hardware across desktop, Android, and cloud platforms. It's still an early preview with limited platform and feature coverage.

What it does

  1. A single 'litert' command covers the whole model workflow: download, convert, quantize, compile, run, benchmark, and visualize
  2. It can download models from Hugging Face, convert PyTorch models into LiteRT format, shrink them with INT8/INT4 quantization, and ahead-of-time (AOT) compile them for specific chips like Qualcomm NPUs
  3. It can actually run models on CPU/GPU/NPU on Android devices or desktops, benchmark their latency, and visualize model structure using Model Explorer
  4. Large language models like Gemma can be run and benchmarked via the 'litert lm' command, and a skill file lets coding agents perform these tasks from natural-language prompts
  5. Currently 'compile' only works on Linux, some features are missing on macOS and Windows, and NPU support is limited to Qualcomm for now, with MediaTek and Google Tensor coming soon

Why it matters

Building and deploying edge AI models usually requires juggling separate tools for conversion, quantization, on-device testing, and benchmarking; this consolidates all of that into one CLI, speeding up development. Its integration with coding agents means optimization and deployment tasks can be automated through plain-language prompts, which is directly useful for practical workflows.

Terms in this repo

  • LiteRT · Google's lightweight AI model format for mobile and edge devices, formerly called TFLite
  • Quantization · A technique that reduces numeric precision (e.g., to INT8) to shrink model size and computation
  • NPU · A dedicated chip optimized for neural network computation
  • AOT compilation · Compiling a model in advance for specific hardware to reduce runtime startup delay
  • Model Explorer · Google's tool for visualizing the internal structure of AI models as a graph

Repository description (English)

A convenient CLI to streamline LiteRT related development workflows, including converting, quantizing, compiling, managing, running, benchmarking and visualizing LiteRT (TFLite) models on various hardwares (CPU / GPU / NPU) across platforms (desktop, mobile or cloud).

Owner · google-deepmind

Open on GitHub

Trending repos

All repos →

Latest from METAL MEDIA