On-Device Multimodal LLM Selection and AI Agent Implementation in Practice

    This article explains how to choose a multimodal large language model for on-device deployment based on hardware constraints. It compares large dense, Mixture of Experts (MoE), and small on-device model specifications, then covers engineering considerations for handling text, image, video, and native audio input.

    1. Background: Why On-Device Multimodal Capability Is in the Spotlight

    Over the past two years, large language models have improved rapidly, but most inference still relies on cloud computing. As the computing power of phones, single-board computers, and home workstations keeps growing, the demand to run models directly on end devices is getting stronger. On-device inference has three core goals: keeping data on the device to protect privacy, responding when the network is unstable, and reducing the cost of frequent cloud calls.

    At the same time, user interaction is shifting from plain text to multimodal input. Photo recognition, voice commands, and video clip understanding are all common scenarios. If each modality depends on a separate model, the system must maintain multiple processing pipelines. This increases memory usage and lengthens response time. As a result, models that can process text, images, video, and even audio in a unified way have become a key focus in on-device AI design.

    2. Specification Tiers: Selecting Models Based on Device Constraints

    Bigger is not always better when it comes to model specifications. When selecting a model, first clarify the device’s memory capacity, storage space, power budget, and latency requirements. Then decide on the parameter scale.

    Common specifications fall into three categories:

    • Large dense models: All parameters take part in every inference computation. Inference quality is usually stable, but these models require a lot of VRAM or unified memory. They suit high-performance home workstations or small servers.
    • Mixture of Experts (MoE) models: The total parameter count is large, but each token activates only a subset of expert networks. This keeps a large knowledge capacity while reducing the computation per inference. The full weights still must be loaded into memory, so storage and memory requirements remain high.
    • Small on-device models: Parameter counts are typically within tens of billions. These models are optimized for phones and embedded devices. They have a small memory footprint and controllable power consumption, which makes them suitable for resident lightweight tasks such as intent recognition, notification summarization, and simple command parsing.

    When selecting a model, you can follow this logic:

    1. If the device’s available memory is clearly smaller than the size of the quantized model weights, prioritize small models or lower-bit quantized versions.
    2. If the task requires strong reasoning and long-text understanding, and the device has sufficient memory, consider dense or MoE specifications.
    3. If the task consists of high-frequency, low-complexity operations, run a small model as a resident service. Use a large model as an on-demand fallback.

    This tiered deployment approach avoids routing every request to one large model. It balances user experience with resource consumption.

    3. Engineering Implications of Multimodal Input

    3.1 Text, Images, and Video

    Image input usually requires a vision encoder to convert pixels into visual tokens. Variable resolution support means the model can allocate different numbers of tokens based on how complex the image content is. For example, a screenshot with a lot of text can use a higher resolution, while a simple icon can use a lower one. This approach balances accuracy and computational cost.

    Video input is generally treated as a sequence of key frames. Common engineering practices include uniform frame sampling, scene-change-based frame sampling, and deduplication of adjacent frames. The frame sampling strategy directly affects understanding quality and computational overhead, so it should be evaluated against the specific business needs.

    3.2 Native Audio Input and Separate Speech Recognition Pipelines

    Traditional voice interaction typically uses a serial structure. A separate speech recognition module first converts audio to text, and then a language model processes the text. This structure has clear module boundaries and is easy to replace. It also has clear drawbacks:

    • The pipeline gets longer, and each stage adds latency.
    • Recognition errors propagate downstream, and the language model can hardly correct acoustic-level errors.
    • Two models reside in memory at the same time, doubling the on-device resource pressure.
    • Tone, pauses, and ambient sound in speech are easily lost during transcription.

    When a model natively supports short audio input, the audio can be encoded directly into the context. This removes one intermediate transcription step. The approach is especially valuable for short command scenarios, such as “Remind me to have a meeting at 3 p.m.” or “Organize the recording I just made into three key points.” However, native audio capability usually has an input duration limit. Long recordings beyond that limit still need to be split into segments or handled through a separate long-audio transcription pipeline.

    The following illustrative code shows the difference between the two paths:

    1. # Path 1: serial speech processing
    2. def handle_voice_serial(audio):
    3. text = speech_to_text(audio) # Standalone speech recognition module
    4. return llm_generate(prompt=text) # Language model processes the transcribed text
    5. # Path 2: native audio input
    6. def handle_voice_native(audio):
    7. if duration(audio) <= MAX_NATIVE_AUDIO_SECONDS:
    8. return llm_generate(audio=audio) # Audio goes directly into the model
    9. chunks = split_audio(audio, MAX_NATIVE_AUDIO_SECONDS)
    10. return [llm_generate(audio=c) for c in chunks]

    In practice, evaluate the two paths using three metrics together: end-to-end latency, recognition accuracy, and peak memory usage. Do not compare them by module count alone.