A decision guide from Google's own docs, plus judgment where the docs leave a choice. Every API status was checked on 25 November 2026, and every number is quoted from a Google page. The Kotlin samples were compiled against the current SDKs and were not run on a phone.

Firebase's hybrid inference docs have a section called "Features not yet supported for on-device inference". Function calling is on it, next to multi-turn chat and any request over 4,000 tokens.

That one list tells you more about where a Gemini Nano feature should run than most demos do, so the rest of this guide comes from the Android, ML Kit, Firebase and AI Edge docs. Every cited page was opened on 25 November 2026, and each API's status is reported as the page stated it that day. No figure in this guide is a device measurement. Each number comes from a Google page, linked at the end. Where the docs leave a choice, the call is marked as judgment.

The short answer

Side by side comparison. On device: use Gemini Nano for short, single shot text jobs on private data or offline, such as summarizing, proofreading, rewriting, classifying and pulling fields. Cloud: use a cloud model for tools, long context, real multi turn conversation and reach across every device.

Use Gemini Nano for short, single-shot text jobs that touch private data or have to work offline: summarize a message, proofread it, classify it, pull fields out of it. Use a cloud model when the job needs tools, long context, a real conversation, or reach across every device you support.

For an agent loop, the status list below points to prototyping on-device and shipping in the cloud for now. That is a reading of the current API statuses, not a test result.

Status first

Table of ML Kit, Firebase and LiteRT-LM APIs with versions and status labels as of 25 November 2026, from beta and alpha to preview, experimental and stable. A side note says ML Kit GenAI pages carry no SLA or deprecation policy, and the Agent API needs AICore Developer Preview enrollment, so it is still a prototype path.

Every ML Kit GenAI page cited here carries the same notice: not subject to any SLA or deprecation policy, and changes may break backward compatibility. This is how each API was labeled on 25 November 2026.

  • ML Kit Prompt API (genai-prompt:1.0.0-beta5): beta. The official get-started page still shows 1.0.0-beta4. Summarization, proofreading, rewriting and image description: beta.
  • Structured output: alpha. Thinking mode: beta, and only on Gemini Nano 4 and higher. Prefix caching: experimental.
  • Speech recognition, speech translation and text to speech: alpha.
  • Function calling in the Prompt API: preview. The page says the Google account on the device must be in the AICore Developer Preview program.
  • ML Kit Agent API (genai-agent, version 1.0.0-alpha1) and the Embeddings API: preview, with the same enrollment line.
  • Firebase AI Logic hybrid inference: experimental. The on-device library, firebase-ai-ondevice, is at 16.0.0-beta08.
  • LiteRT-LM: its overview page marks the Kotlin API "Stable" and Swift "Early Preview", though the newest Maven release listed that day was 0.20.0. The MediaPipe LLM Inference API is in maintenance-only mode, and Google points to LiteRT-LM instead. The experimental Google AI Edge SDK for Gemini Nano is deprecated.

The line that matters most for shipping is the enrollment one. As written, the Agent API needs the device's Google account in a developer preview program, so it is still a prototype for ordinary users.

Check 1: Does your user's phone have it?

Flow diagram. Availability depends on RAM, OS version and AICore update status. Generation.checkStatus() returns AVAILABLE, which routes on device, or DOWNLOADABLE, DOWNLOADING or UNAVAILABLE, which route to the cloud. A banner reads "Check status before showing UI".

The ML Kit page lists supported devices in three groups, by Gemini Nano version (2, 3 and 4), and adds that availability depends on RAM, OS version and the AICore update status. Android's overview says on-device models typically need more premium devices. The Prompt API also isn't supported on a device with an unlocked bootloader.

For scale, a July 2026 Android Developers Blog post says Gemini Nano runs on over 140 million devices. The docs don't break that number down by device.

You don't have to guess at runtime. The Prompt API reports AVAILABLE, DOWNLOADABLE, DOWNLOADING or UNAVAILABLE, and the docs say to call it before showing any related UI, so users never see AICore setup errors. The three Kotlin blocks in this post were compiled against the current SDKs, but they weren't run on a phone.

import com.google.mlkit.genai.common.FeatureStatus import com.google.mlkit.genai.prompt.Generation enum class Route { ON_DEVICE, CLOUD } suspend fun routeForThisDevice(): Route { val model = Generation.getClient() return when (model.checkStatus()) { FeatureStatus.AVAILABLE -> Route.ON_DEVICE else -> Route.CLOUD } } 

If the feature has to work for everyone, on-device can't be the only path.

Check 2: Latency

A cloud request makes a network round trip, while on device runs model initialization and then generation locally. Side notes say output length drives speed and inference runs only in the foreground. Measure time to first token and total inference time on the slowest phone you support.

On-device removes the network round trip. The Gemini Nano page adds that inference speed then depends on device hardware.

In the AICore test app, the first inference after selecting a model can take up to a minute while the model initializes in memory, and both the ML Kit and Firebase SDKs offer a warm-up call that loads it early. Output length matters most. The prompt guide says inference speed depends heavily on how much the model writes, and an Android Developers Blog post about a sample app reports a prompt rewrite that took one response from 13 seconds to under 2. That figure comes from one demo app. On-device inference only runs while your app is in the foreground.

The AICore app's Debug info screen shows time to first token, total inference time and token rates on your own hardware. Read it on the slowest phone you support before you call a feature instant. The docs give no cloud latency figure either, so that side of the comparison has to come from your own requests.

Check 3: Privacy and offline use

Three panels. What on device gives you: no stored record, no direct internet access for AICore, prompts stay on the phone. ONLY_ON_DEVICE keeps requests local and throws if unavailable; PREFER_ON_DEVICE can fall back to the cloud. Caveats: your tools can call the network, offline needs a downloaded model, and monitoring shows no on device data.

The Gemini Nano page says AICore doesn't store a record of the input or the output after processing, and that AICore has no direct internet access. Model downloads go through the open-source Private Compute Services companion APK. Prompts stay on the device, and the feature keeps working without a reliable connection.

Two details can quietly break a "never leaves the phone" promise. In Firebase's PREFER_ON_DEVICE mode, a request falls back to the cloud model when the on-device model is unavailable or doesn't support the request. If your privacy promise is absolute, use ONLY_ON_DEVICE and handle the exception. And in the Agent API, tools you write can still call the network, which Google's page says outright.

Offline also assumes the model is already on the phone. The Firebase SDK does not trigger the download for you when the model is missing. One cost of this privacy is that the Firebase console's AI monitoring shows no data for on-device inference, including logs.

Check 4: Cost

A balance scale between an on device Gemini Nano chip and a cloud model with coins. On device has no per request model cost; cloud pricing depends on the model you choose.

Google's pages are consistent here. ML Kit's GenAI page lists "no additional server cost incurred for each API call", and Firebase lists inference at no cost. The Android hybrid page adds that moving routine tasks to the device lowers cloud inference cost.

The cloud side has a free way in. Firebase AI Logic itself is free. Gemini Developer API charges depend on the model, a free tier exists without a billing account, and some models, especially preview ones, can require billing. For the cloud calls you do make, Firebase supports spend caps and App Check to limit abuse and surprise charges.

What on-device doesn't remove is the evaluation work. Google's guide for direct model access recommends an evaluation set, a run per Gemini Nano version, and at least 3 to 5 prompt iterations. Budget that time.

Check 5: Context length and output length

Input and output documents with length brackets. Gemini Nano on device is best for short inputs, single turn jobs and short output. A cloud model handles long context, multi turn conversations and larger outputs.

This is the check with the hardest numbers. The Prompt API's get-started page says input must fit in the context window, under 4,000 tokens or about 3,000 English words, and that use cases needing more than 4K tokens of output should be avoided. Firebase's hybrid page repeats the 4,000 token cap and recommends avoiding on-device use cases that need more than 256 tokens of output.

What happens at the limit depends on the mode. PREFER_ON_DEVICE falls back to the cloud for a request over 4,000 tokens. ONLY_ON_DEVICE throws.

The Agent API pages give no token number. They say on-device models have smaller context windows than server models, and that every tool you register uses up part of that window. For comparison, the Gemini API models page lists a 1M token context for the Gemini 4 models, including Gemini 4 Hydrogen, as of 25 November 2026.

The feature surface also changes with the SDK. ML Kit's direct access accepts up to 10 images in one request. Firebase's on-device path accepts text, or text with a single Bitmap.

Check 6: Model size and quality limits

A phone showing Gemini Nano between two panels. On device: a smaller model, efficient for focused tasks, with quality trade offs. Cloud: larger models with higher quality for complex tasks. Takeaway: use the cloud when quality is critical.

Google's own framing is modest. The overview lists the on-device jobs as short content: summarize, proofread or rewrite a short chat message or email, describe images, handle sensitive data, transcribe a short audio clip. Chatbots, image generation, real-time translation and multi-agent work are listed under cloud.

The task APIs are narrower on purpose. They use fixed fine-tuned adapters, and the docs spell out the limits: image descriptions are generic and short, summaries are 1 to 3 bullet points, rewriting offers predefined styles. Direct model access gives you freedom and costs more effort, and the docs call that effort high because of prompt engineering and quality assurance.

A few more limits are worth knowing. Different Gemini Nano versions can return different output for the same prompt, so you evaluate per version. Firebase says only English and Korean have been validated for on-device inference, while an April 2026 Android Developers Blog post says Gemma 4, the base for Gemini Nano 4, supports over 140 languages. The pages cited here don't reconcile those two, and honestly that gap still needs an explanation from Google. Test any other language on a device before you promise it. Last, in Firebase's on-device path, multi-turn chat is flattened into a single text prompt, so the model doesn't see roles and is less precise than a cloud model. Firebase recommends ONLY_IN_CLOUD for chat.

Check 7: Tool calling and agent loops

A robot at a laptop inside a tool loop. ML Kit: function calling is in preview and needs AICore Developer Preview enrollment. Firebase: the hybrid model does not support on device tools.

This is where the docs say the most, and where you should be most careful. Firebase's hybrid path doesn't support tools on-device at all, and it doesn't fall back to the cloud for them automatically. Its recommendation is ONLY_IN_CLOUD if you want tools.

The ML Kit route does support them. Function calling in the Prompt API needs Gemini Nano 4, which today means the preview model and a device enrolled in the developer preview, except on the Galaxy Z Flip 8 and Fold 8, where the page says Nano 4 is already in production. The SDK doesn't validate or run what the model proposes. The Agent API adds a managed loop with a default of 10 turns, and its failure codes include MAX_TURNS_EXCEEDED, NOT_AVAILABLE and BUSY.

What the docs say about reliability is blunt. Both the function calling and Agent API pages caution that the model may not suggest the correct tool or arguments. Because Gemini Nano generates tool names without strict schema constraints, it can emit near-miss names that match nothing you registered, and Google asks you to keep your KDoc wording consistent with method names and to handle unknown names gracefully. A large set of tools makes the model more error-prone and uses context. For deterministic tool choice the Agent API page suggests temperature = 0.0f and warns against values above 0.4f. Thinking mode, on Nano 4 and higher, is documented as improving function-calling accuracy.

None of these pages publishes a tool-call success rate, so your own evaluation set has to supply it.

For contrast, LiteRT-LM lists function calling with constrained decoding for improved accuracy, but its Kotlin guide says tools only work with models that support them, such as FunctionGemma. Google's Android overview routes a single-agent loop to the ML Kit Agent API on-device, and routes the same job to a custom backend in the cloud. The status list is a reason to hold off on that on-device row for now.

You can write this guard today, whichever SDK you pick. When the model names a tool that doesn't exist, answer with an error that lists the real tools instead of crashing.

typealias Tool = (Map<String, String>) -> String fun runTool( name: String, args: Map<String, String>, tools: Map<String, Tool>, ): Map<String, String> { val tool = tools[name] ?: return mapOf("error" to "Unknown tool '$name'. Available tools: ${tools.keys.joinToString()}") return mapOf("result" to tool(args)) } 

Check 8: Battery, quotas and updates

A phone with a battery icon between three panels: check battery impact and keep tasks light, check usage limits for on device features, and plan for regular model updates.

The docs give no battery figure for an app. What they give is a set of limits that exist partly to protect the battery. AICore enforces an inference quota per app. Too many requests in a short time return BUSY, and PER_APP_BATTERY_USE_QUOTA_EXCEEDED can be returned when an app passes a long-duration quota such as a daily one. Inference in the background, including from a foreground service, returns BACKGROUND_USE_BLOCKED. The Agent API's turn limit is also described as a way to conserve battery.

Google's posts do make relative claims. An April 2026 post on the Gemma 4 preview models says they are up to 4x faster than previous versions and use up to 60% less battery. A November 2026 post says Gemini Nano 4 gives up to a 3x speedup and cuts memory by up to 4x under internal benchmarks. The multipliers differ and neither names a device nor a prompt, so run your own measurements.

Updates are the other half. AICore downloads and updates Gemini Nano, so it doesn't count against your APK, disk or memory budget, and it also means the model under your prompts can change without a release from you. getBaseModelName() tells you which version is on a device. The release stage setting chooses stable or preview, and Firebase's examples put Nano 2 and 3 in the stable category and Nano 4 in preview. A freshly reset phone can also fail with AICore binding or feature-not-found errors until it finishes its first configuration download, which Google says usually takes a few minutes to a few hours. All of it points the same way. Keep a cloud path ready for BUSY, quota errors and UNAVAILABLE.

Wiring the cloud fallback

The four Firebase inference modes around a phone: PREFER_ON_DEVICE, ONLY_ON_DEVICE, PREFER_IN_CLOUD and ONLY_IN_CLOUD. Takeaway: use ONLY_ON_DEVICE for strict privacy and the other modes when fallback is fine.

Firebase AI Logic's hybrid API gives you four modes. They are worth choosing per feature.

  • PREFER_ON_DEVICE: on-device when available and supported, otherwise the cloud model. This fits a feature that can run locally but must reach every device.
  • ONLY_ON_DEVICE: on-device or an exception. This fits a privacy promise.
  • PREFER_IN_CLOUD: cloud when online, on-device only when the phone is offline.
  • ONLY_IN_CLOUD: cloud or an exception. Firebase suggests it for tools and chat.

You must name the cloud model yourself, because the SDK has no default. Each response also carries an inferenceSource of ON_DEVICE or IN_CLOUD, so you can log which path served it.

import com.google.firebase.Firebase import com.google.firebase.ai.GenerativeModel import com.google.firebase.ai.InferenceMode import com.google.firebase.ai.OnDeviceConfig import com.google.firebase.ai.ai import com.google.firebase.ai.type.GenerativeBackend import com.google.firebase.ai.type.PublicPreviewAPI @OptIn(PublicPreviewAPI::class) fun hybridModel(neverLeaveDevice: Boolean): GenerativeModel { val mode = if (neverLeaveDevice) { InferenceMode.ONLY_ON_DEVICE } else { InferenceMode.PREFER_ON_DEVICE } return Firebase.ai(backend = GenerativeBackend.googleAI()) .generativeModel( modelName = "gemini-4-hydrogen", onDeviceConfig = OnDeviceConfig(mode = mode), ) } 

If routing has to react to network latency, battery level, processor load or how hard the query is, Android's hybrid page describes custom routing and names Gboard and Kakao Mobility as apps that built their own.

When you ship the model yourself

LiteRT-LM versus AICore. With LiteRT-LM you bundle and manage the model yourself, with full control over version and updates. With AICore, Google provides and updates the model on demand, keeping your app smaller.

LiteRT-LM is the other on-device route, and it changes the trade. You choose the model and you carry it. Google's overview lists Gemma-4-E2B at 2.58 GB, and its table shows time to first token of 0.3 seconds on a Galaxy S26 Ultra GPU and 1.8 seconds on its CPU, with peak CPU memory of 676 MB on the GPU and 1,733 MB on the CPU. Those are Google's published figures for one phone.

In return, Google's overview lists Android, iOS, web and desktop support, GPU and NPU acceleration, and models from Gemma to Llama, Phi-4 and Qwen. What the Gemini Nano page says AICore handles for you (the download, the updates, the disk and memory cost) becomes yours.

The decision checklist

A numbered checklist of eight checks: every user and device, input and output length, tools or multi turn chat, data never leaves the device, works offline, foreground only, evaluation on each Nano version, and API status risk. If a feature fails an important check, use hybrid or cloud.

Answer these in order. The first no that matters usually settles the route.

  1. Must the feature work for every user on every device you support? If yes, use hybrid or cloud, never on-device alone.
  2. Does the input fit under about 3,000 English words, with output short enough to stay under 256 tokens? If no, use the cloud.
  3. Does it need tools or a real multi-turn chat? If yes, use the cloud unless you accept preview status and a developer preview enrollment.
  4. Do you tell users their data never leaves the device? If yes, use ONLY_ON_DEVICE and decide what the screen does when it's unavailable.
  5. Must it work offline? If yes, check that the model is already downloaded before you promise it.
  6. Can it run only while the app is in the foreground? If no, use the cloud.
  7. Have you run an evaluation set on each Gemini Nano version you target, and read time to first token on your slowest device? If no, don't promise quality or speed yet.
  8. Can you live with the API changing under you, given the status list above? If no, wait, or use the cloud.

A feature that passes all eight can go on-device. Most features won't pass all eight today, and Google's own docs describe hybrid inference for exactly that case. It can run locally, but not every device can run it.

Sources

All pages opened on 25 November 2026. Page dates are the "last updated" lines the pages show, in UTC.