litert-compiled-model-migration

litert-compiled-model-migration is a skill for Claude Code, Codex from google-ai-edge/litert-samples. It costs 101 tokens per session (7,961 once invoked), scanned A, original, Apache-2.0.

A guide for updating Android apps from the older TensorFlow Lite system to Google's newer LiteRT CompiledModel API. It covers Kotlin, Java, and projects that also use native C++ code.

In plain words
What is it for?
Migrating Android machine-learning code, including asynchronous runs, shared input and output buffers, neural-processing-unit compilation, and automated checks.
Why use it?
It helps replace an outdated machine-learning interface while checking that the migrated app still works.

Skill for Claude CodeCodex

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

Good fit Migrating Android machine-learning code, including asynchronous runs, shared input and output buffers, neural-processing-unit compilation, and automated checks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/google-ai-edge/litert-samples/litert-compiled-model-migration
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-compiled-model-migration
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-compiled-model-migration

README.md
[![agentmods](https://agentmods.dev/badge/skills/google-ai-edge/litert-samples/litert-compiled-model-migration/github.svg)](https://agentmods.dev/skills/google-ai-edge/litert-samples/litert-compiled-model-migration)
Your own site
<a href="https://agentmods.dev/skills/google-ai-edge/litert-samples/litert-compiled-model-migration"><img src="https://agentmods.dev/badge/skills/google-ai-edge/litert-samples/litert-compiled-model-migration/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-compiled-model-migration

Your own site · 80×15
<a href="https://agentmods.dev/skills/google-ai-edge/litert-samples/litert-compiled-model-migration"><img src="https://agentmods.dev/badge/skills/google-ai-edge/litert-samples/litert-compiled-model-migration.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 101 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 7,961 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00101 $0.07961
Opus 5.5 $0.00040 $0.03184
Sonnet 5.5 $0.00020 $0.01592
Haiku 4.5 $0.00010 $0.00796

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

Security

Grade A, and why

litert-compiled-model-migration 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 20d 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-compiled-model-migration/SKILL.md · 215 lines

How it starts

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

Skill: LiteRT Compiled Model Migration SKILL

Description

This skill guides an AI agent to rapidly migrate an Android application from legacy TensorFlow Lite (TFLite) to the modern LiteRT CompiledModel API (2.x) in Open Source GitHub repositories. It prioritizes a high-speed, 1st-pass "Like for Like" baseline migration with automated self-testing, and encourages advanced performance upgrades including off-main-thread execution with buffer reuse and NPU JIT compilation.

Read first: what the Kotlin CompiledModel API (com.google.ai.edge.litert, 2.3.0; 2.2.0 has the same API) has

  • CompiledModel.create(context.assets, assetName, CompiledModel.Options(Accelerator.CPU), env) and create(filePath, options, env); Options takes one or more of Accelerator.CPU / GPU / NPU (e.g. Options(Accelerator.GPU, Accelerator.CPU)); env is Environment.create(context) (optional; enables the compiler cache) or Environment.create(context, BuiltinNpuAcceleratorProvider(context)) for the NPU. Nothing takes a ByteBuffer or a mapped file.
  • Buffers come from the model (createInputBuffers() / createOutputBuffers(), List<TensorBuffer>; writeFloat(FloatArray) / writeInt8(ByteArray) / writeInt / writeLong, readFloat() and friends; create them once). run(inputs, outputs) is synchronous on the CPU; on the GPU it can return before the GPU finishes and read*() waits; there is no callback API. CompiledModel, TensorBuffer and Environment are AutoCloseable: close buffers, then the model, then an Environment the app created.
  • CompiledModel.Options() with no accelerator compiles, but create then throws LiteRtException. Interpreter, GpuDelegate, NnApiDelegate and the Support library's Model (com.google.ai.edge.litert.support.model.Model, which runs on InterpreterApi) do not appear in migrated code; the rest of LiteRT Support does, under com.google.ai.edge.litert.support (Step 1), with org.tensorflow.lite.DataType as the type its classes take. The litert AAR also contains org.tensorflow.lite.Interpreter, so leftover Interpreter code compiles (all but setUseNNAPI, which 2.x does not have) and the Stage 1 import check is what catches it. templates/LiteRtModel.kt compiles against the 2.3.0 and the 2.2.0 artifacts; start from it.

Read the full file on GitHub · 215 lines

Files

What ships with it

5 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. 20d ago Changed · +1 lines · +22 tokens per session 10f459c63ea8
  2. 1mo ago Changed · +17 lines · +6 tokens per session b41d23f84c16
  3. 1mo ago Changed · +2 lines · -3 tokens per session 463647e7fb7e
  4. 1mo ago First seen · 195 lines · 76 tokens per session scan A a62d67083a9c

Subscribe to this mod's changes

litert-compiled-model-migration is a skill published in the GitHub repository google-ai-edge/litert-samples (473 stars, last pushed yesterday), licensed Apache-2.0. It adds 101 tokens to every session and 7,961 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-08-30.

Related

Other skills, from other repositories

swift-idioms

Swift idioms and best practices: value types, Optionals hygiene, protocol-oriented design, async/await and Actor concurrency, and XCTest. Use when writing, refactoring, or reviewing Swift iOS, macOS, or server-side code.

irahardianto/awesome-agv · 54 tokens

kotlin-expert

Expert-level Kotlin development, Android, coroutines, and multiplatform. Use when the user mentions Android, coroutines, multiplatform, or JVM, or when the task involves Kotlin Fundamentals, Android Development, Kotlin Multiplatform, or Kotlin Style.

personamanagmentlayer/pcl · 55 tokens

wear-compose-m3

Guidance for Wear OS Compose Material3 (Wear Compose Material 3 / Wear Compose Material3) watch and wearable apps. Covers creating, updating, and migrating projects (Material 2.5 and Horologist migration) using androidx.wear.compose.material3, androidx.wear.compose.foundation, and androidx.wear.compose.navigation3…

android/skills · 91 tokens

kotlin-specialist

Provides idiomatic Kotlin implementation patterns including coroutine concurrency, Flow stream handling, multiplatform architecture, Compose UI construction, Ktor server setup, and type-safe DSL design. Use when building Kotlin applications requiring coroutines, multiplatform development, or Android with Compose.…

Jeffallan/claude-skills · 86 tokens

ink-custom-brush-builder

Creates custom BrushFamily definitions for an Android app using Jetpack Ink (androidx.ink 1.1.0-alpha03 and higher). Use this skill when configuring custom BrushTip shapes, adding pressure, tilt, speed, or noise sensitivity using BrushBehavior node graphs, creating multi-coat layered brushes, applying tiling or…

android/skills · 159 tokens

build-android-binary

Compile a PAM control's Android Kotlin module into the runtime-loadable DEX for a .ppmplugin. Creates a staged Gradle build with the pinned wrapper and react-android compile dependency, verifies manifest/module/package alignment and runtime-loading constraints, builds the release AAR, then runs d8 --min-api 24. Writes…

microsoft/power-platform-skills · 150 tokens