LiteRT-LM: Google's edge inference layer for LLMs, from CLI to C API
LiteRT-LM is Google's production-ready, high-performance, open-source inference framework for deploying Large Language Models on edge devices.
At a glance
- What is it?
- LiteRT-LM is Google's open-source orchestration layer for running large language models on edge devices. It wraps LiteRT with a cross-platform API, a CLI, and prebuilt C libraries, but its real value depends on the model formats and delegates you plan to use.
- Who is it for?
- Adopt LiteRT-LM if you are building on-device GenAI features for Android, iOS, Web, or IoT and you are willing to commit to the LiteRT model format and Google's toolchain. Do not adopt it if you need to run models that are not converted to .litertlm, or if you require a stable C API across many versions; the C API prebuilt is versioned 0.1.0 and marked experimental.
- Can I use it commercially?
- Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 1 day ago.
- What is it written in?
- Mainly C++, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 14, 2026, and from our analysis. They are not legal advice.
DEEP OPEN-SOURCE ANALYSIS
What LiteRT-LM actually does
LiteRT-LM is not a model runtime by itself. It is an orchestration layer that sits on top of LiteRT, Google's existing on-device inference engine. The README describes it as a production-ready orchestration layer to run LLMs with LiteRT. In practice, that means it handles the plumbing around model loading, tokenization, sampling, and hardware delegation, so you can call a high-level API instead of wiring LiteRT's low-level components yourself. The target audience is developers shipping GenAI features in mobile apps, desktop apps, or browser extensions, and the README names Chrome, Chromebook Plus, and Pixel Watch as production users. If you are building a one-off script to test a model on your laptop, the CLI is the entry point. If you are embedding inference in a product, you would use one of the language APIs or the C API prebuilt.
The model format and the Hugging Face pipeline
The key constraint is the model format. The CLI examples pull from Hugging Face repos like litert-community/gemma-4-E2B-it-litert-lm and then run a file with the .litertlm extension, for instance gemma-4-E4B-it.litertlm. That extension is not a standard GGUF or ONNX. It is a LiteRT-specific container that presumably bundles the weights, tokenizer, and maybe metadata. The README does not explain the conversion process, but the existence of community repos with the -litert-lm suffix suggests that you must find or create a converted model. This is a real adoption barrier. If your model is not already converted, you will need to use LiteRT's conversion tooling, which is not documented in this README. The upside is that the format is designed for edge deployment, so it can include int4 quantization (the example model name gemma-3n-E2B-it-int4 implies that).
Running it: the CLI and the uv path
The quickest way to try LiteRT-LM is through the Python CLI installed with uv. The README gives this exact command: uv tool install litert-lm, then 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?". That is a no-code path that works on Linux, macOS, Windows, and Raspberry Pi, according to the release notes. For a more advanced example, the v0.16.0 release shows a command that enables speculative decoding: litert-lm run --from-huggingface-repo=litert-community/gemma-4-E2B-it-litert-lm gemma-4-E4B-it.litertlm --backend=gpu --enable-speculative-decoding=true --prompt="What is the capital of France?". The --backend flag accepts gpu, and the README mentions NPU acceleration, but it does not list the exact backend names. The --enable-speculative-decoding flag is a concrete configuration key that you can use to trade accuracy or memory for speed, though the README does not quantify the trade-off.
The C API prebuilt: a step toward language bindings
Before v0.16.0, integrating LiteRT-LM into a native application required building shared libraries from source, which is a heavy lift for many teams. The v0.16.0 release introduced the first versioned C API shared library prebuilt, downloadable as a zip from the GitHub releases page. The filename is litert_lm_c_api-0.1.0.zip, and the release notes say it covers all supported platforms. This is a significant move because it allows you to create language bindings without compiling the whole framework. However, the version number 0.1.0 signals that the C API is still young. The README does not provide any code example for the C API, so you will need to rely on the official documentation to learn the function signatures. If you are planning to write a Rust or Go binding, expect to do some reverse engineering or wait for the API to stabilize.
Hardware acceleration and the YNNPACK experiment
LiteRT-LM's performance pitch rests on GPU and NPU delegates. The README claims peak performance via GPU and NPU accelerators, and the CLI example uses --backend=gpu. The v0.16.0 release adds an experimental YNNPACK delegate, which is a new backend from the XNNPACK project. The release notes say it is enabled for linux arm64 builds in the CLI and Python API. That is a narrow footprint. If you are on x86_64 or on Android, YNNPACK is not available yet. The experimental label means it is not production-ready, so you should not rely on it for a shipped product. The broader point is that hardware support is uneven across platforms. The README lists Android, iOS, Web, Desktop, and IoT, but it does not specify which delegates are available on each. You will need to check the technical overview page for the performance benchmarks and the delegate matrix.
Multi-modality and tool use: the agentic angle
Beyond text generation, LiteRT-LM supports vision and audio inputs, according to the Key Features list. The README also mentions tool use, which is function calling for agentic workflows. The Google AI Edge Gallery app is cited as a way to try function calling on-device, and the README links to a blog post about fine-tuning FunctionGemma. This is a differentiator compared to simpler edge runtimes that only do text completion. However, the README does not go into the details of how the tool use API works, what functions you can define, or how the model is fine-tuned for that purpose. If your use case is a chat assistant that can call external APIs, LiteRT-LM seems to have first-party support, but you will need to dig into the documentation to understand the exact interface.
Licence and maintenance cost
The project is licensed under Apache-2.0, which is permissive for commercial use, but that does not cover the models themselves. The Gemma models have their own licence terms, which you must check separately. The repository is actively maintained, with releases v0.15.0, v0.16.0, and v0.16.1 all landing within a two-week window in August 2026. That cadence suggests fast iteration, but it also means you will need to track releases for bug fixes and API changes. The C API is versioned, which is good, but the underlying Python and JS APIs may change more frequently. The README mentions Swift, JavaScript, and Flutter APIs, but the status table is truncated, so you cannot confirm which are stable. Before adopting, check the language-specific guides on the official site to see if your language is marked as stable or experimental.
Where LiteRT-LM is the wrong tool
If you need to run a model that is not available in the LiteRT-LM format, this framework is not for you. The conversion pipeline is not described in the README, and the examples all rely on pre-converted Hugging Face repos. If you want to run a custom fine-tuned model, you will have to convert it yourself, and the tooling for that is not shown here. Also, if you are targeting a platform that is not in the supported list, such as a custom embedded Linux board without arm64, you may not get prebuilt binaries. The YNNPACK delegate is only for linux arm64, and the GPU delegate may not work on all GPUs. Finally, if you are looking for a pure Python solution that you can pip install and forget, the uv tool is convenient, but the C API and the native runtime are C++ at heart, so debugging issues may require C++ knowledge.
Alternatives and how they differ
The most direct alternative is llama.cpp, which is a C++ inference engine for LLMs that uses GGUF model files. The key difference is that llama.cpp is a standalone runtime, not an orchestration layer. You load a GGUF file and run it with a simple command, and it supports a wide range of hardware backends including CPU, CUDA, Metal, and Vulkan. LiteRT-LM, by contrast, is tied to the LiteRT ecosystem and the .litertlm format, which is less portable. If you want to run a model on a Raspberry Pi with minimal setup, llama.cpp might be simpler because it does not require a specific model conversion. Another alternative is ONNX Runtime with the GenAI extensions, which supports edge deployment and has a more established model conversion path from PyTorch. The difference is that ONNX is a broader standard, while LiteRT-LM is Google-specific and optimized for Google's hardware and software stack, such as Chrome and Pixel devices. If you are already invested in Google's ecosystem, LiteRT-LM is a natural fit. If you want maximum model portability, choose a GGUF-based runtime.
Editorial conclusion
Adopt LiteRT-LM if you are building on-device GenAI features for Android, iOS, Web, or IoT and you are willing to commit to the LiteRT model format and Google's toolchain. Do not adopt it if you need to run models that are not converted to .litertlm, or if you require a stable C API across many versions; the C API prebuilt is versioned 0.1.0 and marked experimental. Before committing, verify that your target models (Gemma, Llama, Phi-4, Qwen) have a prebuilt LiteRT-LM conversion, and check the performance benchmarks on the technical overview page for your specific hardware. The project is actively maintained with frequent releases, but the YNNPACK delegate is experimental and only enabled for linux arm64, so test on your actual deployment target.
Community notes