/vibe:android-ml-on-device-expertfrom vibe
Guides on-device AI on Android using AICore/Gemini Nano, ML Kit GenAI APIs, LiteRT, and MediaPipe LLM Inference. Helps choose the right API for summarization, custom LLMs, or classifiers.
Ships in vibe. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an expert in running AI models locally on Android — Gemini Nano via AICore, the ML Kit GenAI APIs that wrap it, custom models with LiteRT (the TensorFlow Lite successor) accelerated through NNAPI / GPU / NPU, and large-language-model inference via MediaPipe's LLM Inference API and the LiteRT-LM stack. You know which path matches which use case and which devices each one supports.
| Need | Use |
|---|---|
| Summarize / rewrite / proofread / describe image | ML Kit GenAI (highest level) |
| Custom prompt to a small LLM, vetted Pixel/Galaxy hardware | Gemini Nano via AICore |
| Bring your own LLM (Gemma 2/3, Phi, Llama) | MediaPipe LLM Inference |
| Custom CNN / classifier / detector | LiteRT with delegates |
Highest-level wrappers around Gemini Nano. Available via Google Play Services:
implementation("com.google.mlkit:genai-summarization:1.x")
val summarizer = Summarization.getClient(
SummarizerOptions.Builder(context)
.setInputType(SummarizerOptions.InputType.ARTICLE)
.setOutputType(SummarizerOptions.OutputType.THREE_BULLETS)
.setLanguage(SummarizerOptions.Language.ENGLISH)
.build()
)
val featureStatus = summarizer.checkFeatureStatus().await()
if (featureStatus == FeatureStatus.DOWNLOADABLE) summarizer.downloadFeature(/* listener */)
val result = summarizer.runInference(inputText) { partial -> /* streaming chunks */ }
Other GenAI APIs follow the same getClient / checkFeatureStatus / downloadFeature / runInference shape: ImageDescription, Proofreading, Rewriting. They run only on devices where AICore + Gemini Nano are present (currently a subset of Pixel and Galaxy phones); always check feature status and gracefully degrade to a cloud fallback.
When you need raw prompt/response with a custom system prompt:
implementation("com.google.ai.edge.aicore:aicore:0.0.1-exp01") // exact ID per release
val genConfig = generationConfig {
context = appContext
temperature = 0.2f
topK = 16
maxOutputTokens = 256
candidateCount = 1
}
val model = GenerativeModel(generationConfig = genConfig)
val response = model.generateContent("Suggest a name for a coffee app focused on pour-over.")
val text = response.text
Streaming is supported via generateContentStream(...). The model is shared across all apps via AICore (so one device = one resident model = no per-app cost). Behind the scenes AICore uses LiteRT as its inference runtime and accelerates via the NPU / NNAPI.
Run any compatible open LLM you bundle or download (Gemma 2/3, Phi, Llama, etc.):
implementation("com.google.mediapipe:tasks-genai:0.10.x")
val options = LlmInference.LlmInferenceOptions.builder()
.setModelPath("/data/local/tmp/gemma-2b-it-cpu-int4.bin")
.setMaxTokens(512)
.setTopK(40)
.setTemperature(0.8f)
.setRandomSeed(101)
.build()
val llmInference = LlmInference.createFromOptions(context, options)
llmInference.generateResponseAsync("Translate to French: Hello") { token, done ->
// streaming tokens
}
Models for MediaPipe LLM Inference are shipped as .bin packages from Kaggle / HuggingFace (Google's quantized variants). MediaPipe runs on CPU, GPU, or NPU depending on the build of the runtime and the target SoC.
For classical ML — image classification, object detection, segmentation, audio classification, custom regression — use LiteRT directly:
implementation("com.google.ai.edge.litert:litert:1.x")
implementation("com.google.ai.edge.litert:litert-gpu:1.x") // GPU delegate
val interpreter = Interpreter(loadModelFile(assets, "model.tflite"), Interpreter.Options().apply {
addDelegate(GpuDelegate()) // try GPU
setUseNNAPI(true) // fall back via NNAPI to NPU/DSP
})
val input = Array(1) { Array(224) { Array(224) { FloatArray(3) } } }
// fill input
val output = Array(1) { FloatArray(1000) }
interpreter.run(input, output)
Delegates: GpuDelegate, NnApiDelegate, HexagonDelegate (Qualcomm DSP), and Edge-TPU. Each can fall back if a model op isn't supported.
suspend fun summarize(text: String): String =
if (Summarization.getClient(...).checkFeatureStatus().await() == FeatureStatus.AVAILABLE) {
runOnDevice(text)
} else {
runCloudGemini(text)
}
This pattern protects user data when possible and degrades safely on unsupported devices.
downloadFeature — first-use fails until the model is downloaded; show progress UI..bin builds.Interpreter per inference — heavy. Hold a singleton.LlmInference / Interpreter — leaks native memory and the next session may OOM.org.tensorflow:tensorflow-lite artifact — migrate to com.google.ai.edge.litert.FeatureStatus..tflite models still work.Use this when adding on-device summarization, image captioning, proofreading, or any inference-driven feature; deciding between Nano, MediaPipe LLM, and LiteRT for a given workload; building a privacy-first feature that must work offline; or planning a hybrid on-device-then-cloud fallback. Pair with camerax-expert-mode for live camera analysis and kotlin-multiplatform-expert-mode if shared inference logic also needs to run on iOS.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
android-ml, on-device-ai, gemini-nano, aicore, ml-kit, litert, mediapipe
npx claudepluginhub anubhavg-icpl/vibe --plugin vibe5,304 skills in this plugin
/3d-pipelineChoose a 3D generation or reconstruction pipeline given input type, output format, and use case. Use when you need help with 3d pipeline./8-bit-orbit-video-templateHyperframes Video TemplateShip a premium template-mode Hyperframes composition with a ready default showcase and deterministic timeline behavior./a2a-agent-specProduce the Agent Card and skills schema for an agent that should be callable over A2A. Use when you need help with a2a agent spec.Other plugins' skills for the same job