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.
npx skills add ArisGuimera/MobiAI-Core --skill ml-kit-genai-prompt-apigit clone --depth 1 https://github.com/ArisGuimera/MobiAI-CoreWrote 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.
[](https://agentmods.dev/skills/arisguimera/mobiai-core/ml-kit-genai-prompt-api)<a href="https://agentmods.dev/skills/arisguimera/mobiai-core/ml-kit-genai-prompt-api"><img src="https://agentmods.dev/badge/skills/arisguimera/mobiai-core/ml-kit-genai-prompt-api/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.
<a href="https://agentmods.dev/skills/arisguimera/mobiai-core/ml-kit-genai-prompt-api"><img src="https://agentmods.dev/badge/skills/arisguimera/mobiai-core/ml-kit-genai-prompt-api.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00057 | $0.00972 |
| Opus 5.5 | $0.00023 | $0.00389 |
| Sonnet 5.5 | $0.00011 | $0.00194 |
| Haiku 4.5 | $0.00006 | $0.00097 |
Grade A, and why
ml-kit-genai-prompt-api 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 yesterday.
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.
This is a copy
100% identical to ml-kit-genai-prompt-api — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 122 lines — stays where its author put it; the contents beside it link to each section on GitHub.
This skill provides step-by-step guidance for integrating and optimizing the ML Kit GenAI Prompt API in Android apps.
Prerequisites
- Android API level must be 26 or higher. If
minSdkis below 26, update it to 26. - Add the ML Kit GenAI Prompt API dependency (
com.google.mlkit:genai-prompt) to the app-levelbuild.gradlefile, with version at least1.0.0-beta4. - If
com.google.mlkit:genai-schema-compilerdependency is used and KSP plugin version is below 2.3.6, update it to 2.3.6.
Detailed steps
1. Prompt optimization
To optimize prompts for use with the ML Kit Prompt API, follow the prompt optimization guide.
2. Prefix caching optimization
If the prompt is more than 200 words, implement the prefix caching API.
3. Lifecycle and best practices
-
The model must be fully downloaded and available before calling the first inference. Follow the guide on implementing a generative model to check that the
FeatureStatusof a model isAVAILABLEbefore making an inference. -
Release ML Kit instances by calling
close()when anActivity,Fragment, orViewModelis destroyed. Example:// Instantiating model in activity, fragment, or ViewModel val generativeModel = Generation.getClient() // When activity, fragment, or ViewModel is destroyed generativeModel.close()
4. Structured output
When implementing or refactoring a prompt to use structured output, follow these rules:
- Check for API availability: Verify Structured Output feature is available on the device with
isStructuredOutputFeatureAvailable()before using it. Refer to the Structured Output API guide for full instructions. - Return type: Return the
@Generabletyped object from the function signature instead of aStringor JSON string.
What ships with it
6 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.
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.
- yesterday First seen · 122 lines · 57 tokens per session scan A a8ff20f65d0b
ml-kit-genai-prompt-api is a skill published in the GitHub repository ArisGuimera/MobiAI-Core (489 stars, last pushed yesterday), licensed MIT. It adds 57 tokens to every session and 972 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to ml-kit-genai-prompt-api, differing in 0 lines, and is treated as a copy.
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.".
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.
firebase-ai
Use when setting up firebaseai, generating text/chat with Gemini, streaming AI output, building multimodal prompts, or handling AI errors.
foundation-models-on-device
Apple FoundationModels framework for on-device LLM — text generation, guided generation with @Generable, tool calling, and snapshot streaming in iOS 26+.
firebase-ai-logic
Use for Firebase AI Logic and Gemini integration in Android, safe prompts, privacy boundaries, model selection, fallback behavior and not exposing private keys.
foundation-models-on-device
Apple FoundationModels framework for on-device LLM — text generation, guided generation with @Generable, tool calling, and snapshot streaming in iOS 26+. Use when adding on-device LLM features with Apple FoundationModels on iOS 26+.