litert-lm

litert-lm is a skill for Claude Code, Codex from google-ai-edge/litert-samples. It costs 179 tokens per session (4,268 once invoked), scanned A, original, Apache-2.0.

A guide for adding an on-device text language model to an Android app with LiteRT-LM and Kotlin. It covers running a packaged model on the phone's CPU or GPU.

In plain words
What is it for?
It helps build Android chat, summarization, and text-extraction apps using supported open language models.
Why use it?
It lays out the Android dependency, manifest settings, and app structure needed to use the model locally.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It helps build Android chat, summarization, and text-extraction apps using supported open language models.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/google-ai-edge/litert-samples/litert-lm
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add google-ai-edge/litert-samples --skill litert-lm
Clone the repo
git clone --depth 1 https://github.com/google-ai-edge/litert-samples

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for litert-lm

README.md
[![agentmods](https://agentmods.dev/badge/skills/google-ai-edge/litert-samples/litert-lm/github.svg)](https://agentmods.dev/skills/google-ai-edge/litert-samples/litert-lm)
Your own site
<a href="https://agentmods.dev/skills/google-ai-edge/litert-samples/litert-lm"><img src="https://agentmods.dev/badge/skills/google-ai-edge/litert-samples/litert-lm/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for litert-lm

Your own site · 80×15
<a href="https://agentmods.dev/skills/google-ai-edge/litert-samples/litert-lm"><img src="https://agentmods.dev/badge/skills/google-ai-edge/litert-samples/litert-lm.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 179 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,268 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00179 $0.04268
Opus 5.5 $0.00072 $0.01707
Sonnet 5.5 $0.00036 $0.00854
Haiku 4.5 $0.00018 $0.00427

Measured 27d ago against content hash 9b8c8aa13f28, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

litert-lm scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 27d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/android/litert-lm/SKILL.md · 373 lines

How it starts

The opening of the file, as written. The whole thing — 373 lines — stays where its author put it; the contents beside it link to each section on GitHub.

This skill provides step-by-step guidance for building an Android app that runs an open text LLM through the LiteRT-LM Kotlin API (com.google.ai.edge.litertlm) on the CPU or the GPU. The model is one .litertlm file. Images, audio, tool calling, and NPU backends aren't covered. For vision and audio models with .tflite files, suggest the litert-runtime skill.

When a LiteRT-LM class or method that this skill uses doesn't compile, you must read the LiteRT-LM Android guide and the LiteRT-LM README before changing the code.

Prerequisites

  • A Kotlin Android project (the Android Studio Empty Activity template is enough). The litertlm-android 0.18.0 AAR declares minSdk 24.
  • The dependency in the app-level build.gradle.kts file from Google Maven: implementation("com.google.ai.edge.litertlm:litertlm-android:0.18.0"). Google Maven lists the later releases.
  • For the GPU backend, two uses-native-library entries inside <application> in AndroidManifest.xml. Add the INTERNET permission if the app downloads the model.
  • The model file lives on the device's file system (hundreds of MB to a few GB), never in assets/ or in the APK.

Critical mandates

  • Dependency first : Before writing code that imports com.google.ai.edge.litertlm, add the litertlm-android dependency from Step 1 if the project lacks it. Verify with ./gradlew assembleDebug.
  • Background initialization : Engine(config).initialize() loads the weights and blocks for seconds. Call it on a background thread, never on the main thread.
  • Single owner : One single-thread executor owns the Engine and the Conversation. Creation, streaming, cancellation, and closing run on it.
  • Close once : Engine and Conversation are AutoCloseable. A second close on either throws IllegalStateException. So does close on an engine whose initialize threw. Store the engine only after initialize returns.
  • Model outside the APK : Pass an absolute path to EngineConfig. Never bundle a .litertlm file in assets/.

Read the full file on GitHub · 373 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 27d ago Changed · +237 lines · +37 tokens per session 9b8c8aa13f28
  2. 1mo ago Changed · +2 lines · +36 tokens per session 5b63724e45ea
  3. 1mo ago Changed 00912a56cd86
  4. 1mo ago Changed · +23 lines ef7c5ccc345d
  5. 2mo ago First seen · 111 lines · 106 tokens per session scan A 90f4118e4982

Subscribe to this mod's changes

litert-lm is a skill published in the GitHub repository google-ai-edge/litert-samples (508 stars, last pushed 5d ago), licensed Apache-2.0. It adds 179 tokens to every session and 4,268 once invoked, about $0.0007 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-02.

Related

litert-lm compared with skills from other repositories

litert-lm next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
litert-lmgoogle-ai-edge/litert-samplesSkill5085d agoApache-2.0A179Claude Code, Codex
maui-essentials-aidotnet/maui-labsSkill244yesterdayMITA86Claude Code, Codex
swift-mlx-lmkellyvv/PhoneClawSkill1.3k3mo agoApache-2.0A52Claude Code, Codex
swift-mlxkellyvv/PhoneClawSkill1.3k3mo agoApache-2.0A25Claude Code, Codex
vision-frameworkTalissonVitorino/kmp-ios-skillsSkill16todayMITA237Claude Code, Codex
apple-on-device-aiTalissonVitorino/kmp-ios-skillsSkill16todayMITA188Claude Code, Codex
coremlTalissonVitorino/kmp-ios-skillsSkill16todayMITA255Claude Code, Codex