litert-lm

litert-lm is a skill for Claude Code, Codex from google-ai-edge/litert-samples. It costs 106 tokens per session (2,255 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 106 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,255 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.00106 $0.02255
Opus 5.5 $0.00042 $0.00902
Sonnet 5.5 $0.00021 $0.00451
Haiku 4.5 $0.00011 $0.00226

Measured 7d ago against content hash 00912a56cd86, 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 7d 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/litert-lm/SKILL.md · 134 lines

How it starts

The opening of the file, as written. The whole thing — 134 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; guide: https://ai.google.dev/edge/litert-lm/android, sources: https://github.com/google-ai-edge/LiteRT-LM/blob/main/README.md) on the CPU or the GPU. The model is one .litertlm file. Images, audio, tool calling and NPU backends are not covered. For vision and audio models, use the litert-runtime skill: https://github.com/google-ai-edge/litert-samples/blob/main/skills/litert-runtime/SKILL.md (LiteRT: https://github.com/google-ai-edge/litert/blob/main/README.md).

Prerequisites

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

Detailed steps

1. Pick a model from litert-community

Choose a .litertlm file at https://huggingface.co/litert-community. Start with litert-community/gemma-4-E2B-it-litert-lm (the file gemma-4-E2B-it.litertlm, 2.6 GB) or the smaller litert-community/Qwen3-0.6B (Qwen3-0.6B.litertlm, 0.6 GB); both files run on the CPU and the GPU. A SoC suffix such as _Google_Tensor_G5 or .mediatek.mt6993 marks an NPU build (not covered here). The model card names the tested backends and the size. Converting a model yourself is a separate step: get a model.

Read the full file on GitHub · 134 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. 7d ago Changed 00912a56cd86
  2. 9d ago Changed · +23 lines ef7c5ccc345d
  3. 15d 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 (464 stars, last pushed yesterday), licensed Apache-2.0. It adds 106 tokens to every session and 2,255 once invoked, about $0.0004 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

Other skills, from other repositories

ml-kit-genai-prompt-api

Analyzes Android codebases to implement ML Kit GenAI Prompt API. Use this skill to send natural language requests on-device to Gemini Nano, use structured output with Prompt API, implement prefix caching, optimize the current prompt, or apply best practices.".

android/skills · 57 tokens

model-authoring

Empirical rules for authoring PyTorch models for on-device execution on Apple platforms, covering energy-efficient inference, scalable compute, and correctness testing. Use this skill whenever the user is writing, debugging, or reviewing PyTorch model code intended for on-device execution — even if they don't…

apple/coreai-models · 95 tokens

working-with-coreai

Use this skill whenever the user mentions coreai-torch, TorchConverter, coreai-build, AIModel, AIProgram, .aimodel, or wants to export/compile/run a PyTorch model on Apple silicon (iPhone, iPad, Mac). Also triggers for "deploy on device", "optimize for on-device performance", onboarding new models to Core AI, or…

apple/coreai-models · 91 tokens

adversarial-ml-evasion

Craft adversarial examples that cause trained ML classifiers to misclassify at inference time — image recognition, malware detectors, IDS, spam filters.

PurpleAILAB/Decepticon · 36 tokens

misinformation

Hunt LLM misinformation / overreliance (OWASP LLM09:2025) — confident-but-wrong outputs that flow into downstream automated decisions, compliance reports, customer communications, or autonomous code commits without verification.

PurpleAILAB/Decepticon · 49 tokens

vector-and-embedding-weaknesses

Hunt vector / embedding weaknesses (OWASP LLM08:2025) — adversarial inputs against the RAG / similarity layer that cause cross-tenant leak, embedding-inversion privacy loss, semantic confusion, and retriever-driven prompt injection.

PurpleAILAB/Decepticon · 59 tokens