Jesse A. Green / notebook

Google AI Edge Gallery — User Guide

Generated May 2026 from google-ai-edge/gallery at 2ccb603

AI-generated documentation. The library is checked by sampling (three repositories so far); this guide was not individually reviewed. Verify against the project before relying on it.

1. Quick Start

Google AI Edge Gallery is an Android application from Google that runs open-source Large Language Models directly on your phone or tablet. Every computation happens on-device — your prompts, photos, and audio never leave the hardware. The app supports conversational chat, image understanding, audio analysis, agent-powered skills, prompt experimentation, and specialized mini-apps like Mobile Actions and Tiny Garden.

What you can do:

  • Run Gemma 4, Gemma 3n, Qwen 2.5, DeepSeek R1, and other open models locally
  • Chat with multi-turn context and optional Thinking Mode for step-by-step reasoning
  • Analyze photos using multimodal models (Gemma 4 and Gemma 3n families)
  • Transcribe and analyze audio recordings on-device
  • Extend the LLM with Agent Skills — JavaScript tools that run in a sandboxed WebView
  • Test prompts with fine-grained parameter control in Prompt Lab
  • Automate device actions with natural language via Mobile Actions
  • Compare model performance with built-in benchmarking

Prerequisites:

  • Android 12 (API 31) or higher
  • Minimum 6 GB device RAM (8 GB recommended; 12 GB for the largest models)
  • Internet connection for the initial model download only
  • Sufficient storage for models (289 MB to 4.9 GB depending on model)

Install and run in five minutes:

  1. Install from Google Play or download the APK from the latest GitHub release
  2. Open Edge Gallery and accept the Terms of Service
  3. Browse the task tiles on the home screen (Chat, Ask Image, Agent Skills, Prompt Lab, etc.)
  4. Tap a task, choose a model, and tap the download button
  5. Once download completes, start interacting — all inference runs locally

Tip

If your device has 8 GB RAM or more, start with Gemma-4-E2B-it — it handles text, images, audio, and thinking mode in a single 2.6 GB download. For devices with only 6 GB RAM, Gemma3-1B-IT at 584 MB is the lightest option.


2. Installation

System Requirements

Requirement Minimum Recommended
OS Android 12 (API 31) Android 14+
RAM 6 GB 8–12 GB
Free Storage 500 MB (app + smallest model) 5–10 GB (multiple models)
Internet Required for model download only Wi-Fi recommended for large models
GPU Not required (CPU fallback) Adreno/Mali GPU for faster inference

Note

The app targets Android SDK 35 (Android 15) and compiles against SDK 35. Devices running Android 12 through the latest Android release are supported. iOS builds exist in the source tree with a model allowlist, but this guide covers the Android experience.

Installation Methods

Google Play (recommended):

Search for "AI Edge Gallery" on Google Play, or visit:

https://play.google.com/store/apps/details?id=com.google.ai.edge.gallery

Direct APK (sideload):

  1. Visit https://github.com/google-ai-edge/gallery/releases/latest/
  2. Download the .apk file
  3. On your device, enable "Install from unknown sources" for your file manager or browser (Settings > Apps > Special app access > Install unknown apps)
  4. Open the downloaded APK and follow the prompts

Important

The GitHub APK is signed with a different key than the Play Store version. You cannot install both simultaneously. If you have the Play Store version, uninstall it first before sideloading, or vice versa. Switching between them will require re-downloading all models.

Build from source:

For development builds, see the Admin Guide for build instructions including Hugging Face OAuth configuration and signing setup.

Post-Install Verification

After installation, confirm:

  1. The home screen shows task tiles (Chat, Ask Image, Prompt Lab, Agent Skills, etc.)
  2. Tapping any task displays available models with download sizes
  3. The navigation drawer opens from the left edge and shows Theme, Terms of Service, and License options

Installation Troubleshooting

Problem Solution
App won't install Verify Android 12+ (Settings > About Phone > Android Version). Ensure 200+ MB free storage. For APK installs, enable "Install unknown sources."
"App not compatible" on Play Store Your device does not meet the minimum API level (31). Android 11 and below are not supported — see issue #652.
Crashes on first launch Clear app data (Settings > Apps > Edge Gallery > Clear Storage), restart the device, and relaunch. See issue #668.
Black screen after splash Ensure the device is not in extreme power-saving mode. Close memory-heavy background apps and retry.

3. Configuration

Model Inference Parameters

Every model exposes tunable parameters that control how it generates text. Access them by tapping the configuration icon in the top app bar during any task session.

Parameter Type Range What It Does
topK Integer 1–100+ Limits token selection to the K most probable candidates at each step. Lower values produce more focused output.
topP Float 0.0–1.0 Nucleus sampling threshold. The model considers the smallest set of tokens whose cumulative probability exceeds this value.
temperature Float 0.0–2.0 Controls randomness. 0.0 = deterministic (always picks the most likely token). 1.0+ = more creative and varied.
maxTokens Integer 128–8192 Maximum number of tokens the model will generate in a single response.
accelerators Selection cpu, gpu, cpu,gpu Hardware to use for inference. "cpu,gpu" tries GPU first with CPU fallback.

Gemma 4 models expose two additional parameters:

Parameter Type Default What It Does
maxContextLength Integer 32000 Maximum input context window in tokens. Gemma 4 supports up to 32K context.
visionAccelerator Selection gpu Dedicated accelerator for vision (image/audio) preprocessing.

Default Configurations by Model

Each model ships with defaults optimized for its architecture:

Model topK topP Temp Max Tokens Accelerators
Gemma-4-E2B-it 64 0.95 1.0 4096 cpu,gpu
Gemma-4-E4B-it 64 0.95 1.0 4096 cpu,gpu
Gemma-3n-E2B-it 64 0.95 1.0 4096 cpu,gpu
Gemma-3n-E4B-it 64 0.95 1.0 4096 cpu,gpu
Gemma3-1B-IT 64 0.95 1.0 1024 gpu,cpu
Qwen2.5-1.5B-Instruct 20 0.8 0.7 4096 gpu,cpu
DeepSeek-R1-Distill-Qwen-1.5B 64 0.95 1.0 4096 gpu,cpu

Tip

For factual Q&A and code generation, set temperature: 0.0–0.3 and topK: 20. For creative writing, brainstorming, or roleplay, use temperature: 0.8–1.2 and topK: 64. The Qwen model ships with lower defaults (0.7 temperature, 20 topK) that favor precision out of the box.

Configuration Presets by Use Case

Use Case Temperature topK topP Max Tokens
Factual answers 0.0 10 0.8 1024
Code generation 0.2 20 0.9 4096
Creative writing 1.0 64 0.95 4096
Summarization 0.3 20 0.85 2048
Translation 0.1 10 0.8 2048
Brainstorming 1.2 64 0.95 4096

App-Level Settings

Access from the navigation drawer (swipe from the left edge of the home screen):

  • Theme — Light, Dark, or System default
  • Terms of Service — Review the accepted terms
  • Open Source Licenses — Third-party license attributions

Note

Model parameter changes are saved automatically using Protocol Buffers-backed DataStore. Your settings persist across app restarts and are stored per-model, so different models can have different configurations simultaneously.


4. Core Usage

4.1 AI Chat

Multi-turn conversational chat is the primary feature. The model maintains context across messages within a session.

Starting a conversation:

  1. Tap Chat on the home screen
  2. Select a model (download it first if you haven't already)
  3. Type your message in the text field and tap send
  4. The model generates a response on-device — watch the tokens-per-second counter

Chat capabilities:

  • Multi-turn context — The model remembers previous messages in the current session
  • Markdown rendering — Responses display with formatted headings, code blocks, lists, tables, and links
  • Latency metrics — Each response shows generation time and token throughput
  • Text input history — Access previously sent prompts via the history sheet (tap the history icon)
  • Voice input — Hold the microphone button to dictate prompts using your device's built-in speech recognition
  • Copy and share — Long-press any message to copy text or share via other apps

Thinking Mode (Gemma 4 only):

Gemma 4 models (E2B and E4B) support a Thinking Mode that reveals the model's step-by-step reasoning before it delivers a final answer. This is particularly useful for math, logic puzzles, and complex analysis.

  1. In a chat session with a Gemma 4 model, locate the Thinking Mode toggle
  2. Enable it before sending your message
  3. The response will include a collapsible "thinking" section showing the reasoning chain, followed by the final answer

Note

Thinking Mode is available in Chat, Ask Image, and Ask Audio tasks when using a model with llmSupportThinking: true. Currently, only Gemma-4-E2B-it and Gemma-4-E4B-it support this feature. Thinking Mode increases response time since the model generates additional reasoning tokens.

4.2 Ask Image

Multimodal models can analyze photographs and answer questions about visual content.

Using Ask Image:

  1. Tap Ask Image on the home screen
  2. Select a multimodal model — only models with image support appear in this task:
    • Gemma-4-E2B-it (8 GB RAM required)
    • Gemma-4-E4B-it (12 GB RAM required)
    • Gemma-3n-E2B-it (8 GB RAM required)
    • Gemma-3n-E4B-it (12 GB RAM required)
  3. Capture a photo with your camera or select one from your gallery
  4. Type a question about the image and send

What you can ask about images:

  • "What objects are in this photo?"
  • "Read the text in this image" (OCR-style extraction)
  • "Describe this scene in detail"
  • "What breed is this dog?"
  • "Is there anything unusual in this picture?"
  • "Summarize this document" (for photographed pages)
  • "What ingredients do you see?" (for food photos)

Important

Only models that explicitly support image input appear in the Ask Image task. Text-only models like Gemma3-1B-IT, Qwen2.5-1.5B-Instruct, and DeepSeek-R1-Distill-Qwen-1.5B do not support image analysis. If you don't see any models available in Ask Image, you need to download one of the Gemma 4 or Gemma 3n models.

The app automatically handles image preprocessing: EXIF rotation correction, downsampling for memory efficiency, and format conversion. You do not need to resize or crop images manually.

4.3 Ask Audio

Audio understanding lets you feed recorded audio to the model for transcription, analysis, and question-answering.

Using Ask Audio:

  1. Tap Ask Audio on the home screen
  2. Select a model with audio support:
    • Gemma-4-E2B-it or Gemma-4-E4B-it
    • Gemma-3n-E2B-it or Gemma-3n-E4B-it
  3. Record audio using the built-in recorder, or select a WAV file from your device
  4. Ask a question about the audio content

Audio format details:

  • Input is converted to mono, 16-bit PCM at 16 kHz sample rate
  • Maximum duration: 30 seconds per clip
  • Supported input: WAV files (8-bit and 16-bit, mono and stereo)

Practical uses:

  • Transcribe voice memos
  • Summarize recorded meetings (30-second segments)
  • Identify spoken languages
  • Analyze tone and content of audio clips

4.4 Agent Skills

Agent Skills turn the LLM into a tool-using assistant. When you describe a task, the model reviews installed skills and automatically invokes the right one.

How skills work:

Each skill is defined by a SKILL.md file that describes its purpose and how the model should invoke it. Skills can be text-only (pure LLM persona) or JavaScript-based (running code in a sandboxed WebView). The model reads the skill descriptions and decides which one to call based on your prompt.

Built-in skills (bundled with the app):

Skill What It Does Example Prompt
Calculate Hash Computes SHA-1 hash of text "Calculate the hash of hello world"
Interactive Map Shows a location on an interactive map "Show me a map of Tokyo"
Kitchen Adventure Text adventure game in a kitchen world "Start the kitchen adventure"
Mood Tracker Tracks and visualizes daily mood "I'm feeling great today"
QR Code Generates QR codes from text/URLs "Make a QR code for https://example.com"
Query Wikipedia Searches and summarizes Wikipedia articles "Look up quantum computing on Wikipedia"
Send Email Composes an email via device email app "Send an email to [email removed] about lunch"
Text Spinner Animated spinning text effects "Spin the text Hello World"

Featured skills (installable from in-app catalog):

Skill What It Does Requires
Mood Music Generates music based on mood description Loudly API key
Restaurant Roulette Finds restaurants with a spin-wheel picker Gemini API key
Virtual Piano Interactive piano keyboard Nothing

Using Agent Skills:

  1. Tap Agent Skills on the home screen
  2. Select and download a model (Gemma 4 models with agent chat support are recommended)
  3. Simply describe what you want in natural language
  4. The model identifies the matching skill and invokes it automatically
  5. Skill output appears inline in the chat — maps, QR codes, and other visual results render directly

Managing installed skills:

  1. Tap the Skills chip in the Agent Skills interface
  2. The Skill Manager displays all installed skills with descriptions
  3. Tap the (+) button to add new skills via three methods:
    • Featured list — Browse and install community-curated skills
    • From URL — Enter a URL pointing to a hosted skill folder
    • Local import — Select a skill folder from device storage

Warning

When loading skills from a URL, the host must serve files with proper MIME types. Standard GitHub repository URLs and raw.githubusercontent.com serve files as text/plain, which prevents JavaScript execution. Use GitHub Pages, Cloudflare Pages, or another static hosting service instead. See issue #619 for details.

Skills that require API keys:

Some featured skills need external API keys. When you invoke a skill marked with require-secret: true, the app displays a native dialog for you to enter the key securely. The key is passed directly to the JavaScript runtime and is never sent through the LLM or transmitted off-device.

4.5 Prompt Lab

A single-turn prompt testing workspace for experimenting with model behavior.

Using Prompt Lab:

  1. Tap Prompt Lab on the home screen
  2. Select a model
  3. Write your prompt in the input field
  4. Adjust inference parameters (temperature, topK, topP, maxTokens) using the configuration panel
  5. Send the prompt and review the response
  6. Iterate: tweak parameters and re-send to compare outputs

When to use Prompt Lab vs Chat:

  • Use Prompt Lab for isolated prompt testing, parameter tuning, and comparing how different settings affect output quality
  • Use Chat for conversational interactions where multi-turn context matters

Prompt Lab treats each submission as an independent, stateless request — there is no conversation history between prompts.

4.6 Mobile Actions

Offline device automation powered by MobileActions-270M, a fine-tuned function-calling model.

  1. Tap Mobile Actions on the home screen
  2. Download the MobileActions-270M model (~289 MB)
  3. Describe what you want the device to do in natural language
  4. The model translates your request into a structured function call that triggers a native Android intent

Currently supported actions:

  • Sending emails (via the device's default email client)
  • Sending text messages (via native SMS intent)

Note

Mobile Actions uses a specialized 270M-parameter model fine-tuned for function calling. It is a separate model from the general-purpose chat models. Additional action types would require extending the function definitions in the source code — see the Admin Guide for details.

4.7 Tiny Garden

An experimental text-based gardening game controlled entirely through natural language.

  1. Tap Tiny Garden on the home screen
  2. Download the TinyGarden-270M model (~289 MB)
  3. Use natural language commands to plant, water, and harvest in your virtual garden
  4. The game state evolves based on the model's function-calling interpretation of your commands

Tiny Garden demonstrates on-device function calling in a playful context. The TinyGarden-270M model is a specialized 270M-parameter model fine-tuned specifically for this game's function vocabulary.

4.8 Model Management

Downloading models:

  1. Select any task tile from the home screen
  2. Browse models that support that task — each listing shows the model name, download size, and minimum RAM
  3. Tap the download button
  4. The download runs as an Android foreground service, so you can use other apps while it completes
  5. A notification shows download progress

Available models (allowlist version 1_0_11):

Model Download Size Min RAM Supports
Gemma-4-E2B-it ~2.6 GB 8 GB Chat, Prompt Lab, Agent Chat, Ask Image, Ask Audio, Thinking
Gemma-4-E4B-it ~3.7 GB 12 GB Chat, Prompt Lab, Agent Chat, Ask Image, Ask Audio, Thinking
Gemma-3n-E2B-it ~3.7 GB 8 GB Chat, Prompt Lab, Ask Image, Ask Audio
Gemma-3n-E4B-it ~4.9 GB 12 GB Chat, Prompt Lab, Ask Image, Ask Audio
Gemma3-1B-IT ~584 MB 6 GB Chat, Prompt Lab
Qwen2.5-1.5B-Instruct ~1.6 GB 6 GB Chat, Prompt Lab
DeepSeek-R1-Distill-Qwen-1.5B ~1.8 GB 6 GB Chat, Prompt Lab
TinyGarden-270M ~289 MB 6 GB Tiny Garden
MobileActions-270M ~289 MB 6 GB Mobile Actions

Models are downloaded from Hugging Face repositories. The Play Store version handles authentication automatically. Development builds require Hugging Face OAuth configuration (see Admin Guide).

Choosing the right model:

  • Best all-rounder: Gemma-4-E2B-it — handles text, images, audio, thinking, and agent skills in a 2.6 GB package requiring only 8 GB RAM
  • Most capable: Gemma-4-E4B-it — larger and more capable than E2B, but needs 12 GB RAM
  • Lightest option: Gemma3-1B-IT at 584 MB — text-only but fast and works on 6 GB devices
  • Best for reasoning: DeepSeek-R1-Distill-Qwen-1.5B — distilled from DeepSeek R1, strong at math and logic
  • Best for precision: Qwen2.5-1.5B-Instruct — ships with lower temperature defaults, favoring deterministic output

Deleting models:

Models can be deleted from the model selection screen to reclaim storage space. Downloaded model files are stored in the app's private storage directory.

Benchmarking models:

  1. Tap Benchmark on the home screen
  2. Select one or more downloaded models
  3. Run the benchmark to measure:
    • Tokens per second (generation speed)
    • Time to first token (startup latency)
    • Memory usage
    • CPU vs GPU performance comparison

Tip

For accurate benchmarks, close all background apps, ensure the device is not charging (thermal throttling can occur during charging), and run each benchmark 2–3 times to account for variance.


5. Common Tasks

Recipe 1: Analyze a Document Photo

Goal: Extract and summarize text from a photographed document.

  1. Open Ask Image and select Gemma-4-E2B-it (or any multimodal model)
  2. Take a clear, well-lit photo of the document — hold the phone parallel to the page
  3. Send the prompt: "Read all the text in this image and summarize the key points"
  4. The model extracts visible text and provides a summary

Tips for best results:

  • Ensure good lighting with minimal glare
  • Capture the full page in one shot rather than cropping
  • For multi-page documents, process one page at a time

Recipe 2: Create a Text-Only Persona Skill

Goal: Give the LLM a specialized persona without any JavaScript.

  1. Create a folder named writing-coach/ on your computer
  2. Create writing-coach/SKILL.md with this content:
---
name: writing-coach
description: A writing coach who helps improve prose clarity and style.
---

# Writing Coach

## Persona
You are a professional writing coach. When the user shares text, analyze it
for clarity, conciseness, and flow. Provide specific, actionable suggestions.
Always explain WHY a change improves the writing.
  1. Push to your device:
adb push writing-coach/ /sdcard/Download/
  1. In the app: Agent Skills > Skills chip > (+) > Import local skill > select writing-coach
  2. Test: "Review this paragraph: The meeting was held in order to discuss the items that were on the agenda."

Recipe 3: Create a JavaScript Skill with Visual Output

Goal: Build a skill that generates a color palette and displays it visually.

  1. Create the folder structure:
color-palette/
  SKILL.md
  scripts/
    index.html
  1. Write color-palette/SKILL.md:
---
name: color-palette
description: Generate a color palette from a description.
---

# Color Palette Generator

## Instructions
Call the `run_js` tool with:
- script name: index.html
- data: A JSON string with field "description" (the palette description)
  1. Write color-palette/scripts/index.html:
<!DOCTYPE html>
<html><head><style>
  .swatch { width: 80px; height: 80px; display: inline-block; margin: 4px; border-radius: 8px; }
  .label { text-align: center; font-size: 12px; font-family: monospace; }
</style></head>
<body>
<div id="palette"></div>
<script>
window['ai_edge_gallery_get_result'] = async (data) => {
  try {
    const parsed = JSON.parse(data);
    const desc = (parsed.description || '').toLowerCase();
    // Generate palette based on description keywords
    let colors = ['#264653','#2a9d8f','#e9c46a','#f4a261','#e76f51'];
    if (desc.includes('warm')) colors = ['#d62828','#f77f00','#fcbf49','#eae2b7','#fca311'];
    if (desc.includes('cool')) colors = ['#03045e','#0077b6','#00b4d8','#90e0ef','#caf0f8'];
    if (desc.includes('earth')) colors = ['#606c38','#283618','#dda15e','#bc6c25','#fefae0'];
    return JSON.stringify({ webview: 'index.html', result: 'Palette generated' });
  } catch (e) {
    return JSON.stringify({ error: e.message });
  }
};
</script>
</body>
</html>
  1. Install via ADB push and local import
  2. Test: "Generate a warm color palette"

Recipe 4: Host a Skill on GitHub Pages

Goal: Share a skill publicly so anyone can install it from a URL.

  1. Create a GitHub repository (e.g., my-gallery-skills)
  2. Add your skill folder (e.g., my-gallery-skills/writing-coach/SKILL.md)
  3. Create an empty .nojekyll file in the repository root — this prevents GitHub's Jekyll engine from converting your .md files into HTML
  4. Enable GitHub Pages: Repository Settings > Pages > Source: Deploy from a branch > Branch: main, folder: / (root)
  5. Wait for the deployment to complete (usually 1–2 minutes)
  6. Your skill URL is: https://your-username.github.io/my-gallery-skills/writing-coach/

Verify: Open https://your-username.github.io/my-gallery-skills/writing-coach/SKILL.md in a browser. If the raw markdown content displays, the URL is correct.

Installing from the URL: In the app, go to Agent Skills > Skills chip > (+) > Load from URL > paste the skill folder URL.

Recipe 5: Compare Models for a Specific Task

Goal: Find which model performs best for your use case on your device.

  1. Download at least two models (e.g., Gemma-4-E2B-it and Gemma3-1B-IT)
  2. Open Benchmark from the home screen
  3. Select both models and run the benchmark
  4. Note the tokens-per-second and time-to-first-token metrics
  5. Then test qualitatively: open Prompt Lab, send the same prompt to each model, and compare response quality

Decision matrix:

Priority Best Choice
Speed on low-end device Gemma3-1B-IT
Multimodal capability Gemma-4-E2B-it
Maximum quality Gemma-4-E4B-it
Math and logic DeepSeek-R1-Distill-Qwen-1.5B
Balanced speed + quality Qwen2.5-1.5B-Instruct

Recipe 6: Use Thinking Mode for Complex Problems

Goal: Leverage Gemma 4's reasoning chain for multi-step problems.

  1. Open Chat and select Gemma-4-E2B-it or Gemma-4-E4B-it
  2. Enable the Thinking Mode toggle
  3. Send a complex prompt, for example:
A farmer has 3 fields. Field A is twice the size of Field B.
Field C is 5 acres larger than Field B. The total area is 55 acres.
How large is each field?
  1. The response includes a collapsible thinking section showing each reasoning step, followed by the final answer

When Thinking Mode helps most:

  • Math word problems
  • Logic puzzles and deduction
  • Multi-step analysis
  • Code debugging with explanations
  • Complex comparisons

Recipe 7: Set Up Restaurant Roulette with a Gemini API Key

Goal: Use the Restaurant Roulette featured skill to find nearby restaurants.

  1. Obtain a Gemini API key from Google AI Studio
  2. In the app, open Agent Skills
  3. Tap Skills chip > (+) > Add from featured list > select Restaurant Roulette
  4. Send a prompt: "Find Italian restaurants near San Francisco"
  5. When the secret dialog appears, paste your Gemini API key
  6. The skill calls the Gemini API, finds real restaurants, and displays a spin wheel for random selection

Important

Your API key is stored only in the skill's local execution environment. It is never sent through the LLM, never logged, and never transmitted to any server other than the Gemini API endpoint that the skill calls directly.

Recipe 8: Transcribe a Voice Memo

Goal: Use Ask Audio to transcribe a recorded voice memo.

  1. Open Ask Audio and select a model with audio support (Gemma-4-E2B-it, Gemma-3n-E2B-it, etc.)
  2. Tap the record button and speak for up to 30 seconds, or select an existing WAV file
  3. Send the prompt: "Transcribe this audio exactly as spoken"
  4. The model returns a text transcription

Limitations:

  • Maximum 30 seconds per audio clip
  • Audio is downsampled to 16 kHz mono — very quiet or noisy recordings may lose detail
  • For longer recordings, split them into 30-second segments

Recipe 9: Use the QR Code Skill

Goal: Generate a QR code for a URL or text string.

  1. Open Agent Skills and select a model
  2. Send: "Create a QR code for https://github.com/google-ai-edge/gallery"
  3. The model invokes the QR Code skill, which generates and displays the QR code inline in the chat
  4. You can screenshot the QR code to save or share it

Recipe 10: Automate Email with Mobile Actions

Goal: Send an email using natural language.

  1. Open Mobile Actions and download MobileActions-270M
  2. Send: "Send an email to [email removed] with subject Weekly Update and body The release is on track"
  3. The model generates a structured function call, and the app opens your default email client with the fields pre-filled
  4. Review and tap send in your email app

Recipe 11: Batch-Test Prompts in Prompt Lab

Goal: Evaluate how a model responds to a range of prompts with fixed parameters.

  1. Open Prompt Lab and select your model
  2. Set your desired parameters (e.g., temperature: 0.0, topK: 10, maxTokens: 1024)
  3. Send your first prompt and note the response
  4. Use the text input history to quickly recall and modify previous prompts
  5. Compare outputs across different prompt formulations

This workflow is useful for prompt engineering — finding the exact wording that produces the most reliable output from a specific model.

Recipe 12: Use Ask Image with Thinking Mode

Goal: Get detailed, reasoned analysis of a complex image.

  1. Open Ask Image and select Gemma-4-E2B-it or Gemma-4-E4B-it
  2. Enable Thinking Mode
  3. Take a photo of something that requires analysis — a circuit board, a complex chart, a nature scene
  4. Ask: "Explain everything you see in this image, step by step"
  5. The model first reasons through what it observes (shown in the thinking section), then delivers a structured analysis

Recipe 13: Play Kitchen Adventure

Goal: Experience the text adventure game skill.

  1. Open Agent Skills and select a model
  2. Say: "Start the Kitchen Adventure"
  3. The LLM invokes the Kitchen Adventure skill and sets the scene
  4. Respond with actions like "open the fridge" or "look around"
  5. The game proceeds based on your text input, with the LLM maintaining game state

6. Troubleshooting

Error: Model inference returns only "over" or single-word responses

Cause: Degenerate output caused by parameter misconfiguration. Reported in issue #601.

Solution:

  1. Open model configuration and set temperature to 0.7–1.0
  2. Increase maxTokens to 2048 or 4096
  3. Reset topK and topP to the model's defaults
  4. If the problem persists, delete the model and re-download it

Prevention: Start with the default configuration parameters before making adjustments. Avoid setting temperature to exactly 0.0 with very low topK values.

Error: INVALID_ARGUMENT: ERROR: [third_party/odml/litert_lm/runtime/components/model_resources_litert_lm.cc:73]

Cause: The model file is incompatible with the LiteRT-LM runtime version bundled with the app. Reported in issue #585.

Solution:

  1. Delete the downloaded model from the model selection screen
  2. Re-download the model to get the latest compatible version
  3. If re-downloading doesn't help, switch to a different model — the allowlist models are tested for compatibility

Prevention: Use models from the official allowlist rather than custom-imported models. The allowlist is version-matched to the runtime.

Error: Image recognition fails with Status Code: 13

Cause: The model executor crashes during multimodal inference, often due to insufficient memory. Reported in issue #663.

Solution:

  1. Close all background apps to free RAM
  2. Restart the app
  3. Try with a smaller or lower-resolution image
  4. Switch to Gemma-4-E2B-it if you were using a larger model — it requires less RAM

Prevention: Ensure at least 2 GB of free RAM beyond the model's stated minimum requirement.

Error: App crashes after model download

Cause: Insufficient memory to load the model, or corrupted download file. Reported in issue #668.

Solution:

  1. Restart the device to clear memory
  2. Clear app cache: Settings > Apps > Edge Gallery > Clear Cache
  3. Delete and re-download the model
  4. Try a smaller model first to confirm the app functions on your device

Prevention: Check that your device has at least the model's stated minimum RAM available (not just total, but currently available).

Error: Can't install custom skills

Cause: Skill import fails regardless of skill content. Reported in issue #619.

Solution:

  1. Verify your skill folder contains a valid SKILL.md with proper YAML frontmatter (name and description fields between --- delimiters)
  2. For URL-loaded skills, confirm the hosting service serves correct MIME types — test by loading {url}/SKILL.md in a browser
  3. For local imports, place the skill folder in an accessible location like /sdcard/Download/
  4. Try importing from the Downloads folder rather than external storage or SD card

Prevention: Use GitHub Pages with a .nojekyll file for URL-hosted skills. For local import, always use ADB push to a standard directory.

Error: GPU not recognized

Cause: The app fails to detect or initialize the GPU on certain devices. Reported in issue #682 for Pixel 10.

Solution:

  1. The app automatically falls back to CPU inference — performance will be slower but functional
  2. In model configuration, explicitly set accelerators to cpu to avoid GPU initialization attempts
  3. Check for app updates — GPU compatibility is improved in newer releases

Prevention: This is a device-specific issue. CPU fallback is always available and produces identical output.

Error: App crashes with Gemma 4 on older devices

Cause: Insufficient hardware resources for large models. Reported in issue #653 for iPhone 14 Pro (iOS) and applicable to Android devices with limited RAM.

Solution:

  1. Try Gemma-4-E2B-it instead of E4B-it (requires 8 GB vs 12 GB)
  2. If E2B also crashes, fall back to Gemma3-1B-IT (requires only 6 GB)
  3. Close all other apps before launching

Prevention: Check your device's available RAM (Settings > About Phone > RAM or Memory) against the model's minimum requirement before downloading.

Error: Memory issues during long conversations

Cause: Context accumulation exhausts available device memory over extended chat sessions. Reported in issue #82.

Solution:

  1. End the current session and return to the home screen
  2. Re-enter the chat task to start a fresh conversation
  3. Use a smaller model for extended sessions
  4. Break long conversations into shorter focused sessions

Prevention: Monitor the app's responsiveness. If responses slow down noticeably, start a new session. Models with smaller context windows (like Gemma3-1B-IT with 1024 maxTokens default) are less prone to this issue.

Error: Session resets when returning from background

Cause: Android kills the activity to reclaim memory. Was reported in issue #536 and has been fixed in newer versions.

Solution:

  1. Update to the latest version of the app
  2. Keep the app in the foreground during active model interactions
  3. Reduce memory pressure by closing other apps

Prevention: Keep the app updated. The fix for this issue is included in recent releases.

App is slow or unresponsive during inference

Cause: Multiple potential causes: thermal throttling, insufficient RAM, GPU contention, or background app memory pressure.

Diagnostic steps:

  1. Check available RAM: Settings > About Phone > Memory
  2. Feel the device — if it's hot, thermal throttling is reducing clock speeds
  3. Close background apps (especially games, browsers with many tabs, and video apps)
  4. In model configuration, try switching accelerators:
    • If set to cpu,gpu, try cpu only (GPU initialization sometimes stalls on unsupported hardware)
    • If set to cpu, try gpu only (if your device has a supported GPU)
  5. Try a smaller model — Gemma3-1B-IT is the fastest option

Model download stalls or fails

Cause: Network issues, insufficient storage, or Hugging Face rate limiting.

Solution:

  1. Check your internet connection — try loading a webpage in your browser
  2. Verify sufficient storage space: the download size is shown in the model listing
  3. Switch between Wi-Fi and mobile data
  4. Wait 10–15 minutes and retry (Hugging Face may rate-limit downloads)
  5. Restart the app and retry the download

Prevention: Use Wi-Fi for large model downloads (2+ GB). Ensure you have at least 1.5x the model size in free storage to account for temporary files during extraction.

Benchmark results vary significantly between runs

Cause: Android's dynamic resource management, thermal throttling, and background processes cause variance.

Solution:

  1. Close all background apps
  2. Let the device cool to room temperature
  3. Unplug the charger (charging generates heat)
  4. Run the benchmark 3 times and take the median result
  5. Disable battery saver mode if active

7. FAQ

Q: Does the app require an internet connection after setup?

No. After downloading a model, all inference runs entirely on-device with zero network activity. Your prompts, images, and audio never leave the phone. The only exceptions are Agent Skills that explicitly call external APIs (like Restaurant Roulette calling the Gemini API, or Mood Music calling the Loudly API) — and those skills clearly state their API requirements before use.

Q: Is my data private?

Yes. All model inference happens on your device hardware. No prompts, images, audio, or conversation content is transmitted to any server. The app includes Firebase Analytics for anonymous usage telemetry (app opens, feature usage), but this does not include any content you type or generate.

Q: Which models support image input?

Four models support image analysis: Gemma-4-E2B-it, Gemma-4-E4B-it, Gemma-3n-E2B-it, and Gemma-3n-E4B-it. These appear in the Ask Image task. Text-only models (Gemma3-1B-IT, Qwen2.5-1.5B-Instruct, DeepSeek-R1-Distill-Qwen-1.5B) cannot process images.

Q: Which models support audio input?

The same four multimodal models: Gemma-4-E2B-it, Gemma-4-E4B-it, Gemma-3n-E2B-it, and Gemma-3n-E4B-it. Audio files are limited to 30 seconds and converted to 16 kHz mono PCM.

Q: Which models support Thinking Mode?

Only Gemma-4-E2B-it and Gemma-4-E4B-it support Thinking Mode. This feature shows the model's step-by-step reasoning before the final answer. It is available in Chat, Ask Image, and Ask Audio tasks.

Q: What is the difference between the E2B and E4B model variants?

"E2B" stands for "Effective 2 Billion" parameters and "E4B" stands for "Effective 4 Billion" parameters. E2B models are smaller, faster, and require less RAM (8 GB minimum). E4B models are larger, more capable, and require more RAM (12 GB minimum). Both support the same feature set within their model family.

Q: What is the difference between Gemma 4 and Gemma 3n models?

Gemma 4 models (E2B-it, E4B-it) are newer and support Thinking Mode and Agent Chat in addition to all the modalities Gemma 3n supports. Gemma 3n models support text, image, and audio but do not support thinking or agent chat tasks. Both families support Ask Image, Ask Audio, Chat, and Prompt Lab.

Q: Can I use my own models?

Yes. You can import LiteRT-LM compatible models through the model management interface. The model must be compatible with the LiteRT-LM runtime or MediaPipe LLM Inference API. Custom models appear alongside the built-in allowlist models.

Q: How much storage space do I need?

Model sizes range from ~289 MB (TinyGarden-270M, MobileActions-270M) to ~4.9 GB (Gemma-3n-E4B-it). The app itself is relatively small. Plan for 5–10 GB of free space if you want to keep multiple models downloaded simultaneously.

Q: Can I have multiple models downloaded at the same time?

Yes. Each model is stored independently. You can download as many as your storage allows and switch between them freely. Only one model runs at a time per task.

Q: Can I run the app on Android 11 or lower?

No. The minimum supported version is Android 12 (API 31). Issue #652 tracks the community request for older Android support. Check the GitHub repository for future updates.

Q: How do I share a custom skill I created?

Post your skill to the Skills Discussion Category on GitHub. For URL-based sharing, host your skill on GitHub Pages (with a .nojekyll file) and share the folder URL.

Q: Why does the app need Hugging Face authentication?

The production app from the Play Store handles Hugging Face model downloads automatically. If you build from source, you need to configure your own Hugging Face Developer Application with OAuth credentials. See the Admin Guide for setup instructions.

Caution

Never share your Hugging Face OAuth credentials or API keys publicly. If building from source, use environment variables or a local configuration file that is excluded from version control.

Q: Can I use the app completely offline?

Yes, after the initial model download. Every feature works offline except Agent Skills that explicitly require internet access for external API calls (Restaurant Roulette, Mood Music). The core chat, image analysis, audio analysis, prompt lab, mobile actions, and tiny garden features are fully offline.

Q: What happens if my device runs out of RAM during inference?

Android will kill background processes first, then may kill the Edge Gallery app itself. If the app crashes during inference, reopen it and try a smaller model or close background apps before retrying.