Setup and context
When building AI-powered mobile apps, the first critical decision is whether to process AI workloads on-device or via cloud API. Android Bench, Google's standardized benchmarking tool, gives you the data you need to make that call confidently.
In 2026, on-device AI models are faster and more capable than ever. This guide walks you through Android Bench's key metrics, compares major open-weight models, and shows you how Antigravity simplifies on-device AI integration.
What Is Android Bench?
Android Bench is Google's standardized benchmarking framework for measuring AI model performance on actual Android devices. Unlike synthetic benchmarks, Android Bench runs real inference workloads on consumer hardware.
- What it measures: Execution speed, memory overhead, and power consumption of on-device LLMs and vision models
- Test devices: Pixel 9 Pro, Galaxy S24, and older devices down to Pixel 6
- Public dashboard: ai.google.dev/edge/litert/benchmarks publishes real-time results
- Frequency: Metrics update monthly as new models and devices are tested
Key Benchmark Metrics
- Tokens per Second (tok/s): How many tokens your model generates in 1 second. Higher = faster response times.
- Time to First Token (TTFT): Milliseconds elapsed from input submission to the first token output (includes model startup if not cached). Lower = snappier UX.
- RAM Usage: Peak memory consumption during inference. Critical constraint on lower-end devices.
- Model Size: Download footprint in MB or GB. Factors into app binary size and storage.
- Battery Consumption: Energy drain per inference session in milliwatt-hours (mWh). Matters for user retention.
- Latency Breakdown: Time spent in loading, preprocessing, inference, and post-processing.
2026 On-Device Model Comparison
All benchmarks taken on Pixel 9 Pro, Android 15, using TensorFlow Lite (LiteRT) with quantization. Numbers reflect real-world inference, not peak theoretical performance.
Gemma 3 2B (Google)
- Tokens/Second: ~45 tok/s
- TTFT: ~150ms
- RAM Required: ~1.8 GB
- Model Size: 1.1 GB (int4 quantized)
- Strengths: Fastest 2B model, solid Japanese support, free to use
- Use Case: Lightweight classification, summarization, sentiment analysis
Gemma 3 7B (Google)
- Tokens/Second: ~18 tok/s
- TTFT: ~350ms
- RAM Required: ~4.2 GB
- Model Size: 3.8 GB (int4 quantized)
- Strengths: Best quality for on-device, handles complex reasoning
- Use Case: Advanced summarization, detailed QA, multi-step reasoning
Llama 3.2 3B (Meta)
- Tokens/Second: ~40 tok/s
- TTFT: ~180ms
- RAM Required: ~2.0 GB
- Model Size: 1.6 GB (int4 quantized)
- Strengths: Excellent English performance, good for code
- Use Case: English-first apps, coding assistance, API integration logic
Phi-3 Mini 3.8B (Microsoft)
- Tokens/Second: ~35 tok/s
- TTFT: ~200ms
- RAM Required: ~2.4 GB
- Model Size: 2.2 GB (int4 quantized)
- Strengths: Optimized for coding and math, lightweight
- Use Case: Developer-focused apps, logic puzzles, math tutoring
Cloud API Comparison (for reference)
- Gemini 3 Flash (API): ~200 tok/s, TTFT ~300ms (including network)
- Claude Haiku 4.5 (API): ~180 tok/s, TTFT ~400ms (including network)
- Grok 2 (API): ~250 tok/s, TTFT ~350ms (including network)
Note: Cloud numbers include network latency (typical 50–200ms), plus inference. On-device numbers are pure inference only.
Implementing On-Device AI with Antigravity
Antigravity's LiteRT integration simplifies on-device model management and inference. Here's a working example:
# Antigravity + LiteRT on-device inference
import antigravity as ag
from antigravity.mobile import LiteRTRunner
from antigravity.mobile import ModelDownloader
import time
# Download Gemma 3 2B if not already cached
downloader = ModelDownloader()
model_path = downloader.ensure_model(
"gemma-3-2b-it-int4",
destination="/data/local/tmp/models"
)
# Initialize the runner with GPU acceleration if available
runner = LiteRTRunner(
model_path=model_path,
device="gpu", # automatically falls back to CPU if unavailable
num_threads=4
)
# Single inference example
start = time.time()
result = runner.generate(
prompt="東京のおすすめ観光スポットを3つ教えてください。",
max_tokens=150,
temperature=0.7
)
elapsed = time.time() - start
print(result.text)
print(f"Inference time: {elapsed:.2f}s")
print(f"Throughput: {result.tokens_per_second:.1f} tok/s")
print(f"RAM used: {result.memory_mb:.0f} MB")
# Expected output:
# 1. 浅草寺 - 江戸情緒を感じられる...
# Inference time: 3.45s
# Throughput: 43.5 tok/s
# RAM used: 1840 MBWhen to Use On-Device AI vs. Cloud API
Choose On-Device When:
- Privacy is paramount: Healthcare, financial data, personal information (no network transmission)
- Offline capability required: Field work, subway, airplane, rural areas
- Ultra-low latency needed: Real-time features (voice input, game AI, live translations)
- You want zero API costs: Cost-sensitive markets, high-volume freemium apps
- Compliance mandates local processing: GDPR, HIPAA, data residency requirements
Choose Cloud API When:
- Quality matters more than speed: Complex reasoning, long-form content, specialized tasks
- You need current information: News summaries, market data, real-time facts
- Language diversity is essential: 50+ languages, code-mixing, dialect support
- User base justifies API spend: Premium products, B2B, enterprise features
- Task complexity is high: Multi-step workflows, complex analysis, creative generation
Hybrid Architecture (Best of Both)
The optimal pattern: use on-device for fast, privacy-sensitive filtering and routing; offload complex reasoning to cloud.
Example workflow:
- On-device: Classify user intent (100ms, Gemma 3 2B)
- If simple task: generate response on-device
- If complex task: send to cloud API with context from step 1
This reduces cloud API calls by 60–80% while maintaining quality for hard problems.
iOS Comparison: Core ML vs. LiteRT
iOS developers use Core ML; Android uses LiteRT. Antigravity abstracts both under a unified API.
- Core ML (iOS): Optimized for Apple hardware (Neural Engine), model quantization baked in
- LiteRT (Android): Google's TensorFlow Lite runtime, supports quantization + acceleration delegates (NNAPI, GPU)
- Model compatibility: Many models work on both (Gemma, Llama, Phi) with simple conversion
For detailed iOS integration, see Antigravity Core ML On-Device AI Guide.
Summary
Android Bench data empowers you to choose the right AI architecture for your app. For 2026, on-device models are production-ready, fast enough for most UX requirements, and offer privacy, offline capability, and cost advantages.
Start with Gemma 3 2B for most cases. If you need higher quality, step up to Llama 3.2 3B or Gemma 3 7B. Combine with cloud APIs for complex tasks, and you'll have a robust, cost-effective AI stack.
Also explore Antigravity AgentKit 2.0 Guide to see how on-device models power autonomous agents within your app.