android-ml-ondevice

android-ml-ondevice is a skill for Claude Code, Codex from noloman/Android-AI-skills. It costs 0 tokens per session (407 once invoked), scanned A, original, MIT.

A set of Android guidelines for running machine-learning features directly on the device. It covers tools such as ML Kit, TensorFlow Lite, Gemini Nano, and MediaPipe Tasks.

In plain words
What is it for?
Use it when building Android features for text recognition, barcodes, faces, poses, audio, or other local ML tasks. It also covers managing models, testing on low-end phones, and keeping user data on the device.
Why use it?
It helps developers choose suitable on-device ML tools while avoiding common problems with threading, model sizes, input shapes, permissions, failures, and privacy.

Skill for Claude CodeCodex

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

Good fit Use it when building Android features for text recognition, barcodes, faces, poses, audio, or other local ML tasks. It also covers managing models, testing on low-end phones, and keeping user data on the device.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/noloman/android-ai-skills/android-ml-ondevice
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 noloman/Android-AI-skills --skill android-ml-ondevice
Clone the repo
git clone --depth 1 https://github.com/noloman/Android-AI-skills

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 android-ml-ondevice

README.md
[![agentmods](https://agentmods.dev/badge/skills/noloman/android-ai-skills/android-ml-ondevice/github.svg)](https://agentmods.dev/skills/noloman/android-ai-skills/android-ml-ondevice)
Your own site
<a href="https://agentmods.dev/skills/noloman/android-ai-skills/android-ml-ondevice"><img src="https://agentmods.dev/badge/skills/noloman/android-ai-skills/android-ml-ondevice/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 android-ml-ondevice

Your own site · 80×15
<a href="https://agentmods.dev/skills/noloman/android-ai-skills/android-ml-ondevice"><img src="https://agentmods.dev/badge/skills/noloman/android-ai-skills/android-ml-ondevice.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 407 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00407
Opus 5 $0.00000 $0.00204
Sonnet 5 $0.00000 $0.00081
Haiku 4.5 $0.00000 $0.00041

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

Security

Grade A, and why

android-ml-ondevice 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 10d 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.

android-ml-ondevice/SKILL.md · 40 lines

What it actually says


name: android-ml-ondevice description: On-device ML — ML Kit, TensorFlow Lite, Gemini Nano, model management. user-invocable: true

Android On-Device ML

Cross-cutting skill — always activates alongside the project-type-specific skill.

Hard Rules

  • Prefer ML Kit for common tasks (text recognition, barcode, face, pose) — pre-trained, optimized.
  • Run inference off the main thread — use coroutines with Dispatchers.Default.
  • Use Google Play Services-based ML Kit models to reduce APK size.
  • Bundle TFLite models in assets/ or download dynamically via Play Asset Delivery.
  • Validate model input/output shapes — mismatches cause silent failures or crashes.
  • Handle model loading failures gracefully — provide fallback or skip ML feature.
  • Do not ship unnecessarily large models — quantize (INT8) to reduce size and latency.
  • Respect user privacy — process data on-device, do not upload without consent.
  • Request camera/microphone permissions before ML features that use them.
  • Test ML features on low-end devices — not just flagships.
  • Prefer MediaPipe Tasks API for new vision/text/audio ML features — unified, cross-platform, actively maintained.
  • TensorFlow Lite is now rebranded as LiteRT — update references in new code.

Core Patterns

  • ML Kit auto-downloads models via Google Play Services (no APK size impact).
  • Use InputImage.fromMediaImage() for CameraX integration with ML Kit.
  • TFLite Interpreter with GPU delegate for acceleration on supported devices.
  • Use Gemini Nano (on-device LLM) via AI Core API for generative tasks — supports text and multimodal input.
  • Implement progressive enhancement — ML features enhance but are not required.
  • Cache inference results when input hasn't changed.

References

  • references/ml_kit.md
  • references/tensorflow_lite.md
  • references/gemini_nano.md
  • references/model_management.md
  • references/mediapipe.md
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. 10d ago First seen · 40 lines · 0 tokens per session scan A a047e01004b5

Subscribe to this mod's changes

android-ml-ondevice is a skill published in the GitHub repository noloman/Android-AI-skills (6 stars, last pushed 6mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 407 tokens. 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-31.

Related

Other skills, from other repositories

ml-kit-genai-prompt-api

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

android/skills · 57 tokens

model-authoring

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

apple/coreai-models · 95 tokens

working-with-coreai

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

apple/coreai-models · 91 tokens

axiom-ai

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

CharlesWiltgen/Axiom · 57 tokens

firebase-ai

Use when setting up firebaseai, generating text/chat with Gemini, streaming AI output, building multimodal prompts, or handling AI errors.

evanca/flutter-ai-rules · 30 tokens

frontend-a11y

Accessibility patterns for React and Next.js — semantic HTML, ARIA attributes, form labeling, keyboard navigation, focus management, and screen reader support. Use when building any interactive UI component or form.

ufy2024/AuC · 44 tokens