Creator · google-ai-edge
Last updated · Sep 4, 2026
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
Creator · google-ai-edge
Last updated · Sep 4, 2026
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
Creator · google-ai-edge
Last updated · Sep 4, 2026
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
Creator · google-ai-edge
Last updated · Sep 4, 2026
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
Sandbox only
Install targets
Codex install prompt
Install the "compiled-model-app-scaffolding" agent skill from https://github.com/google-ai-edge/litert-samples/tree/main/skills/compiled-model-app-scaffolding. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: 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. After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"google-ai-edge-compiled-model-app-scaffolding","task":"Install compiled-model-app-scaffolding","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Design assets, images, video, audio, multimodal media, presentation, and creative production skills.
Scenario
Design and creative
I need my agent to produce design assets, UI directions, presentations, or creative media workflows.
Agent fit
Claude Code + CLI + Codex
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add google-ai-edge/litert-samples --skill compiled-model-app-scaffolding
Maintenance
fresh
3d since push
Risk
Needs review
Financial research output is not financial advice; require human review before any live investment decision
GitHub quality
416
73/100 Quality · 80/100 Trust
Coverage tags
Review notes
Financial research output is not financial advice; require human review before any live investment decision · Financial research output is not financial advice; require human review before any live investment decision.
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
StrongSolid option that is likely worth shortlisting for production workflows.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
Needs reviewA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
416 GitHub stars
Repo activity
416 stars, 116 forks
Maintenance
3d since push
License
Apache-2.0
Install
npx skills add google-ai-edge/litert-samples --skill compiled-model-app-scaffolding
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add google-ai-edge/litert-samples --skill compiled-model-app-scaffoldingDo not use when
Alternative
174.6K Stars
npx skills add anthropics/skills --skill frontend-design
Alternative
84.6K Stars
npx skills add Leonxlnx/taste-skill --skill design-taste-frontend
Alternative
1.8K Stars
npx skills add Alisa0808/vox-director --skill vox-director
Alternative
174.6K Stars
npx skills add anthropics/skills --skill canvas-design
Agent safety v2
Usable candidate, but the agent should surface permission and audit notes before installation.
Require human approval before installing into a real workspace.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Skill may read or write project files, documents, generated artifacts, or local workspace state.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20compiled-model-app-scaffolding%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20compiled-model-app-scaffolding%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/google-ai-edge-compiled-model-app-scaffolding/install
Agent should check
Copy prompt
Task: Use compiled-model-app-scaffolding in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20compiled-model-app-scaffolding%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/google-ai-edge-compiled-model-app-scaffolding/install
Install command: npx skills add google-ai-edge/litert-samples --skill compiled-model-app-scaffolding
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/google-ai-edge-compiled-model-app-scaffolding/install
LLM text format
/api/skills/google-ai-edge-compiled-model-app-scaffolding/install?format=text
Find alternatives
/api/skills/search?q=compiled-model-app-scaffolding&limit=3
Agent prompt
Use compiled-model-app-scaffolding for this task. Review https://www.openagentskill.com/api/skills/google-ai-edge-compiled-model-app-scaffolding/install, then install with: npx skills add google-ai-edge/litert-samples --skill compiled-model-app-scaffoldingRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/google-ai-edge-compiled-model-app-scaffolding
LLM text
/api/registry/manifest/google-ai-edge-compiled-model-app-scaffolding?format=text
Install alias
/api/registry/install/google-ai-edge-compiled-model-app-scaffolding
Recommend
/api/registry/recommend?task=Use%20compiled-model-app-scaffolding%20in%20an%20agent%20workflow&limit=3
Agent fit
Testing and QA
Use-case tags
Platforms
Claude Code
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Shortlist this skill and compare it with close alternatives before production adoption.
Role in stack
Companion skill
Primary fit
Testing and QA
Trust label
Strong shortlist
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
INFO416 GitHub stars
Stars/forks activity
INFO416 stars, 116 forks; issue activity unavailable in current metadata
Recent maintenance
PASS3d since push
License clarity
PASSApache-2.0
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
Solid option that is likely worth shortlisting for production workflows.
Workflow fit
Verify behavior
I need my agent to test a web app, reproduce bugs, and verify fixes.
Operate local tools
I need my agent to operate local files and desktop apps in a repeatable workflow.
Operate web apps
I need my agent to control a browser, fill forms, and verify web app workflows.
Workflow fit
Design, build, test, and ship interfaces
A practical workflow for agents that turn product briefs or Figma designs into polished frontend code, review the result, test it in a browser, and prepare a safe deployment.
Operate and verify web apps
A workflow for agents that navigate products, fill forms, take screenshots, and verify real user flows across web applications.
Turn skills into distribution
A workflow for turning newly indexed skills into SEO briefs, social drafts, comparison pages, and reusable publishing workflows.
Alternative shortlist
Similar skills that may fit this task.
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
Turn one topic into a narrated Vox-style paper-collage explainer or ad video, from script through captions.
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
--- name: compiled-model-app-scaffolding description: 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. ---
# 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. LM models are consumed through the LiteRT-LM Engine rather than raw CompiledModel — `samples/litert/text_to_speech_lm` is the reference for that lane; everything below is the non-LM 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:
``` app/src/main/java/<pkg>/ <Task>Helper.kt inference infra: owns the CompiledModel and its buffers; pre/post-processing; NO Android UI types MainViewModel.kt state machine: drives the helper on a confined dispatcher, exposes UiState UiState.kt one immutable data class MainActivity.kt ComponentActivity + setContent, nothing else view/ Screen.kt, Theme.kt, Color.kt — Compose only app/src/main/res/values/ strings.xml etc. — no UI strings in Kotlin ```
The worked example of the full shape is `samples/litert/image_segmentation/kotlin_cpu_gpu/android`. The layer boundary that matters most is the helper's: pre/post-processing is part of the model contract (it must match what the recipe exported against), so it lives with the model, not in the screen. Reusable inference code is worth more than UI polish — a reader will lift `<Task>Helper.kt` and delete the rest.
## Inference-layer rules
1. **One confined dispatcher owns the model.** `Dispatchers.IO.limitedParallelism(1, "ModelDispatcher")` in the helper; create, run, and close the model only inside `withContext(singleThreadDispatcher)`. Not a bare executor in the Activity, and never the main thread. 2. **Buffers are created once, reused every frame, and closed.** `TensorBuffer` is `AutoCloseable`; forgetting the buffers leaks native memory even when the model itself is closed. The vendored `CompiledModelRunner` (below) gets the whole lifecycle right. 3. **`run()` enqueues; the readback waits.** `run()` may return before the GPU finishes — the output read is the synchronization point. Benchmark run + readback together, never `run()` alone. 4. **Warm up once at init.** The first GPU inference includes shader compilation. Run one inference on dummy input right after create, so the first user action is not the compile, and no first-run number ever gets quoted as latency. 5. **Ask for the strict accelerator the recipe verified.** `Accelerator.GPU` fails compilation on an unsupported op instead of silently falling back — that is a feature. Surface the failure as a visible error and route it back to the model recipe; do not paper over it with a CPU fallback that makes a 10× slowdown look like a working app. 6. **Stateful and multi-graph models: move references, not data.** Feed step N's output buffers as step N+1's inputs (buffer ping-pong) instead of copying state through the host. When one app creates many `CompiledModel`s (pipelines, chunked models), create one `Environment` and pass it to every `CompiledModel.create` call, and close per-run buffers — per-create GPU contexts leak, and a create-per-step loop will eventually take the process down (observed at ~20 creates). Treat the GPU serialization/program-cache options as untested per device — enabling program-cache serialization has aborted a process on first compile, and the compiler-cache environment option targets NPU JIT, not GPU shader caching.
## Vendor the helpers, don't rewrite them
`utilities/common/kotlin/` holds the canonical copies of the code every app needs and every app gets subtly wrong when written from scratch:
| File | What it provides | |---|---| | `CompiledModelRunner.kt` | the lifecycle in rules 1–3, with the sharp edges documented | | `ImageTensor.kt` | Bitmap → float tensor; mean/std, NCHW/NHWC, RGB/BGR, letterbox with coordinate mapping back | | `AudioCapture.kt` | 16 kHz mono `AudioRecord` loop delivering float chunks | | `RealtimeCameraPipeline.kt` | CameraX capture → pooled Bitmap incl. rotation | | `MathOps.kt` | softmax, argmax, IoU, NMS |
Vendor a copy with its provenance line, keep model-specific values in constructor arguments, and fix bugs in the canonical first — `utilities/tools/sync_common.py --check` is the drift gate. The preprocessing arguments **are** the model contract: a wrong mean/std or RGB/BGR looks exactly like a broken model, and it is the first thing to diff against the recipe's export script when app output is subtly wrong.
## Model delivery
Weights are never committed.
- **Bundleable models**: fetch at build with a `download_model.gradle` (Hugging Face URL → `assets/`), and set `androidResources { noCompress += "tflite" }` so the asset stays mmappable. Worked example: `samples/litert/image_segmentation/kotlin_cpu_gpu`. - **Models too big to bundle**: stage into the app's private `filesDir` with an `install_to_device.sh` (`adb push` to `/data/local/tmp`, then `run-as <pkg> cp`), and load with the from-file path. Worked example: `samples/litert/text_to_speech/kotlin_cpu_gpu/android`.
Link the model recipe (`models/<family>/<model>/`) from the app README; conversion and verification scripts belong to the recipe, not the app.
## UI traps that masquerade as model bugs
- **The tiny-output trap.** `Image(contentScale = Fit)` with `fillMaxWidth()` inside a `verticalScroll` renders the bitmap at native pixel size: with no height constraint the row is exactly as tall as the bitmap and Fit never upscales, so a 256-px model output looks broken on a 1080-px screen. Drop the scroll and give each image `weight(1f)` in the Column. - **Audio I/O belongs to the ViewModel.** Mic capture and `AudioTrack` playback run on the confined dispatcher in the ViewModel; the screen only requests permission (`rememberLauncherForActivityResult`) and renders state. For file input use `OpenDocument` with audio MIME types — the photo picker cannot see audio. - **A "slow model" is often the UI thread.** If the app stutters, check that every helper call site goes through the ViewModel's dispatcher before profiling the model — a verified model that benchmarked fine in step 0 did not get slower by being in an app.
## Output layout
``` samples/litert/<task>/kotlin_cpu_gpu/android/ app/src/main/java/... the four layers above app/download_model.gradle or install_to_device.sh at the app root README.md what it demos, which model recipe it consumes, device + accelerator it was verified on ```
State the device the app was verified on, the same way the model recipe does. An app README that names no device inherits none of the recipe's verification.
Source provenance
Decision snapshot
recent repository activity
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for compiled-model-app-scaffolding, ready for a manual X post.
compiled-model-app-scaffolding: Build a new Android app (Kotlin, Compose) around a verified LiteRT model using the CompiledMo... 416 stars https://www.openagentskill.com/skills/google-ai-edge-compiled-model-app-scaffolding?ref=x
Listing + install path for compiled-model-app-scaffolding: https://www.openagentskill.com/skills/google-ai-edge-compiled-model-app-scaffolding?ref=x Install: npx skills add google-ai-edge/litert-samples --skill compiled-model-app-scaffolding
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to google-ai-edge but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/google-ai-edge-compiled-model-app-scaffolding?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/google-ai-edge-compiled-model-app-scaffolding?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/google-ai-edge-compiled-model-app-scaffolding/audit)
[](https://www.openagentskill.com/skills/google-ai-edge-compiled-model-app-scaffolding?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)google-ai-edge
@google-ai-edge
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
Frontend Design
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
174.6K StarsTaste Skill: Anti-Slop Frontend
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
84.6K StarsVox Director
Turn one topic into a narrated Vox-style paper-collage explainer or ad video, from script through captions.
1.8K StarsCanvas Design
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
174.6K StarsSandbox only
Install targets
Codex install prompt
Install the "compiled-model-app-scaffolding" agent skill from https://github.com/google-ai-edge/litert-samples/tree/main/skills/compiled-model-app-scaffolding. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: 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. After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"google-ai-edge-compiled-model-app-scaffolding","task":"Install compiled-model-app-scaffolding","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Design assets, images, video, audio, multimodal media, presentation, and creative production skills.
Scenario
Design and creative
I need my agent to produce design assets, UI directions, presentations, or creative media workflows.
Agent fit
Claude Code + CLI + Codex
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add google-ai-edge/litert-samples --skill compiled-model-app-scaffolding
Maintenance
fresh
3d since push
Risk
Needs review
Financial research output is not financial advice; require human review before any live investment decision
GitHub quality
416
73/100 Quality · 80/100 Trust
Coverage tags
Review notes
Financial research output is not financial advice; require human review before any live investment decision · Financial research output is not financial advice; require human review before any live investment decision.
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
StrongSolid option that is likely worth shortlisting for production workflows.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
Needs reviewA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
416 GitHub stars
Repo activity
416 stars, 116 forks
Maintenance
3d since push
License
Apache-2.0
Install
npx skills add google-ai-edge/litert-samples --skill compiled-model-app-scaffolding
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add google-ai-edge/litert-samples --skill compiled-model-app-scaffoldingDo not use when
Alternative
174.6K Stars
npx skills add anthropics/skills --skill frontend-design
Alternative
84.6K Stars
npx skills add Leonxlnx/taste-skill --skill design-taste-frontend
Alternative
1.8K Stars
npx skills add Alisa0808/vox-director --skill vox-director
Alternative
174.6K Stars
npx skills add anthropics/skills --skill canvas-design
Agent safety v2
Usable candidate, but the agent should surface permission and audit notes before installation.
Require human approval before installing into a real workspace.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Skill may read or write project files, documents, generated artifacts, or local workspace state.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20compiled-model-app-scaffolding%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20compiled-model-app-scaffolding%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/google-ai-edge-compiled-model-app-scaffolding/install
Agent should check
Copy prompt
Task: Use compiled-model-app-scaffolding in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20compiled-model-app-scaffolding%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/google-ai-edge-compiled-model-app-scaffolding/install
Install command: npx skills add google-ai-edge/litert-samples --skill compiled-model-app-scaffolding
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/google-ai-edge-compiled-model-app-scaffolding/install
LLM text format
/api/skills/google-ai-edge-compiled-model-app-scaffolding/install?format=text
Find alternatives
/api/skills/search?q=compiled-model-app-scaffolding&limit=3
Agent prompt
Use compiled-model-app-scaffolding for this task. Review https://www.openagentskill.com/api/skills/google-ai-edge-compiled-model-app-scaffolding/install, then install with: npx skills add google-ai-edge/litert-samples --skill compiled-model-app-scaffoldingRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/google-ai-edge-compiled-model-app-scaffolding
LLM text
/api/registry/manifest/google-ai-edge-compiled-model-app-scaffolding?format=text
Install alias
/api/registry/install/google-ai-edge-compiled-model-app-scaffolding
Recommend
/api/registry/recommend?task=Use%20compiled-model-app-scaffolding%20in%20an%20agent%20workflow&limit=3
Agent fit
Testing and QA
Use-case tags
Platforms
Claude Code
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Shortlist this skill and compare it with close alternatives before production adoption.
Role in stack
Companion skill
Primary fit
Testing and QA
Trust label
Strong shortlist
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
INFO416 GitHub stars
Stars/forks activity
INFO416 stars, 116 forks; issue activity unavailable in current metadata
Recent maintenance
PASS3d since push
License clarity
PASSApache-2.0
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
Solid option that is likely worth shortlisting for production workflows.
Workflow fit
Verify behavior
I need my agent to test a web app, reproduce bugs, and verify fixes.
Operate local tools
I need my agent to operate local files and desktop apps in a repeatable workflow.
Operate web apps
I need my agent to control a browser, fill forms, and verify web app workflows.
Workflow fit
Design, build, test, and ship interfaces
A practical workflow for agents that turn product briefs or Figma designs into polished frontend code, review the result, test it in a browser, and prepare a safe deployment.
Operate and verify web apps
A workflow for agents that navigate products, fill forms, take screenshots, and verify real user flows across web applications.
Turn skills into distribution
A workflow for turning newly indexed skills into SEO briefs, social drafts, comparison pages, and reusable publishing workflows.
Alternative shortlist
Similar skills that may fit this task.
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
Turn one topic into a narrated Vox-style paper-collage explainer or ad video, from script through captions.
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
--- name: compiled-model-app-scaffolding description: 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. ---
# 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. LM models are consumed through the LiteRT-LM Engine rather than raw CompiledModel — `samples/litert/text_to_speech_lm` is the reference for that lane; everything below is the non-LM 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:
``` app/src/main/java/<pkg>/ <Task>Helper.kt inference infra: owns the CompiledModel and its buffers; pre/post-processing; NO Android UI types MainViewModel.kt state machine: drives the helper on a confined dispatcher, exposes UiState UiState.kt one immutable data class MainActivity.kt ComponentActivity + setContent, nothing else view/ Screen.kt, Theme.kt, Color.kt — Compose only app/src/main/res/values/ strings.xml etc. — no UI strings in Kotlin ```
The worked example of the full shape is `samples/litert/image_segmentation/kotlin_cpu_gpu/android`. The layer boundary that matters most is the helper's: pre/post-processing is part of the model contract (it must match what the recipe exported against), so it lives with the model, not in the screen. Reusable inference code is worth more than UI polish — a reader will lift `<Task>Helper.kt` and delete the rest.
## Inference-layer rules
1. **One confined dispatcher owns the model.** `Dispatchers.IO.limitedParallelism(1, "ModelDispatcher")` in the helper; create, run, and close the model only inside `withContext(singleThreadDispatcher)`. Not a bare executor in the Activity, and never the main thread. 2. **Buffers are created once, reused every frame, and closed.** `TensorBuffer` is `AutoCloseable`; forgetting the buffers leaks native memory even when the model itself is closed. The vendored `CompiledModelRunner` (below) gets the whole lifecycle right. 3. **`run()` enqueues; the readback waits.** `run()` may return before the GPU finishes — the output read is the synchronization point. Benchmark run + readback together, never `run()` alone. 4. **Warm up once at init.** The first GPU inference includes shader compilation. Run one inference on dummy input right after create, so the first user action is not the compile, and no first-run number ever gets quoted as latency. 5. **Ask for the strict accelerator the recipe verified.** `Accelerator.GPU` fails compilation on an unsupported op instead of silently falling back — that is a feature. Surface the failure as a visible error and route it back to the model recipe; do not paper over it with a CPU fallback that makes a 10× slowdown look like a working app. 6. **Stateful and multi-graph models: move references, not data.** Feed step N's output buffers as step N+1's inputs (buffer ping-pong) instead of copying state through the host. When one app creates many `CompiledModel`s (pipelines, chunked models), create one `Environment` and pass it to every `CompiledModel.create` call, and close per-run buffers — per-create GPU contexts leak, and a create-per-step loop will eventually take the process down (observed at ~20 creates). Treat the GPU serialization/program-cache options as untested per device — enabling program-cache serialization has aborted a process on first compile, and the compiler-cache environment option targets NPU JIT, not GPU shader caching.
## Vendor the helpers, don't rewrite them
`utilities/common/kotlin/` holds the canonical copies of the code every app needs and every app gets subtly wrong when written from scratch:
| File | What it provides | |---|---| | `CompiledModelRunner.kt` | the lifecycle in rules 1–3, with the sharp edges documented | | `ImageTensor.kt` | Bitmap → float tensor; mean/std, NCHW/NHWC, RGB/BGR, letterbox with coordinate mapping back | | `AudioCapture.kt` | 16 kHz mono `AudioRecord` loop delivering float chunks | | `RealtimeCameraPipeline.kt` | CameraX capture → pooled Bitmap incl. rotation | | `MathOps.kt` | softmax, argmax, IoU, NMS |
Vendor a copy with its provenance line, keep model-specific values in constructor arguments, and fix bugs in the canonical first — `utilities/tools/sync_common.py --check` is the drift gate. The preprocessing arguments **are** the model contract: a wrong mean/std or RGB/BGR looks exactly like a broken model, and it is the first thing to diff against the recipe's export script when app output is subtly wrong.
## Model delivery
Weights are never committed.
- **Bundleable models**: fetch at build with a `download_model.gradle` (Hugging Face URL → `assets/`), and set `androidResources { noCompress += "tflite" }` so the asset stays mmappable. Worked example: `samples/litert/image_segmentation/kotlin_cpu_gpu`. - **Models too big to bundle**: stage into the app's private `filesDir` with an `install_to_device.sh` (`adb push` to `/data/local/tmp`, then `run-as <pkg> cp`), and load with the from-file path. Worked example: `samples/litert/text_to_speech/kotlin_cpu_gpu/android`.
Link the model recipe (`models/<family>/<model>/`) from the app README; conversion and verification scripts belong to the recipe, not the app.
## UI traps that masquerade as model bugs
- **The tiny-output trap.** `Image(contentScale = Fit)` with `fillMaxWidth()` inside a `verticalScroll` renders the bitmap at native pixel size: with no height constraint the row is exactly as tall as the bitmap and Fit never upscales, so a 256-px model output looks broken on a 1080-px screen. Drop the scroll and give each image `weight(1f)` in the Column. - **Audio I/O belongs to the ViewModel.** Mic capture and `AudioTrack` playback run on the confined dispatcher in the ViewModel; the screen only requests permission (`rememberLauncherForActivityResult`) and renders state. For file input use `OpenDocument` with audio MIME types — the photo picker cannot see audio. - **A "slow model" is often the UI thread.** If the app stutters, check that every helper call site goes through the ViewModel's dispatcher before profiling the model — a verified model that benchmarked fine in step 0 did not get slower by being in an app.
## Output layout
``` samples/litert/<task>/kotlin_cpu_gpu/android/ app/src/main/java/... the four layers above app/download_model.gradle or install_to_device.sh at the app root README.md what it demos, which model recipe it consumes, device + accelerator it was verified on ```
State the device the app was verified on, the same way the model recipe does. An app README that names no device inherits none of the recipe's verification.
Source provenance
Decision snapshot
recent repository activity
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for compiled-model-app-scaffolding, ready for a manual X post.
compiled-model-app-scaffolding: Build a new Android app (Kotlin, Compose) around a verified LiteRT model using the CompiledMo... 416 stars https://www.openagentskill.com/skills/google-ai-edge-compiled-model-app-scaffolding?ref=x
Listing + install path for compiled-model-app-scaffolding: https://www.openagentskill.com/skills/google-ai-edge-compiled-model-app-scaffolding?ref=x Install: npx skills add google-ai-edge/litert-samples --skill compiled-model-app-scaffolding
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to google-ai-edge but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/google-ai-edge-compiled-model-app-scaffolding?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/google-ai-edge-compiled-model-app-scaffolding?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/google-ai-edge-compiled-model-app-scaffolding/audit)
[](https://www.openagentskill.com/skills/google-ai-edge-compiled-model-app-scaffolding?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)google-ai-edge
@google-ai-edge
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
Frontend Design
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
174.6K StarsTaste Skill: Anti-Slop Frontend
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
84.6K StarsVox Director
Turn one topic into a narrated Vox-style paper-collage explainer or ad video, from script through captions.
1.8K StarsCanvas Design
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
174.6K StarsSandbox only
Install targets
Codex install prompt
Install the "compiled-model-app-scaffolding" agent skill from https://github.com/google-ai-edge/litert-samples/tree/main/skills/compiled-model-app-scaffolding. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: 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. After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"google-ai-edge-compiled-model-app-scaffolding","task":"Install compiled-model-app-scaffolding","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Design assets, images, video, audio, multimodal media, presentation, and creative production skills.
Scenario
Design and creative
I need my agent to produce design assets, UI directions, presentations, or creative media workflows.
Agent fit
Claude Code + CLI + Codex
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add google-ai-edge/litert-samples --skill compiled-model-app-scaffolding
Maintenance
fresh
3d since push
Risk
Needs review
Financial research output is not financial advice; require human review before any live investment decision
GitHub quality
416
73/100 Quality · 80/100 Trust
Coverage tags
Review notes
Financial research output is not financial advice; require human review before any live investment decision · Financial research output is not financial advice; require human review before any live investment decision.
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
StrongSolid option that is likely worth shortlisting for production workflows.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
Needs reviewA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
416 GitHub stars
Repo activity
416 stars, 116 forks
Maintenance
3d since push
License
Apache-2.0
Install
npx skills add google-ai-edge/litert-samples --skill compiled-model-app-scaffolding
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add google-ai-edge/litert-samples --skill compiled-model-app-scaffoldingDo not use when
Alternative
174.6K Stars
npx skills add anthropics/skills --skill frontend-design
Alternative
84.6K Stars
npx skills add Leonxlnx/taste-skill --skill design-taste-frontend
Alternative
1.8K Stars
npx skills add Alisa0808/vox-director --skill vox-director
Alternative
174.6K Stars
npx skills add anthropics/skills --skill canvas-design
Agent safety v2
Usable candidate, but the agent should surface permission and audit notes before installation.
Require human approval before installing into a real workspace.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Skill may read or write project files, documents, generated artifacts, or local workspace state.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20compiled-model-app-scaffolding%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20compiled-model-app-scaffolding%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/google-ai-edge-compiled-model-app-scaffolding/install
Agent should check
Copy prompt
Task: Use compiled-model-app-scaffolding in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20compiled-model-app-scaffolding%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/google-ai-edge-compiled-model-app-scaffolding/install
Install command: npx skills add google-ai-edge/litert-samples --skill compiled-model-app-scaffolding
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/google-ai-edge-compiled-model-app-scaffolding/install
LLM text format
/api/skills/google-ai-edge-compiled-model-app-scaffolding/install?format=text
Find alternatives
/api/skills/search?q=compiled-model-app-scaffolding&limit=3
Agent prompt
Use compiled-model-app-scaffolding for this task. Review https://www.openagentskill.com/api/skills/google-ai-edge-compiled-model-app-scaffolding/install, then install with: npx skills add google-ai-edge/litert-samples --skill compiled-model-app-scaffoldingRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/google-ai-edge-compiled-model-app-scaffolding
LLM text
/api/registry/manifest/google-ai-edge-compiled-model-app-scaffolding?format=text
Install alias
/api/registry/install/google-ai-edge-compiled-model-app-scaffolding
Recommend
/api/registry/recommend?task=Use%20compiled-model-app-scaffolding%20in%20an%20agent%20workflow&limit=3
Agent fit
Testing and QA
Use-case tags
Platforms
Claude Code
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Shortlist this skill and compare it with close alternatives before production adoption.
Role in stack
Companion skill
Primary fit
Testing and QA
Trust label
Strong shortlist
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
INFO416 GitHub stars
Stars/forks activity
INFO416 stars, 116 forks; issue activity unavailable in current metadata
Recent maintenance
PASS3d since push
License clarity
PASSApache-2.0
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
Solid option that is likely worth shortlisting for production workflows.
Workflow fit
Verify behavior
I need my agent to test a web app, reproduce bugs, and verify fixes.
Operate local tools
I need my agent to operate local files and desktop apps in a repeatable workflow.
Operate web apps
I need my agent to control a browser, fill forms, and verify web app workflows.
Workflow fit
Design, build, test, and ship interfaces
A practical workflow for agents that turn product briefs or Figma designs into polished frontend code, review the result, test it in a browser, and prepare a safe deployment.
Operate and verify web apps
A workflow for agents that navigate products, fill forms, take screenshots, and verify real user flows across web applications.
Turn skills into distribution
A workflow for turning newly indexed skills into SEO briefs, social drafts, comparison pages, and reusable publishing workflows.
Alternative shortlist
Similar skills that may fit this task.
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
Turn one topic into a narrated Vox-style paper-collage explainer or ad video, from script through captions.
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
--- name: compiled-model-app-scaffolding description: 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. ---
# 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. LM models are consumed through the LiteRT-LM Engine rather than raw CompiledModel — `samples/litert/text_to_speech_lm` is the reference for that lane; everything below is the non-LM 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:
``` app/src/main/java/<pkg>/ <Task>Helper.kt inference infra: owns the CompiledModel and its buffers; pre/post-processing; NO Android UI types MainViewModel.kt state machine: drives the helper on a confined dispatcher, exposes UiState UiState.kt one immutable data class MainActivity.kt ComponentActivity + setContent, nothing else view/ Screen.kt, Theme.kt, Color.kt — Compose only app/src/main/res/values/ strings.xml etc. — no UI strings in Kotlin ```
The worked example of the full shape is `samples/litert/image_segmentation/kotlin_cpu_gpu/android`. The layer boundary that matters most is the helper's: pre/post-processing is part of the model contract (it must match what the recipe exported against), so it lives with the model, not in the screen. Reusable inference code is worth more than UI polish — a reader will lift `<Task>Helper.kt` and delete the rest.
## Inference-layer rules
1. **One confined dispatcher owns the model.** `Dispatchers.IO.limitedParallelism(1, "ModelDispatcher")` in the helper; create, run, and close the model only inside `withContext(singleThreadDispatcher)`. Not a bare executor in the Activity, and never the main thread. 2. **Buffers are created once, reused every frame, and closed.** `TensorBuffer` is `AutoCloseable`; forgetting the buffers leaks native memory even when the model itself is closed. The vendored `CompiledModelRunner` (below) gets the whole lifecycle right. 3. **`run()` enqueues; the readback waits.** `run()` may return before the GPU finishes — the output read is the synchronization point. Benchmark run + readback together, never `run()` alone. 4. **Warm up once at init.** The first GPU inference includes shader compilation. Run one inference on dummy input right after create, so the first user action is not the compile, and no first-run number ever gets quoted as latency. 5. **Ask for the strict accelerator the recipe verified.** `Accelerator.GPU` fails compilation on an unsupported op instead of silently falling back — that is a feature. Surface the failure as a visible error and route it back to the model recipe; do not paper over it with a CPU fallback that makes a 10× slowdown look like a working app. 6. **Stateful and multi-graph models: move references, not data.** Feed step N's output buffers as step N+1's inputs (buffer ping-pong) instead of copying state through the host. When one app creates many `CompiledModel`s (pipelines, chunked models), create one `Environment` and pass it to every `CompiledModel.create` call, and close per-run buffers — per-create GPU contexts leak, and a create-per-step loop will eventually take the process down (observed at ~20 creates). Treat the GPU serialization/program-cache options as untested per device — enabling program-cache serialization has aborted a process on first compile, and the compiler-cache environment option targets NPU JIT, not GPU shader caching.
## Vendor the helpers, don't rewrite them
`utilities/common/kotlin/` holds the canonical copies of the code every app needs and every app gets subtly wrong when written from scratch:
| File | What it provides | |---|---| | `CompiledModelRunner.kt` | the lifecycle in rules 1–3, with the sharp edges documented | | `ImageTensor.kt` | Bitmap → float tensor; mean/std, NCHW/NHWC, RGB/BGR, letterbox with coordinate mapping back | | `AudioCapture.kt` | 16 kHz mono `AudioRecord` loop delivering float chunks | | `RealtimeCameraPipeline.kt` | CameraX capture → pooled Bitmap incl. rotation | | `MathOps.kt` | softmax, argmax, IoU, NMS |
Vendor a copy with its provenance line, keep model-specific values in constructor arguments, and fix bugs in the canonical first — `utilities/tools/sync_common.py --check` is the drift gate. The preprocessing arguments **are** the model contract: a wrong mean/std or RGB/BGR looks exactly like a broken model, and it is the first thing to diff against the recipe's export script when app output is subtly wrong.
## Model delivery
Weights are never committed.
- **Bundleable models**: fetch at build with a `download_model.gradle` (Hugging Face URL → `assets/`), and set `androidResources { noCompress += "tflite" }` so the asset stays mmappable. Worked example: `samples/litert/image_segmentation/kotlin_cpu_gpu`. - **Models too big to bundle**: stage into the app's private `filesDir` with an `install_to_device.sh` (`adb push` to `/data/local/tmp`, then `run-as <pkg> cp`), and load with the from-file path. Worked example: `samples/litert/text_to_speech/kotlin_cpu_gpu/android`.
Link the model recipe (`models/<family>/<model>/`) from the app README; conversion and verification scripts belong to the recipe, not the app.
## UI traps that masquerade as model bugs
- **The tiny-output trap.** `Image(contentScale = Fit)` with `fillMaxWidth()` inside a `verticalScroll` renders the bitmap at native pixel size: with no height constraint the row is exactly as tall as the bitmap and Fit never upscales, so a 256-px model output looks broken on a 1080-px screen. Drop the scroll and give each image `weight(1f)` in the Column. - **Audio I/O belongs to the ViewModel.** Mic capture and `AudioTrack` playback run on the confined dispatcher in the ViewModel; the screen only requests permission (`rememberLauncherForActivityResult`) and renders state. For file input use `OpenDocument` with audio MIME types — the photo picker cannot see audio. - **A "slow model" is often the UI thread.** If the app stutters, check that every helper call site goes through the ViewModel's dispatcher before profiling the model — a verified model that benchmarked fine in step 0 did not get slower by being in an app.
## Output layout
``` samples/litert/<task>/kotlin_cpu_gpu/android/ app/src/main/java/... the four layers above app/download_model.gradle or install_to_device.sh at the app root README.md what it demos, which model recipe it consumes, device + accelerator it was verified on ```
State the device the app was verified on, the same way the model recipe does. An app README that names no device inherits none of the recipe's verification.
Source provenance
Decision snapshot
recent repository activity
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for compiled-model-app-scaffolding, ready for a manual X post.
compiled-model-app-scaffolding: Build a new Android app (Kotlin, Compose) around a verified LiteRT model using the CompiledMo... 416 stars https://www.openagentskill.com/skills/google-ai-edge-compiled-model-app-scaffolding?ref=x
Listing + install path for compiled-model-app-scaffolding: https://www.openagentskill.com/skills/google-ai-edge-compiled-model-app-scaffolding?ref=x Install: npx skills add google-ai-edge/litert-samples --skill compiled-model-app-scaffolding
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to google-ai-edge but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/google-ai-edge-compiled-model-app-scaffolding?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/google-ai-edge-compiled-model-app-scaffolding?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/google-ai-edge-compiled-model-app-scaffolding/audit)
[](https://www.openagentskill.com/skills/google-ai-edge-compiled-model-app-scaffolding?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)google-ai-edge
@google-ai-edge
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
Frontend Design
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
174.6K StarsTaste Skill: Anti-Slop Frontend
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
84.6K StarsVox Director
Turn one topic into a narrated Vox-style paper-collage explainer or ad video, from script through captions.
1.8K StarsCanvas Design
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
174.6K StarsSandbox only
Install targets
Codex install prompt
Install the "compiled-model-app-scaffolding" agent skill from https://github.com/google-ai-edge/litert-samples/tree/main/skills/compiled-model-app-scaffolding. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: 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. After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"google-ai-edge-compiled-model-app-scaffolding","task":"Install compiled-model-app-scaffolding","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Design assets, images, video, audio, multimodal media, presentation, and creative production skills.
Scenario
Design and creative
I need my agent to produce design assets, UI directions, presentations, or creative media workflows.
Agent fit
Claude Code + CLI + Codex
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add google-ai-edge/litert-samples --skill compiled-model-app-scaffolding
Maintenance
fresh
3d since push
Risk
Needs review
Financial research output is not financial advice; require human review before any live investment decision
GitHub quality
416
73/100 Quality · 80/100 Trust
Coverage tags
Review notes
Financial research output is not financial advice; require human review before any live investment decision · Financial research output is not financial advice; require human review before any live investment decision.
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
StrongSolid option that is likely worth shortlisting for production workflows.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
Needs reviewA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
416 GitHub stars
Repo activity
416 stars, 116 forks
Maintenance
3d since push
License
Apache-2.0
Install
npx skills add google-ai-edge/litert-samples --skill compiled-model-app-scaffolding
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add google-ai-edge/litert-samples --skill compiled-model-app-scaffoldingDo not use when
Alternative
174.6K Stars
npx skills add anthropics/skills --skill frontend-design
Alternative
84.6K Stars
npx skills add Leonxlnx/taste-skill --skill design-taste-frontend
Alternative
1.8K Stars
npx skills add Alisa0808/vox-director --skill vox-director
Alternative
174.6K Stars
npx skills add anthropics/skills --skill canvas-design
Agent safety v2
Usable candidate, but the agent should surface permission and audit notes before installation.
Require human approval before installing into a real workspace.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Skill may read or write project files, documents, generated artifacts, or local workspace state.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20compiled-model-app-scaffolding%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20compiled-model-app-scaffolding%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/google-ai-edge-compiled-model-app-scaffolding/install
Agent should check
Copy prompt
Task: Use compiled-model-app-scaffolding in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20compiled-model-app-scaffolding%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/google-ai-edge-compiled-model-app-scaffolding/install
Install command: npx skills add google-ai-edge/litert-samples --skill compiled-model-app-scaffolding
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/google-ai-edge-compiled-model-app-scaffolding/install
LLM text format
/api/skills/google-ai-edge-compiled-model-app-scaffolding/install?format=text
Find alternatives
/api/skills/search?q=compiled-model-app-scaffolding&limit=3
Agent prompt
Use compiled-model-app-scaffolding for this task. Review https://www.openagentskill.com/api/skills/google-ai-edge-compiled-model-app-scaffolding/install, then install with: npx skills add google-ai-edge/litert-samples --skill compiled-model-app-scaffoldingRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/google-ai-edge-compiled-model-app-scaffolding
LLM text
/api/registry/manifest/google-ai-edge-compiled-model-app-scaffolding?format=text
Install alias
/api/registry/install/google-ai-edge-compiled-model-app-scaffolding
Recommend
/api/registry/recommend?task=Use%20compiled-model-app-scaffolding%20in%20an%20agent%20workflow&limit=3
Agent fit
Testing and QA
Use-case tags
Platforms
Claude Code
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Shortlist this skill and compare it with close alternatives before production adoption.
Role in stack
Companion skill
Primary fit
Testing and QA
Trust label
Strong shortlist
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
INFO416 GitHub stars
Stars/forks activity
INFO416 stars, 116 forks; issue activity unavailable in current metadata
Recent maintenance
PASS3d since push
License clarity
PASSApache-2.0
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
Solid option that is likely worth shortlisting for production workflows.
Workflow fit
Verify behavior
I need my agent to test a web app, reproduce bugs, and verify fixes.
Operate local tools
I need my agent to operate local files and desktop apps in a repeatable workflow.
Operate web apps
I need my agent to control a browser, fill forms, and verify web app workflows.
Workflow fit
Design, build, test, and ship interfaces
A practical workflow for agents that turn product briefs or Figma designs into polished frontend code, review the result, test it in a browser, and prepare a safe deployment.
Operate and verify web apps
A workflow for agents that navigate products, fill forms, take screenshots, and verify real user flows across web applications.
Turn skills into distribution
A workflow for turning newly indexed skills into SEO briefs, social drafts, comparison pages, and reusable publishing workflows.
Alternative shortlist
Similar skills that may fit this task.
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
Turn one topic into a narrated Vox-style paper-collage explainer or ad video, from script through captions.
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
--- name: compiled-model-app-scaffolding description: 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. ---
# 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. LM models are consumed through the LiteRT-LM Engine rather than raw CompiledModel — `samples/litert/text_to_speech_lm` is the reference for that lane; everything below is the non-LM 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:
``` app/src/main/java/<pkg>/ <Task>Helper.kt inference infra: owns the CompiledModel and its buffers; pre/post-processing; NO Android UI types MainViewModel.kt state machine: drives the helper on a confined dispatcher, exposes UiState UiState.kt one immutable data class MainActivity.kt ComponentActivity + setContent, nothing else view/ Screen.kt, Theme.kt, Color.kt — Compose only app/src/main/res/values/ strings.xml etc. — no UI strings in Kotlin ```
The worked example of the full shape is `samples/litert/image_segmentation/kotlin_cpu_gpu/android`. The layer boundary that matters most is the helper's: pre/post-processing is part of the model contract (it must match what the recipe exported against), so it lives with the model, not in the screen. Reusable inference code is worth more than UI polish — a reader will lift `<Task>Helper.kt` and delete the rest.
## Inference-layer rules
1. **One confined dispatcher owns the model.** `Dispatchers.IO.limitedParallelism(1, "ModelDispatcher")` in the helper; create, run, and close the model only inside `withContext(singleThreadDispatcher)`. Not a bare executor in the Activity, and never the main thread. 2. **Buffers are created once, reused every frame, and closed.** `TensorBuffer` is `AutoCloseable`; forgetting the buffers leaks native memory even when the model itself is closed. The vendored `CompiledModelRunner` (below) gets the whole lifecycle right. 3. **`run()` enqueues; the readback waits.** `run()` may return before the GPU finishes — the output read is the synchronization point. Benchmark run + readback together, never `run()` alone. 4. **Warm up once at init.** The first GPU inference includes shader compilation. Run one inference on dummy input right after create, so the first user action is not the compile, and no first-run number ever gets quoted as latency. 5. **Ask for the strict accelerator the recipe verified.** `Accelerator.GPU` fails compilation on an unsupported op instead of silently falling back — that is a feature. Surface the failure as a visible error and route it back to the model recipe; do not paper over it with a CPU fallback that makes a 10× slowdown look like a working app. 6. **Stateful and multi-graph models: move references, not data.** Feed step N's output buffers as step N+1's inputs (buffer ping-pong) instead of copying state through the host. When one app creates many `CompiledModel`s (pipelines, chunked models), create one `Environment` and pass it to every `CompiledModel.create` call, and close per-run buffers — per-create GPU contexts leak, and a create-per-step loop will eventually take the process down (observed at ~20 creates). Treat the GPU serialization/program-cache options as untested per device — enabling program-cache serialization has aborted a process on first compile, and the compiler-cache environment option targets NPU JIT, not GPU shader caching.
## Vendor the helpers, don't rewrite them
`utilities/common/kotlin/` holds the canonical copies of the code every app needs and every app gets subtly wrong when written from scratch:
| File | What it provides | |---|---| | `CompiledModelRunner.kt` | the lifecycle in rules 1–3, with the sharp edges documented | | `ImageTensor.kt` | Bitmap → float tensor; mean/std, NCHW/NHWC, RGB/BGR, letterbox with coordinate mapping back | | `AudioCapture.kt` | 16 kHz mono `AudioRecord` loop delivering float chunks | | `RealtimeCameraPipeline.kt` | CameraX capture → pooled Bitmap incl. rotation | | `MathOps.kt` | softmax, argmax, IoU, NMS |
Vendor a copy with its provenance line, keep model-specific values in constructor arguments, and fix bugs in the canonical first — `utilities/tools/sync_common.py --check` is the drift gate. The preprocessing arguments **are** the model contract: a wrong mean/std or RGB/BGR looks exactly like a broken model, and it is the first thing to diff against the recipe's export script when app output is subtly wrong.
## Model delivery
Weights are never committed.
- **Bundleable models**: fetch at build with a `download_model.gradle` (Hugging Face URL → `assets/`), and set `androidResources { noCompress += "tflite" }` so the asset stays mmappable. Worked example: `samples/litert/image_segmentation/kotlin_cpu_gpu`. - **Models too big to bundle**: stage into the app's private `filesDir` with an `install_to_device.sh` (`adb push` to `/data/local/tmp`, then `run-as <pkg> cp`), and load with the from-file path. Worked example: `samples/litert/text_to_speech/kotlin_cpu_gpu/android`.
Link the model recipe (`models/<family>/<model>/`) from the app README; conversion and verification scripts belong to the recipe, not the app.
## UI traps that masquerade as model bugs
- **The tiny-output trap.** `Image(contentScale = Fit)` with `fillMaxWidth()` inside a `verticalScroll` renders the bitmap at native pixel size: with no height constraint the row is exactly as tall as the bitmap and Fit never upscales, so a 256-px model output looks broken on a 1080-px screen. Drop the scroll and give each image `weight(1f)` in the Column. - **Audio I/O belongs to the ViewModel.** Mic capture and `AudioTrack` playback run on the confined dispatcher in the ViewModel; the screen only requests permission (`rememberLauncherForActivityResult`) and renders state. For file input use `OpenDocument` with audio MIME types — the photo picker cannot see audio. - **A "slow model" is often the UI thread.** If the app stutters, check that every helper call site goes through the ViewModel's dispatcher before profiling the model — a verified model that benchmarked fine in step 0 did not get slower by being in an app.
## Output layout
``` samples/litert/<task>/kotlin_cpu_gpu/android/ app/src/main/java/... the four layers above app/download_model.gradle or install_to_device.sh at the app root README.md what it demos, which model recipe it consumes, device + accelerator it was verified on ```
State the device the app was verified on, the same way the model recipe does. An app README that names no device inherits none of the recipe's verification.
Source provenance
Decision snapshot
recent repository activity
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for compiled-model-app-scaffolding, ready for a manual X post.
compiled-model-app-scaffolding: Build a new Android app (Kotlin, Compose) around a verified LiteRT model using the CompiledMo... 416 stars https://www.openagentskill.com/skills/google-ai-edge-compiled-model-app-scaffolding?ref=x
Listing + install path for compiled-model-app-scaffolding: https://www.openagentskill.com/skills/google-ai-edge-compiled-model-app-scaffolding?ref=x Install: npx skills add google-ai-edge/litert-samples --skill compiled-model-app-scaffolding
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to google-ai-edge but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/google-ai-edge-compiled-model-app-scaffolding?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/google-ai-edge-compiled-model-app-scaffolding?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/google-ai-edge-compiled-model-app-scaffolding/audit)
[](https://www.openagentskill.com/skills/google-ai-edge-compiled-model-app-scaffolding?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)google-ai-edge
@google-ai-edge
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
Frontend Design
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
174.6K StarsTaste Skill: Anti-Slop Frontend
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
84.6K StarsVox Director
Turn one topic into a narrated Vox-style paper-collage explainer or ad video, from script through captions.
1.8K StarsCanvas Design
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
174.6K StarsPermission surface
filesystem or document access, network or browser access
Agent outcomes
No agent outcome data yet
Docs
Strong README/SKILL.md context
Risk summary
Install readiness
Permission surface
filesystem or document access, network or browser access
Agent outcomes
No agent outcome data yet
Docs
Strong README/SKILL.md context
Risk summary
Install readiness
Permission surface
filesystem or document access, network or browser access
Agent outcomes
No agent outcome data yet
Docs
Strong README/SKILL.md context
Risk summary
Install readiness
Permission surface
filesystem or document access, network or browser access
Agent outcomes
No agent outcome data yet
Docs
Strong README/SKILL.md context
Risk summary
Install readiness