Open-Source Multimodal Models: A Complete Guide to Spec Selection and On-Device Offline Deployment
This guide walks through a new generation of open-weight multimodal models released in April 2026, covering four configurations (E2B, E4B, 26B A4B, and 31B) and their benchmark scores. You'll learn how to read the different parameter conventions (effective, total, and active parameters), estimate VRAM and KV-cache costs for long contexts, and choose the right spec by working backward from your use case. The article then provides a full hands-on tutorial for running these models offline on a phone—downloading and verifying weights, quantizing to 4-bit, and integrating inference into an Android app—followed by practical engineering guidance on structured output, context management, edge-cloud routing, privacy, licensing, and a step-by-step deployment checklist.
Introduction: Locally Deployable Multimodal Capability Is Maturing
On April 2, 2026, an open-source organization released a new generation of open-weight multimodal models. The series adopts an open-weights strategy: developers can download it, fine-tune it, and use it commercially within the terms of the license. It shares part of its underlying technical lineage with a closed flagship released around the same time. Community evaluations report that the flagship configuration scores 85.2% on MMLU Pro, 89.2% on AIME 2026, 80.0% on LiveCodeBench v6, and 76.9% on MMMU Pro—placing it close to leading closed-source models in capability.
The series ships in four configurations: 2 billion effective parameters (E2B), 4 billion effective parameters (E4B), 26 billion total / 4 billion active parameters (26B A4B), and 31 billion parameters (31B). Two of the on-device models run on a phone with no network connection, with context windows of 128K and 256K respectively.
For a developer team, the genuinely useful questions aren’t “is bigger always better,” but rather:
- Which capability tier does my scenario actually need?
- Where are the real boundaries of memory, latency, and power consumption on-device?
- How do I combine on-device and cloud capabilities into a cost-controlled system?
This article addresses these questions in the order of “technical foundations → selection decisions → on-device deployment → engineering practice → troubleshooting.”
1. Feature Overview: Why This Generation Suits On-Device Use
The series has six key characteristics, five of which directly affect engineering implementation.
- Four configurations, from phone to server: Developers can tier their usage by hardware, with low migration cost between tiers thanks to a shared interface.
- Long context on-device: Context windows expand to 128K (256K on the flagship), which significantly reduces the engineering complexity of tasks like chunked summarization and retrieval augmentation. The trade-off is that the KV cache grows linearly with length; estimation methods are provided below.
- Native multimodality: Vision and audio are handled by native encoding modules, rather than stitching the model into a serial “text model + OCR + speech recognition” pipeline. This reduces module coupling and accumulated error.
- Permissive open-source license: Commercial use and redistribution are allowed, but the obligations still need to be checked item by item. Section 7 covers this in detail.
- Architecture designed for the edge: On-device models use an “effective parameters” convention and an audio encoder, aiming to keep memory footprint within a range acceptable for consumer phones.
- 140+ languages: Coverage spans major languages and many low-resource languages, so scenarios like cross-lingual retrieval and localized customer support can reuse the same model directly.
1.1 Comparing the Four Configurations
| Model | Parameter size | Architecture | Context | Multimodal support | Typical use |
|---|---|---|---|---|---|
| E2B | 2B (effective) | Dense + parameter-sharing embeddings | 128K | Text + image + audio | Phone / edge devices |
| E4B | 4B (effective) | Dense + parameter-sharing embeddings | 128K | Text + image + audio | Laptop / fast inference |
| 26B A4B | 26B (4B active) | Mixture of Experts (MoE) | 256K | Text + image | Speed-quality balance |
| 31B | 31B | Dense | 256K | Text + image | Highest performance |
Two notations in the table are easy to misread:
- “26B A4B”: 26 billion total parameters, of which only about 4 billion are activated per inference. The compute is close to a 4B dense model, but VRAM must still hold all the expert weights.
- “PLE” (Per-Layer Embeddings): A parameter-sharing embedding mechanism introduced in the Gemma 3 era. It splits a large vocabulary embedding layer across multiple sub-layers to lower peak VRAM. Conceptually, you can think of it as “a dense architecture plus a lightweight embedding layer.”
2. Key Technical Features in Depth
2.1 Parameter Conventions: Total, Active, and Effective Parameters
Effective parameters are how this series labels its on-device models. It is commonly used for the “dense + per-layer embeddings” structure and emphasizes the parameters that actually participate in computation and memory usage, rather than counting the shared embedding layer in full each time.
Total and active parameters are the general convention for MoE: total parameters determine VRAM usage, while active parameters determine the compute per forward pass.
| Dimension | Determined by |
|---|---|
| VRAM usage | Total params × bytes per param + KV cache + vision/audio encoder overhead |
| Compute per pass | Dense: all parameters; MoE: active parameters (plus routing overhead) |
| Multi-request throughput | Dense: compute grows linearly with requests; MoE can batch and merge routing, but routing overhead rises with request count |
So “4 billion active” does not mean “estimate VRAM as if it were a 4B dense model.” When deploying 26B A4B, you must at minimum fit a quantized copy of all 26 billion parameters in VRAM.
A rough estimate of bytes per parameter after quantization:
- FP16: 2 bytes
- INT8: about 1.06 bytes (including scale, zero-point, and other metadata)
- INT4: about 0.59 bytes
- Common 4-bit weight + FP16 activation scheme: about 0.5–0.6 bytes per parameter
Example: 26 billion parameters at 4-bit quantization weigh about 26 × 0.59 ≈ 15.3 GB, which already exceeds most consumer-grade VRAM and requires multi-GPU sharding or memory offloading.
2.2 Context Window and KV Cache Cost
Context is “input tokens plus output tokens,” not “document character count.” Rough conversion: English is about 1 token ≈ 4 characters, and Chinese is about 1 token ≈ 1–1.5 characters. A 128K-token context roughly corresponds to a novella or several hundred pages of technical documentation.
As the context grows, the most direct cost is KV cache VRAM:
KV ≈ 2 × num_layers × context_length × key_value_elements_per_token × bytes_per_element
Example: with 26 layers, a key-value dimension of 1024, FP16, and a 32K context, KV ≈ 2 × 26 × 32768 × 1024 × 2 B ≈ 3.3 GB. Multiply the context 8× to 256K and the KV cache swells to about 26 GB. This is exactly why on-device models need mechanisms such as grouped-query attention (GQA), sliding windows, or KV quantization.
Engineering recommendations:
- Don’t max out the context by default; set the limit to “tokens the task needs × 1.2.”
- Control injected content with a “retrieval-first, full-context fallback” approach.
- For large documents, summarize in chunks first, then answer—rather than stuffing the whole document into the context.
2.3 Native Multimodal Support
Image input is typically processed via “tiling + resolution normalization,” and the resulting visual tokens are concatenated with ordinary text tokens. Visually, Gemma 3’s signature resolution is 896×896, producing roughly 256 visual tokens per tile. The Gemma 4 series shows no revision to this in the official technical documentation, so token overhead can be estimated provisionally at this magnitude.
For audio, the on-device models provide speech understanding and translation. The official documentation states a maximum of 30 seconds of speech per request; longer recordings must be segmented first.
Audio token conversion (illustrative):
audio tokens ≈ duration (seconds) × frames_per_second (~50) / compression_ratio (~4) ≈ duration × 12.5
That is, 30 seconds of speech produces about 375 tokens. Combined with a 128K context, an on-device model can fully handle integrated tasks like “record + converse + summarize.”
3. Selection Decisions: Working Backwards from the Scenario
3.1 Selection Decision Tree
- Must it run offline or keep data on-device? Yes → on-device tier (E2B / E4B); otherwise go to step 2.
- Does it need image and audio input simultaneously? Yes → on-device or flagship tier (image + audio is fully supported only on the on-device tier); image only → any of the four tiers.
- Does it need long documents or long conversations? Yes → 26B A4B / 31B (256K); the on-device tier’s 128K also covers most document scenarios.
- Is VRAM constrained? Yes → prefer MoE or a quantized on-device model; no → 31B offers the best quality.
3.2 Selection Quick-Reference Table
| Dimension | E2B | E4B | 26B A4B | 31B |
|---|---|---|---|---|
| Typical device | Upper-mid/high-end phone | Laptop / tablet | Workstation / single-GPU server | Multi-GPU server |
| VRAM need (4-bit estimate) | ~1.5 GB | ~2.7 GB | ~15 GB+ | ~18 GB+ |
| Output speed | High | Fairly high | Medium (few active params) | Medium-low |
| Knowledge/reasoning ceiling | Medium | Medium-high | High | Highest |
| Image | ✅ | ✅ | ✅ | ✅ |
| Audio | ✅ | ✅ | ❌ | ❌ |
| Typical use | Offline assistant, real-time translation | Document Q&A, code completion | Server-side workhorse, long documents | Complex reasoning, professional analysis |
3.3 Capability Boundaries of On-Device Models
| Model | MMLU Pro | AIME 2026 | LiveCodeBench v6 | MMMU Pro |
|---|---|---|---|---|
| 31B | 85.2% | 89.2% | 80.0% | 76.9% |
| 26B A4B | 82.6% | 88.3% | 77.1% | 73.8% |
| E4B | 69.4% | 42.5% | 52.0% | 52.6% |
| E2B | 60.0% | 37.5% | 44.0% | 44.2% |
Key takeaways:
- Knowledge and general understanding: E4B trails 31B by about 16 points, which is generally enough for everyday Q&A, summarization, and translation.
- Math reasoning: On-device models degrade fastest here; E2B reaches only about 42% of 31B. Complex calculations and multi-step reasoning must be handed off to a larger model or the cloud.
- Code generation: On-device tiers suit completion and explanation, not refactoring or cross-file changes.
- Multimodal: E4B’s MMMU Pro is slightly higher than 26B A4B’s, indicating that visual capability is not determined by parameter count alone; the visual encoder and the balance of training data have a large impact on small on-device models.
The conclusion: an on-device model is not a “shrunk flagship” but an independent product aimed at low latency, privacy, and offline scenarios. Treating it as a “free cloud model” will almost certainly fail on complex tasks.
3.4 Scenarios Not Recommended for On-Device
- Requiring multi-step tool calls and external API orchestration
- Requiring stable JSON Schema output or complex function calling
- Requiring long-term memory across sessions
- Single inputs exceeding 50,000 tokens that must retain all details
- Requiring high-concurrency throughput (the edge only scales linearly by adding devices)
4. Complete Tutorial: Offline Deployment on a Phone
4.1 Environment and Hardware Requirements
- Device: Android 10+ (12+ recommended), 8 GB+ RAM (12 GB recommended), 4 GB+ free storage.
- Optional: Recent high-end phone platforms typically integrate a dedicated NPU that can significantly accelerate prefill and decode for on-device models. Specific operator support varies by chip; it’s advisable to first get the CPU path working, then evaluate NPU acceleration.
- Network: Only needed to download the model.
4.2 Obtaining and Verifying the Model
# 1. Create a directorymkdir -p ~/gemma4 && cd ~/gemma4# 2. Download the on-device model (using a generic Hugging Face downloader as an example)hf download <model-repo-name> --include "*-it-gguf/*" --local-dir ./# 3. Verify integrity (example: compare against the official sha256)sha256sum ./gemma-4-E2B-it-Q4_K_M.gguf
Note: Exact file names and repository names should follow the official release page. This article uses placeholder notation to avoid pointing to any third-party resources. Under no circumstances should you download weight files from unofficial sources.
4.3 Quantizing and Exporting (If You Quantize Yourself)
# convert.py — convert the raw weights into a generic intermediate formatfrom transformers import AutoModelForCausalLM, AutoTokenizermodel_id = "<your-on-device-model-id>"model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="auto", trust_remote_code=True)tokenizer = AutoTokenizer.from_pretrained(model_id)# Save in a generic intermediate format for the quantization tooling to readmodel.save_pretrained("./gemma4-e2b-fp16")tokenizer.save_pretrained("./gemma4-e2b-fp16")
# Quantize to 4-bit (a Q4_K_M-type config balances quality and size well)llama-quantize ./gemma4-e2b-fp16 ./gemma-4-E2B-Q4_K_M.gguf Q4_K_M
| Quantization tier | Size (relative) | Quality loss | Use case |
|---|---|---|---|
| FP16 | 100% | None | Precision evaluation, desktop |
| Q8_0 | ~50% | Minimal | Precision-sensitive servers |
| Q4_K_M | ~25% | Small | Default first choice for phones |
| Q3/Q2 | ~15–20% | Noticeable | Extreme memory-constrained devices |
4.4 Integrating on Android (Kotlin Example)
// Wrap the on-device inference engine through JNI; replace with your own inference runtimeclass GemmaRuntime {external fun init(modelPath: String, ctxLen: Int): Longexternal fun reset(handle: Long)external fun addImage(handle: Long, bitmapPath: String)external fun addAudio(handle: Long, pcmPath: String, sampleRate: Int)external fun chat(handle: Long, prompt: String, maxTokens: Int): Stringexternal fun release(handle: Long)}class GemmaSession(private val modelPath: String) {private var handle: Long = 0Lprivate val executor = Executors.newSingleThreadExecutor()fun start(ctxLen: Int = 8192) {executor.execute {handle = GemmaRuntime.init(modelPath, ctxLen)}}fun ask(prompt: String, maxTokens: Int = 512, image: String? = null): String {// Clear context at the start of a session to avoid cross-session contaminationGemmaRuntime.reset(handle)image?.let { GemmaRuntime.addImage(handle, it) }return GemmaRuntime.chat(handle, prompt, maxTokens)}fun release() {executor.execute { GemmaRuntime.release(handle); handle = 0L }}}
Integration notes:
- Inference must run on a worker thread; the main thread only handles UI rendering.
- Model loading is time-consuming, so consider preloading asynchronously at app startup.
- Set the context length per task; don’t max it out by default.
- Images and audio must be added to the context within the same session before starting the conversation.
4.5 First-Run Verification
# Minimal offline check: confirm the model loads and produces normal outputllama-cli -m ./gemma-4-E2B-Q4_K_M.gguf \-p "Explain on-device inference in one sentence." \-n 128 -t 4 --temp 0.7
Expected output: a short explanation. If the output is garbled or truncated, first check whether the quantization tier and tokenizer match.
4.6 Performance Baseline (Illustrative; Measure on Actual Hardware)
| Metric | How to observe | Reference range |
|---|---|---|
| First-token latency | Cold start + time to first token | 0.5–3 s |
| Decode speed | tokens/s | 10–40 (chip and quantization dependent) |
| Peak memory | System memory monitor | 1.5–3 GB (E2B Q4) |
| Power per request | Battery stats | Significantly lower than sustained networked inference |
The table above is only an engineering estimate. Real numbers vary widely with the SoC, thermal design, and system scheduling and must be validated on a physical device.
5. Engineering Practice: Making On-Device Models Actually Usable
5.1 Structured Output
Small on-device models follow complex JSON Schemas only to a limited degree. It’s recommended to use constrained decoding (grammar / JSON mode) together with a “skeleton first, then fill in values” prompting strategy.
Output strictly in the following JSON structure and add no explanatory text:{"summary": "one-sentence summary", "entities": ["..."], "sentiment": "positive|neutral|negative"}
5.2 Context Management
- Sliding window: Keep the system prompt plus the most recent N turns of conversation.
- Summarization compression: When conversation history exceeds a threshold, generate a rolling summary with a small model.
- Retrieval augmentation: Slice and vectorize documents first, then inject Top-K snippets on demand.
# Context trimming illustrationdef trim(messages, max_tokens=6000):while estimate_tokens(messages) > max_tokens and len(messages) > 2:# Always keep the system prompt (index 0)messages.pop(1)return messages
5.3 Edge-Cloud Collaboration
A practical pattern is “edge routing + cloud fallback”:
- The on-device model first performs intent classification and difficulty assessment;
- Simple tasks are completed locally, ensuring privacy and low latency;
- Complex tasks (multi-step reasoning, code generation, long documents) are forwarded to the cloud.
Routing logic illustration:
def route(task):if task.needs_external_tool or task.is_multi_step():return CLOUD # tool calls / complex reasoningif task.input_tokens > 8000:return CLOUD # overly long contextreturn EDGE # complete locally by default
5.4 Security and Privacy
- Keeping data on-device is one of the core values of edge deployment, but logs, crash reports, and analytics can still carry user content and must be redacted.
- Model output is untrusted; whenever tool calls are involved, enforce permission checks and secondary confirmation.
- For content uploaded to the cloud, clearly inform the user and follow the principle of data minimization.
6. FAQ
Q1: Can a phone really run it?
Yes. Models like E2B/E4B, with their “effective parameters + per-layer embeddings” design, target the edge by design. In testing, after Q4 quantization, E2B uses about 1.5–2.5 GB of memory and decodes at 10–30 tokens/s on mainstream upper-mid/high-end phones, well-suited to light tasks like Q&A, summarization, and translation.
Q2: Is a 128K context usable on a phone?
You can enable it, but at the cost of memory and first-token latency. It’s recommended to default to 4K–8K, expand dynamically when needed, and combine it with KV quantization.
Q3: How do I choose between edge and cloud?
Look at three constraints: whether data must stay on the device, whether offline operation is required, and the complexity of a single task. When none of these is sensitive, use the cloud flagship tier directly.
Q4: What’s the maximum audio length?
The on-device models support about 30 seconds per request. Longer recordings must be segmented (by silence or a fixed window), recognized segment by segment, and then concatenated.
Q5: Are there limits on image input?
It’s recommended to keep the resolution within the model’s default visual input size (e.g., 896×896). Larger images get tiled and significantly increase the number of visual tokens, slowing first-token latency.
Q6: Can it be used commercially?
Yes. The series uses a permissive license that allows commercial use and redistribution, but you must comply with terms such as attribution and retaining the license text. See Section 7 for details.
Q7: Why do on-device models keep getting math problems wrong?
Parameter count and training data balance determine the ceiling for math reasoning. On-device models are clearly weaker than large models on math and code benchmarks, so complex calculations should be handed to the cloud or an external computation tool.
Q8: How do I evaluate whether my scenario suits the edge?
Build a set of 50–100 real business samples, then compare three approaches—edge / cloud / edge-cloud collaboration—across task success rate, first-token latency, cost per request, and user satisfaction before deciding.
7. Open-Source Licensing and Compliance Notes
- Attribution and license text: When redistributing, retain the copyright notice and a copy of the license.
- No trademark grant: The license typically does not grant the right to use the publisher’s name or trademarks, so handle your own product naming.
- Safety and acceptable-use clauses: Most open-source licenses include an acceptable use policy prohibiting unlawful, infringing, or harmful use.
- Output responsibility: Model output does not constitute professional advice; high-risk scenarios such as medical, legal, and financial matters require human review.
- Regional compliance: Different regions impose requirements such as registration, content safety, and data-export rules for generative models, which should be verified item by item before launch.
8. Summary: Three Selection Principles and a Deployment Checklist
- Capability over parameters: First clarify the task type (Q&A / summarization / code / multimodal / long documents), then choose a tier.
- Latency and cost decide the architecture: The edge handles real-time and privacy, the cloud handles complexity and long context, and edge-cloud collaboration is the optimal solution.
- Engineering details decide the experience: Quantization tier, context limit, constrained decoding, and log redaction—these details affect the final result more than the model itself.
Deployment checklist:
- Confirm device memory and OS version
- Download and verify the model files
- Choose a quantization tier (default Q4_K_M)
- Integrate the inference runtime and call it on a worker thread
- Establish a performance baseline (first token, decode speed, peak memory)
- Design context management and routing strategies
- Complete the privacy and compliance review
