On-Device Deployment and Model Selection Guide for Open-Source Multimodal LLMs on Mobile Phones

    This guide explains what open-source multimodal models can do on mobile devices, how to choose parameter sizes based on device capacity and use case, how to check the environment and deploy a model for offline use, and how to measure performance, troubleshoot common issues, and decide when cloud assistance is needed.

    1. What On-Device Multimodal Models Can Do

    Past open-source on-device models mostly handled text only. Recently, some open-source on-device models have begun to natively support image and audio input and to offer multi-step reasoning and tool-calling capabilities. For developers, images captured by a phone camera and audio recorded by a microphone can be fed directly to the model as input.

    These capabilities vary by model. Image question answering can usually recognize common objects and large text, but accuracy for small characters and complex charts needs to be tested with your own samples. Tool calling also has boundaries: the model can only issue a call request, while the actual operation is still executed by application code. Therefore, operations involving calendars, notes, system settings, and similar functions require user confirmation and permission controls.

    2. Model Selection: Choose Parameter Size by Device and Use Case

    On-device deployment usually involves trade-offs among three factors: answer quality, response speed, and resource usage. A larger parameter size generally improves answer quality, but it also increases memory and storage pressure.

    Parameter size Theoretical INT4 weight size Suitable devices Recommendation
    2B About 1 GB Older devices with less memory Prioritize speed; choose when complex reasoning requirements are low
    4B About 2 GB Mid-to-high-end devices from the past two years First choice for most users; balances quality and speed
    20B and above About 10 GB or more Computers or workstations Generally cannot run on phones

    The theoretical size is estimated as parameter count multiplied by 0.5 bytes. Actual released files also include components such as the vision encoder, audio encoder, and vocabulary, so they will be larger. Use the size stated on the release page. Runtime memory usage includes not only weights but also the KV cache, which grows with context length. The larger the context length, the more memory is used.

    For most users, an instruction-tuned 4B model is usually a suitable starting point. If device memory is tight, switch to the 2B version and test again.

    3. Environment Checks Before Deployment

    • System version: Follow the minimum system requirements listed on the inference app’s store page. Common requirements are Android 12 or later, or iOS 17 or later.
    • Storage space: Reserve at least 1.5 times the model file size. Downloading and decompressing temporarily require extra space.
    • Download network: Download over Wi-Fi. If the download is interrupted, prefer an app or tool that supports resumable downloads.
    • Source and integrity: Download only from the model publisher’s official page or a mirror it specifies. After downloading, verify the SHA256 checksum provided on the release page.
    • License: Read the model license before downloading and confirm whether commercial use, redistribution, or modification is allowed.

    The commands for calculating SHA256 on a computer are below. Replace the file name with the actual path:

    1. # macOS / Linux
    2. shasum -a 256 model-file-name
    3. # Windows (PowerShell)
    4. Get-FileHash -Algorithm SHA256 model-file-name

    If the calculated result does not match the release page, do not load the file. Download it again.

    4. Deployment Steps

    1. Install an inference app. You can use an open-source on-device model app such as Google AI Edge Gallery. If you need custom features, you can also integrate and develop with MediaPipe LLM Inference API, llama.cpp, MLC LLM, or ExecuTorch. Using an app directly is suitable for quick validation; custom integration is suitable for product development.
    2. Download the model. Choose the INT4 quantized version for the corresponding parameter size, and verify the hash after download.
    3. Load and set parameters. The following is a parameter example. Actual field names depend on the documentation of the app or framework you use:
    1. {
    2. "model_path": "/storage/models/4b-instruct-int4",
    3. "backend": "NPU",
    4. "fallback_backend": "CPU",
    5. "max_context_length": 2048,
    6. "temperature": 0.7,
    7. "offline_mode": true
    8. }

    Two parameters are worth noting. First, setting a fallback backend is necessary because the NPU may not support some operators in the model; without a fallback, loading can fail. Second, start testing with a context length of 2048 and increase it gradually after confirming memory stability.

    1. Verify offline operation. Turn on airplane mode, send several test questions, and confirm that the app returns results normally. Also record the latency of each response and device status.

    5. How to Measure Performance

    First-token latency and generation speed depend on device model, inference backend, and context length; there is no universal value. The most reliable approach is to measure on your own device:

    • Test input: Use a fixed prompt, such as a paragraph of about 200 words, repeat the test five times, and take the median.
    • First-token latency: The time from tapping send to the first character appearing in the interface. You can time it frame by frame with screen recording or check timestamps in app logs.
    • Generation speed: Divide the total number of generated tokens by the generation time to get tokens per second.
    • Memory usage: On Android, connect the device to a computer and run adb shell dumpsys meminfo package-name to view app usage. On iOS, use the Allocations tool in Xcode Instruments to observe memory changes.

    Keep conditions the same during testing, including device temperature, battery level, background apps, and context length. Otherwise, results cannot be compared directly.

    6. Common Errors and Troubleshooting

    Symptom Possible cause Action
    Model fails to load Incomplete file or format mismatch with the app Re-download and verify the hash; confirm the file format
    Crash or freeze after loading Insufficient memory Use a smaller model, reduce context length, close background apps
    Inference becomes noticeably slower NPU does not support some operators and has fallen back to CPU Check backend information in app logs; switch to a supported backend or model
    Download interrupted Unstable network or insufficient storage Switch Wi-Fi, check free space, use resumable download
    Poor answer quality Model is too small or prompt is unclear Clarify task requirements, provide examples, or switch to the 4B version

    7. Typical Scenarios and Usage Boundaries

    Privacy-sensitive scenarios. In finance, healthcare, and other industries, local computation keeps data from being uploaded to external servers, reducing leakage risk during transmission. However, locally stored data still requires encryption and access control. Running locally does not automatically mean secure.

    Weak or no network scenarios. In field inspection, outdoor operations, and similar environments, workers can take photos of equipment and pass them to a local model for preliminary assessment. The model’s judgment still requires human review, especially for conclusions related to safety.

    8. Device-Cloud Collaboration: When to Use the Cloud

    On-device models have limited context length, knowledge capacity, and code-processing ability. Long-document analysis, large-scale retrieval, or complex code refactoring may exceed the capabilities of an on-device model. A common approach is to let the on-device model handle high-frequency, low-latency intent recognition and simple Q&A, and forward complex tasks to a cloud LLM.

    When choosing a solution, weigh the following points:

    • Latency: Cloud requests involve a network round trip, and responses may be unstable in weak network environments.
    • Cost: Cloud services are usually billed by usage, while on-device processing mainly consumes device power and storage.
    • Privacy: After data is uploaded, confirm the provider’s data retention and usage policies.
    • Availability: When the network is disconnected, basic on-device functions should still be available.

    For the cloud part, you can use general LLM service platforms and object storage services. The specific choice should be based on your team’s compliance requirements and budget.

    Conclusion

    Open-source on-device multimodal models lower the barrier to local AI applications. By choosing the right parameter size, deploying step by step, and measuring on your own device, you can determine whether a model fits a specific scenario.