SkillsReviewed · android

LiteRT-LM Android skill

LiteRT-LM is an assistant skill for Android developers adding on-device text generation, but it requires a separately delivered model and careful device integration. It provides Kotlin and Compose guidance for CPU or GPU inference, streamed conversations and resource cleanup; images, audio, tool calling, NPU execution and model conversion are outside its scope.

Researched 16 Nov 2026

In short.

LiteRT-LM is an assistant skill for Android developers building local text features, but its code still needs validation with the chosen model and target devices. It specifies the LiteRT-LM Kotlin dependency, model storage, background initialization, streamed multi-turn conversations and Compose integration. Its strongest detail concerns threading and cleanup. No build, model inference or device testing was performed, so compatibility, performance and output quality remain unassessed.

Researched and written by an AI model and checked by a second AI model. How it works

Coverage includes device-ai/litert/litert-lm/SKILL.md, references/get-a-model.md and references/android/google/play/on-device-ai.md, plus the repository-level LICENSE.txt, all from revision c72942584fff970dac86ced78b367fce0c441e52. Other repository folders, linked websites, model weights, dependency artifacts and external sample apps are excluded. Nothing was executed; compilation, inference, device compatibility, performance, cleanup and Play delivery behavior remain untested.

The overview

Identity

The resource is the litert-lm skill folder in the android/skills repository, attributed in its metadata to Google LLC. It contains assistant instructions and implementation examples rather than a standalone app, inference engine or model. The original source location is [https://github.com/android/skills/tree/main/device-ai/litert/litert-lm].

The folder contains SKILL.md, a model-acquisition reference and a Play for On-device AI reference. It targets the com.google.ai.edge.litertlm Kotlin API and models packaged as .litertlm files.

Assessment

This is a useful implementation scaffold for adding local chat, summarization or extraction to a Kotlin Android app. It connects build configuration, model delivery, inference and UI state instead of showing only an isolated API call.

Its practical strength is explicit handling of blocking initialization, serialized engine ownership and closing resources after streaming ends. These are documented patterns, not demonstrated test results. Successful compilation, reliable cleanup and behavior across Android devices remain unassessed.

Users

The intended user is an Android developer working with an assistant that can load skill instructions. Beginners receive concrete Gradle, manifest, ViewModel and Compose examples, but still need enough Kotlin and Android knowledge to integrate them into an existing project.

Experienced developers may find the lifecycle constraints and delivery choices especially useful. Teams needing multimodal input, tool calling, NPU execution or model conversion will need additional resources.

Capabilities

The skill covers CPU and GPU text inference, streamed replies through sendMessageAsync, conversation history, configurable sampling, cancellation and cleanup. Its example exposes readiness, activity, reply text and errors through StateFlow to a Compose screen.

Model delivery options include copying a local file with adb, implementing an app download or using fast-follow or on-demand Play AI packs. The Play reference additionally explains download states, device targeting and pack updates. These are implementation instructions; no completed app or measured capability results are supplied.

Using it

Requirements

The guide specifies a Kotlin Android project, minSdk 24 and com.google.ai.edge.litertlm:litertlm-android:0.18.0 from Google Maven. Its Compose example references lifecycle-viewmodel-compose and lifecycle-runtime-compose version 2.10.0. GPU configuration adds optional libvndksupport.so and libOpenCL.so declarations inside the application manifest.

A compatible .litertlm file must be available through an absolute device filesystem path. The guide lists a 2.6 GB Gemma file and a 0.6 GB Qwen file, but establishes no minimum RAM, free-space allowance beyond the file itself or supported-device matrix.

Optional Play AI packs require Android Gradle Plugin 8.8 or later; the supplied device-targeting instructions require 8.10.0 or later. These requirements belong to the Play delivery route, rather than every implementation.

Mechanism

EngineConfig selects the model path, backend and cache directory. Engine.initialize loads the model and blocks, so the example moves engine operations to a single background executor. A Conversation retains chat history and emits reply chunks as a Kotlin Flow.

The ViewModel updates immutable UI state as chunks arrive. Before replacing or closing the engine, it disables sending, requests cancellation and waits for streaming to end, then closes the conversation before the engine. The guide states that repeated close calls, or closing an engine whose initialization failed, throw IllegalStateException.

Sampling is configured through SamplerConfig. The supplied example uses topK 10, topP 0.95 and temperature 0.8; these are example settings, with no evidence that they optimize any particular task.

Setup

The documented sequence is to configure Gradle and the manifest, select a compatible model, arrange delivery, initialize the engine off the main thread, and connect the ViewModel to Compose. The two named model files are available through [https://huggingface.co/litert-community]. Other quantizations, web builds and chip-specific builds require attention to the model card.

The guide identifies a Kotlin metadata incompatibility between LiteRT-LM 0.18.0 and Hilt 2.59.2. It documents upgrading Hilt to 2.60.1 or later, or adding kotlin-metadata-jvm:2.4.21 to the KSP processor path. Neither workaround was verified here.

For Play delivery, the application must handle unavailable packs and resolve the model file beneath assetsPath() after download completion. This is separate from putting the model in the base app's assets or APK, which the skill excludes.

Example

The included ChatScreen loads a supplied model path using Backend.GPU(), collects lifecycle-aware state, displays the streamed reply and errors, and enables Send only when the model is ready and idle. A developer could use this as the starting point for asking questions about text entered into the app.

The screen displays the current reply rather than a complete transcript, although the Conversation retains multi-turn history. It does not include a model-download implementation or automatic CPU fallback. No generated answer or working-device result is supplied.

Assessment & evidence

Limitations

Coverage is limited to text input with CPU or GPU backends. Image and audio input, tool calling, NPU builds and model conversion are explicitly excluded. Initialization can take seconds according to the guide, but there are no latency, memory, battery, thermal or output-quality measurements.

Calling load with the same model path intentionally ignores a requested backend change. The Compose example requests GPU without demonstrating fallback, so the manifest declarations alone should not be treated as proof of device compatibility.

The Play reference limits each AI pack to a 1.5 GB compressed download and cumulative generated app size to 4 GB. The listed 2.6 GB model size does not establish its compressed pack size, so its fit is unknown. Bundletool local testing also omits real network-error, wait-for-Wi-Fi and update behavior.

Reasoning

The resource's value comes from coordinating parts that must work together: model storage, initialization, streaming, UI state and native-resource lifetime. Its detailed ownership rules make it more useful than a short inference snippet.

Local execution removes a hosted inference request from the demonstrated generation path, while making model distribution and device capacity central design concerns. The evidence supports this architectural tradeoff, but does not establish whole-app privacy, lower total cost or better performance than a hosted alternative.

Alternatives

For .tflite vision, audio or embedding models using the CompiledModel API, the skill points to litert-runtime. That skill's contents were not supplied, so its implementation quality is unassessed.

For a complete reference app, it points to Google AI Edge Gallery [https://github.com/google-ai-edge/gallery/blob/main/README.md]. For models without a .litertlm file, the model reference describes a separate workstation conversion path using litert-torch, ai-edge-quantizer and litert_lm_builder. Neither the reference app nor that conversion tooling was assessed.

Evidence

The available source comprises the complete supplied skill folder and the repository-level LICENSE.txt at revision c72942584fff970dac86ced78b367fce0c441e52. The revision-specific folder is [https://github.com/android/skills/tree/c72942584fff970dac86ced78b367fce0c441e52/device-ai/litert/litert-lm].

These files establish the documented API usage, examples, delivery guidance and source license. Linked model cards, upstream API guides, dependency artifacts and external sample apps were not supplied. Their contents and compatibility were not independently verified.

Access & freshness

Costs

The supplied Apache 2.0 license grants no-charge rights to the covered source material, subject to its terms. The demonstrated inference path runs on the device rather than through a hosted inference API, but the evidence does not establish total operating cost.

The Play reference describes model hosting, delivery, updates and targeting as available at no additional cost through that service. This does not establish that all publishing, development or model-related costs are zero. Model licensing charges, alternative download-hosting costs, bandwidth, energy use and engineering effort are unknown.

Rights

SKILL.md directs readers to LICENSE.txt, which contains Apache License 2.0. It permits reproduction, modification and redistribution subject to conditions including supplying the license, marking changed files, retaining applicable notices and carrying forward relevant NOTICE attribution when present. It provides no warranty and does not grant general trademark rights.

The supplied license does not establish the terms for the separately obtained model weights or every runtime dependency. Those terms need separate review. The Play reference also identifies the Google Play Developer Distribution Agreement and Play Core SDK terms, and says delivered models should be used only by the publisher's own apps.

Freshness

The skill metadata gives a last-updated date of 2026-11-10. The supplied snapshot was captured on 2026-11-16 at 01:54:42.572 UTC. These dates identify the documentation snapshot; they do not prove current package or model availability.

The guide specifies LiteRT-LM 0.18.0, while the bundled Play reference uses ai-delivery:0.1.1-alpha01. Whether newer releases change these instructions is unknown. The guide directs readers to upstream Android documentation when its API examples fail to compile.

Actions

Before adopting the skill, choose a specific .litertlm file, review its model card and license, and establish storage and device requirements. Decide whether model delivery will use local development copying, an app download or Play AI packs.

Validate compilation against the project's actual Kotlin, Hilt and Android dependencies. On representative devices, check initialization, CPU and GPU behavior, streaming cancellation, model replacement, rotation and cleanup. Measure output quality, response time and resource use for the intended feature.

For Play delivery, verify compressed pack size and download-state handling, including unavailable packs and mobile-data confirmation. The reference recommends end-to-end testing through a Play internal test track because local bundletool behavior has documented gaps.

Evidence for this report

LICENSE.txtnotice · checked 2026-11-16
device-ai/litert/litert-lm/SKILL.mdselected · checked 2026-11-16