litert-lm

litert-lm is a skill for Claude Code from ArisGuimera/MobiAI-Core. It costs 179 tokens per session (4,268 once invoked), scanned A, a copy of litert-lm, MIT.

An Android integration guide for running an open text language model on the device with the LiteRT-LM Kotlin API. It supports chat, summarization, and extraction with a single .litertlm model on the CPU or GPU.

In plain words
What is it for?
Use it to build on-device text-generation features such as chat, summarization, or structured information extraction in a Kotlin Android app.
Why use it?
It explains how to package and load a large local language model without treating it as an ordinary app asset. It does not cover image, audio, tool-calling, or NPU use.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the android plugin — 35 skills shipped together

Good fit Use it to build on-device text-generation features such as chat, summarization, or structured information extraction in a Kotlin Android app.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/arisguimera/mobiai-core/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 ArisGuimera/MobiAI-Core --skill litert-lm
Clone the repo
git clone --depth 1 https://github.com/ArisGuimera/MobiAI-Core

Made for: Claude Code.

Or install android, the plugin that ships this one along with the rest of its 35 skills.

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/arisguimera/mobiai-core/litert-lm/github.svg)](https://agentmods.dev/skills/arisguimera/mobiai-core/litert-lm)
Your own site
<a href="https://agentmods.dev/skills/arisguimera/mobiai-core/litert-lm"><img src="https://agentmods.dev/badge/skills/arisguimera/mobiai-core/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/arisguimera/mobiai-core/litert-lm"><img src="https://agentmods.dev/badge/skills/arisguimera/mobiai-core/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 100% copy Near-identical to another mod 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 yesterday 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 yesterday.

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.

Origin

This is a copy

100% identical to litert-lm — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/android/skills/google/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. yesterday First seen · 373 lines · 179 tokens per session scan A 9b8c8aa13f28

Subscribe to this mod's changes

litert-lm is a skill published in the GitHub repository ArisGuimera/MobiAI-Core (489 stars, last pushed yesterday), licensed MIT. 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. It is 100% identical to litert-lm, differing in 0 lines, and is treated as a copy.

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

litert-runtime

Configures and implements LiteRT (.tflite) on-device inference on Android in Kotlin using the CompiledModel API on CPU and GPU. Use this skill for any Android LiteRT or .tflite task, including Gradle setup, image classification or vision/audio/embedding helpers, TensorBuffer reuse, Bitmap preprocessing…

android/skills · 127 tokens

foundation-models-on-device

Apple FoundationModels framework for on-device LLM — text generation, guided generation with @Generable, tool calling, and snapshot streaming in iOS 26+.

hashgraph-online/awesome-codex-plugins · 38 tokens

axiom-ai

Use when implementing, testing, or evaluating ANY Apple Intelligence, on-device AI, or speech-to-text feature. Covers Foundation Models, @Generable, LanguageModelSession, Tool protocol, eval suites, model-as-judge scoring, SpeechTranscriber, CoreML.

CharlesWiltgen/Axiom · 57 tokens