Compiled Model App Scaffolding
Build a new Android app (Kotlin, Compose) around a verified LiteRT model using the CompiledModel API - the app architecture, the inference-layer lifecycle rules, model delivery, and the UI traps that masquerade as model bugs. Use when turning a converted and device-verified model into a demo or product app, when an app's inference layer leaks memory or blocks the UI, or when a model that verified clean looks wrong inside an app.
Install
npx skills add google-ai-edge/litert-samples --skill compiled-model-app-scaffoldinggit clone --depth 1 https://github.com/google-ai-edge/litert-samples.git /tmp/litert-samples
mkdir -p ~/.claude/skills
cp -r /tmp/litert-samples/skills/compiled-model-app-scaffolding ~/.claude/skills/compiled-model-app-scaffoldingPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# CompiledModel app scaffolding An app around a verified model is done when three things hold, in this order: 1. the app reproduces the model recipe's verification numbers on the accelerator the recipe verified — **before any UI exists**, 2. inference is confined and leak-free: one dispatcher owns the model, every buffer is closed, benchmarks include the readback, 3. the inference code is liftable — another app could take the helper file unchanged. Scope: this scaffolds a **new** app from a model recipe. Migrating an existing TFLite Interpreter app to CompiledModel is a different task with its own skill, `litert-compiled-model-migration`. LLMs are served through the LiteRT-LM Engine rather than raw CompiledModel — `samples/litert/text_to_speech_lm` is the reference for that case; everything below is the non-LLM CompiledModel app. ## Step 0: prove parity before building UI The first milestone has no UI: a bare harness that loads the `.tflite`, runs the recipe's verification input on the target accelerator, and reproduces the numbers recorded in the recipe README (correlation, residency). If they do not reproduce, stop — that is an `on-device-verification` problem, and no amount of app code fixes it. Only then build the ViewModel and the screen. ## The shape One sample = one standalone Gradle project, four layers:
Details
- Skill name
compiled-model-app-scaffolding- Repository
- google-ai-edge/litert-samples
- Path
skills/compiled-model-app-scaffolding/SKILL.md- License
- Apache-2.0
- Repo updated
- 17 November 2026
FAQ
What does the Compiled Model App Scaffolding skill do?
Build a new Android app (Kotlin, Compose) around a verified LiteRT model using the CompiledModel API - the app architecture, the inference-layer lifecycle rules, model delivery, and the UI traps that masquerade as model bugs. Use when turning a converted and device-verified model into a demo or product app, when an app's inference layer leaks memory or blocks the UI, or when a model that verified clean looks wrong inside an app.
How do I install the Compiled Model App Scaffolding skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add google-ai-edge/litert-samples --skill compiled-model-app-scaffolding. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Compiled Model App Scaffolding popular?
It lives in google-ai-edge/litert-samples, which has 499 GitHub stars and 134 forks.
Related skills
Litert Lm
499google-ai-edge/litert-samples
Builds an Android app that runs an open text LLM on the device, on the CPU or the GPU, with the LiteRT-LM Kotlin API (com.google.ai.edge.litertlm:litertlm-android). Use this skill when creating a chat, summarization, or extraction feature with a .litertlm model from Hugging Face litert-community (Gemma, Qwen, Llama, Phi), including the Gradle dependency, the GPU manifest entries, getting the model file onto the device, Engine initialization off the main thread, a streamed multi-turn Conversation with sendMessageAsync, and the AndroidViewModel and Compose screen. Don't use for running .tflite v
Litert Runtime
499google-ai-edge/litert-samples
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, CPU memory optimization, Bitmap preprocessing, AndroidViewModel GPU-to-CPU fallback with warm-up on a single-thread dispatcher, LiteRT in Google Play services (play-services-litert), migrating from legacy org.tensorflow.lite.Interpreter, GpuDelegate, or play-services-tflite, and latency benchmarking. Don't use for r
Accuracy Safe Quantization
499google-ai-edge/litert-samples
Shrink a converted LiteRT model with ai-edge-quantizer (fp16 / int8 / int4) without losing accuracy, verifying parity against the float source after every step. Use when choosing a quantization recipe for a new model, when a quantized model fails to load, degrades on a task benchmark, or degenerates over long generations, or when deciding between dynamic-range, weight-only, and blockwise variants.
GPU Clean Conversion
499google-ai-edge/litert-samples
Convert a PyTorch or Hugging Face model into a LiteRT model that runs fully on the GPU via the CompiledModel API with verified-correct output, and lay it out as a model recipe. Use when converting a new model, or when a converted model is rejected by the GPU, falls back to CPU, or returns wrong numbers on device.
Benchmark on Ddp
499google-ai-edge/litert-samples
Measure a LiteRT .tflite model with `benchmark_model` on Developer Device Platform (DDP) lab phones through `litert benchmark --ddp`, or on the Mac you run it from, and turn the session into rows of the performance leaderboard under benchmark/leaderboard - one matrix entry per model, one session per accelerator, collect results.pb and runtime_info.pb, rebuild board.json, check the page, commit the data. Use when a model needs latency and memory numbers per platform, device and accelerator, or when a new benchmark_model release means re-measuring the board.
Litert Compiled Model Migration
499google-ai-edge/litert-samples
Rapidly migrate an Android application from legacy TensorFlow Lite (TFLite) to the modern LiteRT CompiledModel API (2.x) in Open Source GitHub repositories, keeping the TensorFlow Lite Support Library as LiteRT Support (litert-support 2.3.0). Covers buffer reuse, NPU JIT compilation, a reference implementation, and a two-stage verification gate (compile check, then an on-device parity test against a golden output).
Browse the most popular Claude skills, all ai, llms & agents skills, or write your own with the skills generator.