On-Device Multimodal LLM Selection and Mobile Deployment Guide
This guide explains how to choose multimodal large language models for on-device use and deploy them on phones. It covers task-driven model sizing, dense and MoE trade-offs, quantization and memory estimates, local and SDK deployment routes, LAN testing with Ollama, and Android SDK integration considerations.
1. Why Put Multimodal Models on the Edge
Cloud inference has three inherent problems. First, private data must leave the device, which raises compliance review costs. Second, network round trips slow down real-time interactions such as voice and camera use. Third, invocation costs rise linearly with the number of users.
In recent years, the open-source community has released small-parameter models that support image and audio inputs, making on-device deployment feasible. Before selecting a model, keep one point in mind: publishers, versions, and licenses vary. Any capability mentioned in this article must be verified against the corresponding official model card.
2. Define Task Difficulty Before Choosing Model Size
The selection order should be: first define the upper bound of task difficulty, then choose the smallest specification that can meet it. Larger models infer more slowly and consume more memory; anything beyond the requirement is waste.
On-device models are generally suitable for tasks such as:
- Intent recognition, keyword extraction, and simple classification;
- Speech transcription and short speech translation;
- Image content description and question answering over text in images;
- Short-text summarization and rewriting.
Tasks involving multi-step mathematical reasoning, long-chain logical deduction, or large-scale code generation are better suited to larger specifications running on desktops or servers.
When selecting a model, check the following fields item by item and record them in the team’s selection table:
- Publisher and link to the official model card;
- Parameter basis: whether the stated figure refers to total parameters or active parameters, as the two can differ significantly;
- Architecture: dense model or MoE (Mixture of Experts) model;
- Supported input modalities: the extent to which text, image, and audio inputs are supported;
- Maximum context length;
- License name and terms of use.
3. Dense vs. MoE Architectures
A dense model uses all parameters during every inference pass. Its structure is simple, and memory usage and computation are directly related to parameter scale.
An MoE model contains multiple expert subnetworks, and each token activates only a small subset of them. The total parameter count can be large, while the computation per inference pass is close to that of a smaller dense model. The trade-off is that memory must hold all parameters, so MoE is better suited to memory-rich, compute-limited desktop environments, such as laptops with large memory or workstations using hybrid CPU and VRAM inference.
To determine which category a model belongs to, consult its architecture documentation directly. Do not infer it only from the number in the model name.
4. On-Device Quantization and Memory Estimation
Quantization is the process of compressing model weights from high-precision to lower-bit representations. 4-bit quantization is the most common choice for on-device use, offering a reasonable balance among size, speed, and output quality.
Memory can be estimated with a rough formula: weight usage is approximately the parameter count multiplied by the number of bits per parameter, divided by 8. Then add runtime cache, vision or audio encoder, and KV cache overhead. For example, a 2-billion-parameter model has about 1 GB of 4-bit weights, but actual usage is usually higher and must be measured on the target device.
KV cache grows linearly with context length. A specification that claims support for 128K context does not mean a phone can use it without limit. For on-device use, keep effective sessions within 4K to 8K tokens and hand off excess content to retrieval or summarization.
Image input also has a cost. Large images should first be scaled proportionally to near the resolution recommended by the model; otherwise, preprocessing and inference time will increase noticeably.
5. Two Paths for Phone Deployment
There are generally two routes for on-device inference.
The first is the local runtime framework route. Use a general inference tool that supports quantization formats such as GGUF. This is suitable for development, debugging, and quickly validating model capabilities, but it is not suitable as a direct integration approach for a production product.
The second is the mobile SDK route. Use a vendor-provided mobile inference framework to load packaged model files such as .task or .litertlm. This allows deeper integration into an app and usually provides better performance and power efficiency.
For Android, the minimum recommended configuration is 8 GB of memory, with 12 GB or more preferred, Android 10 or later, and GPU support for OpenCL or a vendor-provided acceleration backend. For iOS, iPhone 12 or later is recommended. These figures are empirical references; test on target devices before final model selection.
6. Quick LAN Validation with Ollama
This approach is suitable for quickly validating model capabilities between a computer and a phone. Note that 127.0.0.1 on a phone points to the phone itself, so it cannot access a service on the computer. There are two viable options; choose either one.
Option 1: Run the model on the phone. On Android, install a supported inference tool through Termux, have the service listen on localhost, and access it from the phone itself.
Option 2: Run the model on the computer and access it from the phone over the LAN. On the computer, run:
# 1. Pull a quantized model; replace <model-name> with a name verified in the official model libraryollama pull <model-name># 2. Make the service listen on all network interfaces; the default port is 11434OLLAMA_HOST=0.0.0.0:11434 ollama serve
On the phone, replace the address with the computer’s LAN IP, for example 192.168.1.20:
# 3. Send a request with an image; the image must first be converted to a base64 stringcurl http://192.168.1.20:11434/api/generate -d '{"model": "<model-name>","prompt": "Summarize the content of this image","images": ["<base64 string of the image>"],"stream": false}'
When using this method, note the following:
- After the service listens on 0.0.0.0, other devices on the same network can also access it, and there is no authentication by default. Use it only on a trusted home or office network;
- In the computer firewall, allow only port 11434 and restrict access to the LAN subnet;
- After debugging, promptly change the listening address back to 127.0.0.1 or stop the service.
7. Android SDK Integration Key Points
For a production product, using a vendor’s mobile SDK is recommended. A complete runnable code sample is not provided here because dependency coordinates, class names, and parameter names can change quickly across versions, and copying them directly can easily lead to errors. The following is a structural outline of the integration flow; refer to the official documentation for the SDK in use for specific method names and dependency versions.
The general integration steps are:
- Add the inference dependency specified in the official documentation to Gradle, using the latest stable version listed in the documentation;
- Place the model file in the app’s private directory, or download it from a trusted address on first launch and verify its hash;
- Create an inference configuration and set the model path, maximum generation length, sampling parameters, and similar options;
- Create an inference session and handle synchronous calls and streaming output separately;
- Release inference resources when the page is destroyed or the app moves to the background to avoid long-term memory usage.
Multimodal input requires two additional checks. The first is whether the model supports image inputs. Confirm the remaining requirement in the official SDK documentation.
