On-Device LLM Deployment: A Technical Overview of Running Large Models on Mobile Phones

    This article takes a systematic look at how to deploy large language models on mobile devices. It explains why LLMs are moving from the cloud to the phone, how vendors choose models (from compact 1B–4B on-device models to large MoE models), and how quantization, pruning, and distillation make those models fit within limited memory. It then covers how system-level agent frameworks turn models into active services through tool calling, how on-device and cloud inference divide the work, and how on-device RAG powers personalized, privacy-preserving memory. It also outlines the metrics teams should use to evaluate on-device models and the core principles of on-device intelligence.

    On-Device LLM Deployment: A Technical Overview of Running Large Models on Mobile Phones

    A notable recent trend in the industry is that leading device vendors are accelerating the development of their own on-device large models. They are integrating these models into new releases of their mobile operating systems, connecting them to system-level agent frameworks and local memory apps. From internal model lists to hidden debug options, a pattern is taking shape: a lightweight on-device model, a large-scale cloud model, and system-level orchestration working together. Behind this trend lies the full technical chain that takes on-device AI from concept to real-world deployment. Setting specific products aside, this article examines the general question of how to deploy large models on a phone.

    1. From the Cloud to the Device: Why LLMs Need to “Live” in Your Phone

    Over the past two years, LLM inference has taken place almost entirely in the cloud. However, as on-device compute grows more powerful and model miniaturization techniques mature, moving models onto the phone itself is delivering three core benefits:

    1. Low latency and smooth interactions: Local inference needs no network round trip, so time to first token can drop from seconds to the millisecond or sub-second range. Highly interactive scenarios are very sensitive to responsiveness. These include voice assistants, keyboard text prediction, real-time translation, and post-processing of photos, and on-device inference can noticeably improve the experience in all of them.
    2. Offline availability: On-device models can keep working in environments with weak or no connectivity, while traveling across regions, or during network congestion. This keeps core AI capabilities available without interruption.
    3. Privacy and compliance: Processing user data entirely on the device avoids uploading sensitive information to the cloud. This naturally aligns with principles such as data minimization and privacy protection.

    For these reasons, a growing number of vendors treat on-device models as the foundation for system-level AI, making them available to all kinds of apps.

    2. Model Selection: Parameter Counts, MoE, and the “Good Enough” Engineering Philosophy

    Terminals have very limited budgets for compute, memory, and power, so model selection must balance capability against cost. A common industry practice is to maintain a tiered model matrix:

    • Primary on-device models: Usually in the 1B–4B parameter range, these handle frequent, lightweight, latency-critical tasks.
    • Mid-size models: These target scenarios that need stronger reasoning and can tolerate somewhat higher latency.
    • Large cloud models: With tens of billions of parameters or more, these handle heavy workloads such as complex logical reasoning and long-form generation.

    One architecture that has gained traction in recent years is the MoE (Mixture of Experts) sparse architecture. A MoE model has a much larger total parameter count than the number of parameters active in each forward pass. Models described this way, such as one with 26B total parameters and 4B activated per inference, illustrate the distinction:

    • Total parameters determine the model’s knowledge capacity and upper limit of expressiveness.
    • Activated parameters determine the actual compute cost of a single forward pass.

    By using a gating network to activate only some expert subnetworks at a time, MoE models can approach the capabilities of much larger models at a relatively low inference cost. This makes them well suited to memory-constrained on-device environments. The industry also uses concepts such as “effective parameters” to describe a model’s equivalent scale under limited resources. The underlying goal in all these cases is the same: to find the optimal balance between capacity and efficiency.

    3. Model Compression and Quantization: Fitting Large Models into Limited Memory

    The first hurdle in on-device deployment is simply fitting the model into available memory. Common techniques include quantization, pruning, and knowledge distillation:

    • Quantization: This reduces the precision of weights and activations from FP16 to INT8, INT4, or even lower bit widths. Memory usage can drop by several times, which makes it the most widely used technique for on-device deployment.
    • Pruning: This removes redundant neurons or attention heads to reduce structural complexity.
    • Distillation: This uses a large model to guide the training of a smaller one, retaining more capability while reducing the number of parameters.

    Take quantization as an example. A typical on-device configuration looks roughly like this (illustrative):

    1. # Illustration: on-device model quantization config (pseudocode, not a real API)
    2. quant_config = {
    3. "weight_dtype": "int4", # 4-bit weights to significantly reduce storage usage
    4. "activation_dtype": "int8", # 8-bit activations to balance accuracy and speed
    5. "group_size": 128, # Group-wise quantization granularity to mitigate accuracy loss
    6. "kv_cache_dtype": "int8", # Quantized KV cache to reduce memory use for long sequences
    7. }

    It is important to stress that more aggressive quantization is not always better. Lower bit widths save more memory and run faster, but they also cause greater accuracy loss. In practice, teams typically choose between INT4 and INT8, keep higher precision for sensitive layers, and run a small calibration set to evaluate task performance before finalizing the configuration.

    4. System-Level Agents: From Passive Q&A to Proactive Service

    The real value of on-device models lies in driving AI agents from simply answering questions to proactively providing services. An agent is a model that can not only “talk” but also “act.” After understanding the user’s intent, it invokes system capabilities to carry out real operations. The core technique is function calling / tool use: based on context, the model selects an appropriate tool and generates structured parameters, which the runtime parses and executes. For example:

    1. {
    2. "tool": "add_calendar_event",
    3. "parameters": { "title": "Product review meeting", "time": "2026-09-24T10:00:00" }
    4. }

    A system-level agent framework (often called an Agent Core or Agent Runtime) typically has four responsibilities:

    • Intent understanding
    • Tool orchestration
    • Execution scheduling
    • Result write-back

    The framework needs to package LLM capabilities into stable, controllable, and auditable service interfaces that local apps can call uniformly. These apps include the calendar, messaging, gallery, and settings. The engineering focus is on permission boundaries and rollback mechanisms. Every tool call should be restricted by the principle of least privilege, and sensitive operations should provide paths for confirmation or undo.

    5. On-Device/Cloud Collaboration: Dividing Work Between Local Inference and Cloud LLMs

    On-device inference alone cannot cover every need, while cloud-only inference is limited by latency and privacy concerns. A mature solution is layered orchestration across device and cloud:

    • Local first: Simple, real-time, or privacy-sensitive tasks are handled directly by the on-device model.
    • Cloud fallback / enhancement: Tasks involving complex reasoning, long contexts, or cross-domain knowledge are offloaded to the cloud.
    • Cascading and routing: A lightweight classifier assesses task complexity and decides whether to handle the task locally or in the cloud, balancing user experience against cost.

    On the cloud side, the industry commonly uses general-purpose cloud capabilities to serve large-model inference:

    • Container platforms elastically scale inference instances.
    • Object storage hosts model files and datasets.
    • Logging services and monitoring/alerting build an observability system.

    Cloud providers such as Baidu AI Cloud also offer general cloud product categories such as containers, object storage, and logging and monitoring. These can serve as a reference when selecting cloud infrastructure for an on-device/cloud collaborative architecture.

    6. Privacy, Personalization, and On-Device Memory

    System-level vendors are increasingly building local memory apps into their products. The underlying technology is on-device personalization and retrieval augmentation (On-device RAG). User preferences, schedules, and interaction history are stored as a local vector index. At inference time, relevant snippets are retrieved and injected into the context so the model can “know the user better.” Because the data never leaves the device, privacy risk is greatly reduced.

    Engineering for this requires handling three things:

    1. Incremental updates and consistency of the local index.
    2. Isolation and authorization of data across apps.
    3. Deletion and export of memory data, so users retain full control over their own data.

    7. Engineering Practice: Evaluating On-Device Models Scientifically

    Before an on-device model ships, teams should establish a multi-dimensional evaluation baseline rather than focusing only on whether it “can answer questions”:

    • Performance metrics: Time to first token (TTFT), decode throughput (tokens/s), peak memory usage, and whole-device power consumption and heat generation.
    • Quality metrics: Task accuracy, tool-call success rate, hallucination rate, and consistency across multi-turn conversations.
    • Resource metrics: Adaptation performance and degradation strategies across different devices (different SoCs, memory tiers).
    • Security metrics: Interception rate of unauthorized calls and detection of sensitive information leakage.

    We recommend building an evaluation set that closely reflects real-world scenarios. It should cover both frequent everyday tasks and long-tail complex tasks, and it should be tested under load on physical devices. This helps avoid the situation where a model “passes in the lab but fails on a real device.”

    8. Conclusion

    From the cloud to the device, LLMs are undergoing a “downward” evolution. The technical foundation can be summarized as:

    • Tiered model selection
    • MoE sparse architecture
    • Quantization and compression
    • System-level agent orchestration
    • On-device/cloud collaboration
    • Personalized memory stored locally

    For developers, the key is not to chase ever-larger parameter counts. Instead, it is to deliver “sufficient capability” at “low enough cost,” reliably and consistently, within the real-world constraints of compute, memory, power, and privacy. Whoever refines this pipeline most effectively will gain an edge in the next stage of on-device intelligence.