LiteRT-LM is Google's production-ready, high-performance, open-source inference framework for deploying Large Language Models on edge devices. https://ai.google.dev/edge/litert-lm
  • C++ 71.3%
  • Python 7.3%
  • TypeScript 7.1%
  • Starlark 3.7%
  • CMake 2.8%
  • Other 7.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Google AI Edge 5731d7c07c Update dependencies of litert_lm
...
LiteRT-LM-PiperOrigin-RevId: 1030236728
2026-11-25 15:45:59 -08:00
.github Release litert_lm_main for macOS as one tar.gz with every dylib it loads. 2026-11-16 19:05:51 -08:00
agents/skills [litertlm] Move README.md under LiteRT-LM Agent Skills directory. 2026-06-02 11:01:13 -07:00
build_config build: strip non-global Mach-O symbols (-Wl,-x) on iOS and macOS 2026-11-11 10:46:14 -08:00
c Keep the platform #if out of a macro's arguments in c/engine.cc, which MSVC rejects. 2026-11-25 12:29:20 -08:00
cmake Add extensible Omni metadata and visual-gen protos 2026-11-18 14:27:47 -08:00
colabs Switch LiteRT-LM colabs from ai-edge-quantizer to litert-quantizer. 2026-11-19 10:02:35 -08:00
cxxbridge_cmd Add cxxbridge-cmd, a binary for generating C/C++ bindings to Rust libraries. 2025-12-12 11:00:22 -08:00
docs Expose Conversation finishReason and executorStats in Kotlin binding. 2026-11-23 09:04:49 -08:00
js Expose Conversation finish_reason and executor_stats in JS binding. 2026-11-23 09:11:21 -08:00
kotlin Reject fixed-token benchmarks when speculative decoding is enabled and avoid stop-token rollback during fixed-length benchmark decode. 2026-11-24 13:09:43 -08:00
models feat: validate Jinja template input variables against JSON schema 2026-11-24 09:14:17 -08:00
omni Refactor text2image models to share some logic with custom models 2026-11-23 22:10:19 -08:00
prebuilt Update dependencies of litert_lm 2026-11-04 20:01:09 -08:00
python Compile only the largest prefill signature by default on NVIDIA's backend. 2026-11-25 12:24:23 -08:00
runtime Support per-run LiteRT options in the LiteRT-LM embedding executor. 2026-11-25 14:48:57 -08:00
rust Added the preprocessing libraries back to LiteRT-LM repo. 2026-08-05 17:02:43 -07:00
samples/ios_and_mac Support Swift nightly package distribution and fix macOS codesigning. 2026-10-12 14:15:02 -07:00
schema Detect dynamic context for block-compressed KV caches, and report the vision 2026-11-24 19:21:32 -08:00
src Refactor LiteRT-LM CMake structure for cross-compilation and Android support. 2026-03-27 13:06:12 -07:00
support Skip identity SkImage::makeScaled and fuse float conversion into PatchifyImage in SkiaImagePreprocessor: 2026-11-22 11:54:49 -08:00
swift Reject fixed-token benchmarks when speculative decoding is enabled and avoid stop-token rollback during fixed-length benchmark decode. 2026-11-24 13:09:43 -08:00
sync Add LiteRT-LM ModelSync C API for cross-language integration. 2026-11-12 10:04:24 -08:00
third_party Enable ABSL_ATTRIBUTE_TRIVIAL_ABI for Clang in the Abseil build patch so absl::Status matches the prebuilt Gemma constraint provider, fixing a SIGBUS with constrained decoding in self-built Android and Apple runtimes. 2026-11-16 22:55:47 -08:00
tools/pytest build: build dynamic GPU accelerators from source and update OSS test workflows 2026-10-27 17:02:40 -07:00
.bazeliskrc Use GitHub mirror for BCR to work around bcr.bazel.build outages 2025-12-26 14:25:33 -08:00
.bazelrc Reverts dd433ded94 2026-11-13 16:21:25 -08:00
.bazelversion Copybara setup completed. 2025-04-29 12:13:13 -07:00
.gitattributes Fix .gitattributes 2026-01-31 17:58:07 -08:00
.gitignore Test the LiteRT-LM Web npm package in its OSS build before publishing. 2026-10-21 12:59:42 -07:00
.lfsconfig Configure Git LFS endpoint in .lfsconfig for LiteRT-LM. 2026-10-09 11:01:28 -07:00
__init__.py Fix the run time error of python reader and writer for .litertlm file 2025-07-24 10:31:01 -07:00
android_ndk_env.bzl Prevent TensorFlow workspace macros from shadowing @rules_android and @rules_android_ndk when ANDROID_SDK_HOME or ANDROID_NDK_HOME are set. 2026-11-11 15:17:59 -08:00
BUILD Remove litert_lm_link_capi_so config settings. 2025-08-20 09:14:51 -07:00
BUILD.llguidance Implement LlgConstraintProvider and ExternalConstraintProvider. 2026-01-23 12:44:27 -08:00
cargo-bazel-lock.json Update minijinja from 2.14.0 to 3.0.5. 2026-11-24 12:45:05 -08:00
Cargo.lock Update minijinja from 2.14.0 to 3.0.5. 2026-11-24 12:45:05 -08:00
Cargo.toml Update minijinja from 2.14.0 to 3.0.5. 2026-11-24 12:45:05 -08:00
CMakeLists.txt build: speed up CMake build with centralized shallow Git fetches and parallel subbuilds 2026-11-04 09:56:40 -08:00
CMakePresets.json Update LiteRT-LM CMake build system for Android x86_64 cross-compilation. 2026-09-17 14:06:51 -07:00
CODE_OF_CONDUCT.md Add CODE_OF_CONDUCT.md and list individual maintainers in CODEOWNERS. 2026-10-15 08:49:06 -07:00
CONTRIBUTING.md Add Zizmor security scanning, Dependabot configuration, and harden GitHub Actions workflows: 2026-10-28 02:11:42 -07:00
GOVERNANCE.md This is an internal change 2026-09-25 22:12:15 -07:00
LICENSE Create LICENSE 2025-04-17 11:30:48 -07:00
Package.swift Update LiteRT-LM Swift package binaries to v0.20.0. 2026-11-23 14:33:02 -08:00
PATCH.llguidance_grammar Update llguidance to 1.9.1 in the open-source build. 2026-10-23 16:54:42 -07:00
PATCH.llguidance_numeric Update llguidance to 1.9.1 in the open-source build. 2026-10-23 16:54:42 -07:00
PATCH.llguidance_perf Update llguidance to 1.9.1 in the open-source build. 2026-10-23 16:54:42 -07:00
PATCH.llguidance_regexvec Update llguidance to 1.9.1 in the open-source build. 2026-10-23 16:54:42 -07:00
PATCH.toktrie Update llguidance to 1.9.1 in the open-source build. 2026-10-23 16:54:42 -07:00
README.md Update README with v0.20.0 release notes 2026-11-23 19:34:00 -08:00
requirements.txt Bump certifi to 2026.10.23 in LiteRT-LM requirements.txt. 2026-10-23 15:53:44 -07:00
rust_cxx_bridge.bzl Add cxxbridge-cmd, a binary for generating C/C++ bindings to Rust libraries. 2025-12-12 11:00:22 -08:00
version.bzl Bump LiteRT-LM version to 0.21.0. 2026-11-23 18:35:14 -08:00
WORKSPACE Update dependencies of litert_lm 2026-11-25 15:45:59 -08:00

LiteRT-LM

LiteRT-LM is Google's production-ready orchestration layer to run LLMs with LiteRT, engineered for high-performance, cross-platform execution.

🔗 Product Website | 💬✨ Chat Demo | 🔎✨ Embedding Demo

🔥 What's New: v0.20.0

    • NPU Executor Metadata & Default Behavior Change:
    • Added LlmNpuExecutorMetadata to ExecutorMetadata proto and updated the runtime to resolve unset NPU execution flags (enable_neon_for_npu_greedy_sampling, use_hw_masking_for_npu, use_hw_cache_update_for_npu, use_hw_ple_for_npu) from .litertlm bundle metadata.
    • Behavior Change: Handwritten NPU components now default to disabled unless enabled in bundle metadata or runtime flags (except KV-cache updates on ring-buffer models).
    • Python 3.10 support is deprecated. Python 3.10 reached upstream end-of-life on 2026-10-01 (PEP 619). Importing litert_lm on Python 3.10 now emits a FutureWarning. 0.20.0 is the last release that supports Python 3.10. The next release (0.21.0) will require Python ≥ 3.11 and will no longer publish cp310 wheels. If you are on Python 3.10, upgrade to 3.11 or newer, or pin litert-lm==0.20.*.
    • Benchmark init time: No longer counts engine creation twice in the C, Kotlin, Swift and Python APIs and litert-lm benchmark.
    • litert_lm_main: Now stops each reply after --max_output_tokens tokens when the flag is above 0.
    • Reproducible .litertlm builds: With SOURCE_DATE_EPOCH set, litert-lm-builder now writes byte-identical files from the same inputs and uuid.

👉 Try Gemma4-E4B with MTP on Linux, macOS, Windows or Raspberry Pi with the LiteRT-LM CLI:

litert-lm run  \
   --from-huggingface-repo=litert-community/gemma-4-E4B-it-litert-lm \
   gemma-4-E4B-it.litertlm \
   --backend=gpu \
   --speculative-decoding=on \
   --prompt="What is the capital of France?"

🌟 Key Features

  • 📱 Cross-Platform Support: Android, iOS, Web, Desktop, and IoT (e.g. Raspberry Pi).
  • 🚀 Hardware Acceleration: Peak performance via GPU and NPU accelerators.
  • 👁️ Multi-Modality: Support for vision and audio inputs.
  • 🔧 Tool Use: Function calling support for agentic workflows.
  • 📚 Broad Model Support: Gemma, Llama, Phi-4, Qwen, and more.


🚀 Production-Ready for Google's Products

LiteRT-LM powers on-device GenAI experiences in Chrome, Chromebook Plus, Pixel Watch, and more.

You can also try the Google AI Edge Gallery app to run models immediately on your device.

Install the app today from Google Play Install the app today from App Store
Get it on Google Play Download on the App Store

📰 Blogs & Announcements

Link Description
Bringing Gemma 4 12B to your Laptop: Unlocking Local, Agentic Workflows with Google AI Edge Bring agentic, multimodal AI capabilities to everyday laptops, enabling local data processing and visual insight generation.
Blazing-fast on-device GenAI with LiteRT-LM Unlock Gemma 4's full potential with blazing speed and incredible efficiency using newly added Swift, JavaScript, and Flutter APIs.
Accelerating Gemma 4: faster inference with multi-token prediction drafters An overview of how Multi-Token Prediction (MTP) drafters are making Gemma 4 models up to 3x faster at inference.
Bring state-of-the-art agentic skills to the edge with Gemma 4 Deploy Gemma 4 in-app and across a broader range of devices with stellar performance and broad reach using LiteRT-LM.
On-device GenAI in Chrome, Chromebook Plus and Pixel Watch Deploy language models on wearables and browser-based platforms using LiteRT-LM at scale.
On-device Function Calling in Google AI Edge Gallery Explore how to fine-tune FunctionGemma and enable function calling capabilities powered by LiteRT-LM Tool Use APIs.
Google AI Edge small language models, multimodality, and function calling Latest insights on RAG, multimodality, and function calling for edge language models.

🏃 Quick Start

⚡ Quick Try (No Code)

Try LiteRT-LM immediately from your terminal without writing a single line of code using uv:

uv tool install litert-lm

litert-lm run \
  --from-huggingface-repo=google/gemma-3n-E2B-it-litert-lm \
  gemma-3n-E2B-it-int4 \
  --prompt="What is the capital of France?"

📚 Supported Language APIs

Ready to get started? Explore our language-specific guides and setup instructions.

Language Status Best For... Documentation
Python ✅ Stable Prototyping & Scripting Python Guide
Kotlin ✅ Stable Android apps & JVM Kotlin Guide
Swift 🚀 Early Preview Native iOS & macOS Swift Guide
JavaScript (web) 🚀 Early Preview Browser environments JavaScript Guide
Flutter 🚀 Community Cross-platform mobile Flutter Guide
C++ ✅ Stable High-performance native C++ Guide

🏗️ Build From Source

This guide shows how you can compile LiteRT-LM from source. If you want to build the program from source, you should checkout the stable Latest Release tag.