Skip to content

Guide · Agent skill

How to use the LiteRT-LM On-Device LLM Android agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

The litert-lm skill is a set of instructions that teaches an AI coding agent how to build an Android app that runs an open text language model entirely on the phone, using Google's LiteRT-LM Kotlin library. It is for Android developers who want a private, offline chat, summarization, or extraction feature. After reading this guide you will know how to install the skill, how to ask for the work in plain language, what the agent will build, and what your project needs first.

LiteRT-LM On-Device LLM for Androidandroid/skills · Apache-2.0

Quick start

  1. 1Download and unzip the skill. Download the skill ZIP from this page and unzip it into ~/.claude/skills/ for all projects, or into your project's .claude/skills/ folder for one project.
  2. 2Or upload it in the Claude apps. In the Claude apps, open Settings, then Capabilities, then Skills, and upload the ZIP.
  3. 3Describe the feature. Ask in plain words for an on-device chat, summarization, or extraction feature in your Android app, and name a model family if you have one.
  4. 4Check the project prerequisites. Confirm you have a Kotlin Android project with minSdk 24 or higher, Google Maven access, and a .litertlm model file or a plan to download one.
  5. 5Choose how the model reaches the device. Pick adb for local testing, an in-app download with progress and a size check, or Play for On-Device AI. The agent follows the path you choose.
  6. 6Build and verify. The agent adds the Gradle dependency and manifest entries, writes the engine and chat code, and verifies the build with ./gradlew assembleDebug.

What the skill makes the agent do

When the skill is installed, the agent knows the steps for building an Android app that runs one open text model on the device. The model is a single .litertlm file, and it runs on the CPU or the GPU through the LiteRT-LM Kotlin API.

The skill covers the Gradle dependency, the GPU manifest entries, getting the model file onto the device, loading the engine safely off the main thread, and a streamed multi-turn chat screen built with an AndroidViewModel and Compose.

  • Adds the litertlm-android dependency and the minSdk setting to the app's Gradle files
  • Adds the GPU native-library entries and the INTERNET permission when the app downloads a model
  • Gets the model file onto the device, through adb for local testing, an in-app download, or Play for On-Device AI
  • Starts the engine on a background thread and streams replies in a multi-turn conversation

How to install the litert-lm skill

Download the skill ZIP from this page. Then choose one of the two install routes below. Use the personal folder if you want the skill available in every project, or the project folder if you want it only in one repository.

In the Claude apps, you can also upload the ZIP under Settings, then Capabilities, then Skills.

  • Personal install: unzip the file into ~/.claude/skills/
  • Project install: unzip the file into the .claude/skills/ folder of your project
  • Claude apps: Settings, then Capabilities, then Skills, then upload the ZIP
~/.claude/skills/

How to trigger the skill with natural requests

You do not need a special command. Describe the feature you want in ordinary words that mention Android and an on-device or offline model. The skill matches on the kind of work it covers: a chat, summarization, or extraction feature using a .litertlm model.

Name the model family if you have one in mind, such as Gemma, Qwen, Llama, or Phi. If you do not name a model, the skill points to a starting file from litert-community on Hugging Face.

  • Add an on-device chat screen to my Android app that runs a Gemma model with no cloud calls.
  • Build a summarization feature in my Kotlin Android project that works offline, using a .litertlm model.
  • Create an extraction screen in my Android app using LiteRT-LM, with the model loaded in the background.
  • Set up LiteRT-LM with GPU support in my Android project and add the manifest entries.

What your project needs before you start

The skill is built for a Kotlin Android project. The Android Studio Empty Activity template is enough. The LiteRT-LM Android library declares a minimum SDK of 24, so your project must be at least that level.

You also need access to Google Maven for the dependency, a .litertlm model file, and enough storage on the device. The model file is hundreds of MB to a few GB and lives on the device's file system, not in the APK.

  • Kotlin Android project with minSdk 24 or higher
  • Google Maven access to fetch the litertlm-android dependency
  • Android Studio and Gradle; the skill verifies its work with ./gradlew assembleDebug
  • A .litertlm model file from Hugging Face litert-community, supplied by you or downloaded
  • INTERNET permission if the app downloads the model
  • adb and a connected debug device, only if you use the local push path
implementation("com.google.ai.edge.litertlm:litertlm-android:0.18.0")

What the agent builds, step by step

The agent first searches the project for libs.versions.toml, app/build.gradle.kts, and AndroidManifest.xml, then edits the build files. It adds the dependency, and for the GPU backend it adds two uses-native-library entries inside the application tag.

Next it sets up the model. The skill's guidance is to start with a model from litert-community, such as the Gemma file gemma-4-E2B-it.litertlm (about 2.6 GB) or the Qwen3 file Qwen3-0.6B.litertlm (0.6 GB). Both run on the CPU and the GPU. The agent creates the engine with EngineConfig, using the absolute path of the model file, and calls initialize on a background thread. The Backend.CPU option needs nothing extra, while Backend.GPU needs the manifest entries.

  • Dependency and manifest: the agent checks the project first, then adds the litertlm-android dependency and the GPU library entries
  • Model file: the agent writes code that gets the .litertlm file onto the device and passes its absolute path to the engine
  • Engine: initialize runs on a background thread, and one single-thread executor owns the Engine and the Conversation
  • Chat screen: replies stream through sendMessageAsync in an AndroidViewModel with a Compose screen
<uses-permission android:name="android.permission.INTERNET"/> <application> <uses-native-library android:name="libvndksupport.so" android:required="false"/> <uses-native-library android:name="libOpenCL.so" android:required="false"/> </application>

Safety notes: scripts, network and the device

This skill runs scripts and uses the network. The agent runs adb commands only when three things are true: adb devices lists a device, the debug build of the app is installed on it, and you have supplied the local model path. If any of these is false, the agent reports the commands to you as a later step instead of running them.

When the app downloads a model, the download code must show progress and check the file size against the model card before loading. The skill says the agent should never download a model file in its own session. Model files should never be bundled in assets/ or the APK.

  • The adb push path needs a connected debug device and a path you supplied
  • In-app downloads need the INTERNET permission and should show progress
  • Check the file size against the model card before loading
  • Read the license terms in the skill's LICENSE.txt; the item is listed under Apache-2.0

Tips and limits

If the GPU backend fails with a message about the OpenCL library, the manifest entries from the setup step are missing. If the build fails in the Hilt annotation processing step, the skill describes two fixes: upgrade Hilt to a version that can read the newer Kotlin metadata, or keep Hilt and add a newer metadata reader to the annotation processor path. The skill says to ask before changing the version catalog.

The skill does not cover image or audio input, tool calling, NPU builds, or converting models. Vision and audio models stored as .tflite files belong to the litert-runtime skill. Web builds and NPU builds in litert-community are not the right choice for this skill.

  • Pick the CPU-and-GPU builds named in the guide, not NPU builds with a chip suffix
  • Close the Engine and Conversation only once; a second close throws IllegalStateException
  • Keep the model out of assets/ and pass an absolute path instead

What people use it for

  • A private offline chat assistant inside an existing Android app, with no user data sent to a cloud LLM API
  • On-device summarization of notes or articles entered by the user
  • Extraction of structured fields from text, such as pulling details out of messages, with the model running on the phone
  • A Compose chat screen with streamed replies and multi-turn history, built on a ViewModel

Frequently asked questions

How do I install the litert-lm agent skill?

Download the skill ZIP from this page and unzip it into ~/.claude/skills/ for personal use, or into a project's .claude/skills/ folder. In the Claude apps, you can instead upload the ZIP under Settings, then Capabilities, then Skills.

What does the litert-lm skill need from my Android project?

It needs a Kotlin Android project with minSdk 24 or higher, Google Maven access for the litertlm-android dependency, and Android Studio with Gradle. You also need a .litertlm model file, and the INTERNET permission if the app downloads the model.

Is the LiteRT-LM skill free to use?

The item is listed under the Apache-2.0 license. The skill's own terms are in its LICENSE.txt file, so read that file before you use or redistribute the skill.

Can the skill build an app that handles images or audio?

No. The skill covers text LLMs only and excludes image input, audio, tool calling, and NPU backends. For vision and audio models in .tflite format, the guidance points to the litert-runtime skill.

What is the alternative if I need vision or audio models on Android?

The skill's guidance says vision and audio models in .tflite files belong to the litert-runtime skill, which uses the CompiledModel API. Use that skill instead of litert-lm for those models.

Why does my GPU build show 'Can not find OpenCL library on this device'?

The GPU backend needs two uses-native-library entries inside the application tag of AndroidManifest.xml, for libvndksupport.so and libOpenCL.so. Without them the engine initializes, but the first reply ends in that error.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Use this skill if you are an Android developer who already has a Kotlin project and wants a working starting point for a private, offline text chat, summarization, or extraction feature with a .litertlm model. Pick something else if you need image, audio, or tool-calling support, NPU-specific builds, or a model that is too large for the device's storage.

Download the skill