Published: May 20, 2026
On-Device LLM Deployment Guide: MiMo INT4 Quantization & Optimization
Deploying large language models on edge devices is a core differentiator of the MiMo family. While most model developers treat on-device deployment as an afterthought β quantize and hope it works β MiMo was designed for edge from the ground up. This guide walks through the practical techniques, tools, and architectures for deploying MiMo-7B on phones, smart speakers, and car cockpits.
Why Deploy on Device?
Three driving factors make on-device deployment attractive for AI applications:
- Latency: Local inference eliminates network round-trips. First-token latency drops from 500ms+ (cloud) to under 200ms (on-device).
- Privacy: Data never leaves the device. No cloud storage, no transmission, no third-party processing.
- Offline capability: Models work without internet connectivity β critical for automotive, mobile, and IoT use cases.
Step 1: Model Selection
For on-device deployment, MiMo-7B is the recommended starting point. At 7B parameters, it fits within the memory constraints of modern mobile hardware after quantization. MiMo-V2-Flash (309B total, 15B active) is deployable on edge servers with GPU acceleration but is too large for phones or smart speakers.
Step 2: INT4 Quantization
INT4 weight-only quantization reduces model size by approximately 4Γ with minimal accuracy impact. MiMo-7B in FP16 requires ~14GB of memory; INT4 brings this down to ~3.5GB β deployable on flagship phone hardware.
# Install quantization toolkit
pip install mimo-quant
# Quantize MiMo-7B to INT4
mimo-quant quantize \
--model XiaomiMiMo/MiMo-7B-Instruct \
--output ./miMo-7b-int4 \
--bits 4 \
--group-size 128
The quantization process takes approximately 30 minutes on an A100 and produces a model that retains 98-99% of the original FP16 accuracy on reasoning benchmarks.
Step 3: TransAct Pruning
TransAct is a pruning method developed by Xiaomi AI Lab that removes redundant transformer activations. Unlike weight pruning (which removes parameters), TransAct removes redundant computations during inference, reducing latency by 15-25% without fine-tuning.
# Apply TransAct pruning (no training required)
mimo-quant prune \
--model ./miMo-7b-int4 \
--sparsity 0.2 \
--method transact
TransAct works by analyzing activation patterns across a calibration dataset (100-500 samples) and marking attention heads and feed-forward neurons that contribute minimally to output quality. These are skipped during inference via a learned mask.
Step 4: Hardware Acceleration
Xiaomi's NPU (Neural Processing Unit) provides dedicated hardware for Transformer inference:
- 15 TOPS (INT8) through a systolic array architecture
- Dedicated attention engine that computes QK^T and PV in hardware
- On-chip SRAM to minimize DRAM bandwidth bottlenecks
For non-Xiaomi hardware, the recommended path is ONNX Runtime with the following backend priority:
- CoreML (Apple devices) β best performance on iPhone/iPad
- QNN (Qualcomm devices) β Hexagon DSP acceleration on Snapdragon
- XNNPACK (ARM CPUs) β fallback that works everywhere
Step 5: Hybrid Edge-Cloud Architecture
For production deployments, a hybrid architecture is recommended:
- Local (on-device) inference: MiMo-7B INT4 handles simple Q&A, text classification, code completion, and wake-word responses.
- Edge proxy: For complex queries, the device sends a lightweight embedding to a local edge server (e.g., a Raspberry Pi 5 with a Coral TPU or a Xiaomi smart speaker with NPU).
- Cloud fallback: Multi-turn reasoning and tasks requiring V2-Flash/V2.5-Pro route to the cloud API.
The routing decision is made by a ~30M parameter classifier running on-device. In practice, this achieves:
- ~80% of queries resolve locally in under 100ms
- ~15% resolve via edge proxy in 200-400ms
- ~5% require cloud in 500ms-2s
Performance Benchmarks
| Device | Chip | Format | First Token | Memory |
|---|---|---|---|---|
| Xiaomi 16 Pro | Snapdragon 8 Gen 4 | INT4 | ~180ms | 3.5 GB |
| iPhone 17 Pro | A19 | INT4 (CoreML) | ~160ms | 3.2 GB |
| Xiaomi Speaker Pro | Xiaomi NPU v2 | INT4 | ~320ms | 2.8 GB |
| Raspberry Pi 5 + Coral TPU | ARM + Edge TPU | INT8 | ~1.2s | 3.8 GB |
Practical Tips
- Start with MiMo-7B INT4; only move to V2-Flash on edge servers if your use case requires higher reasoning capability
- Profile memory first β mobile GPUs share memory with the system, so allocate conservatively
- Use the calibration dataset from your target domain; generic calibration works but domain-specific calibration preserves more accuracy
- Consider speculative decoding (via MiMo's MTP heads) for additional 2Γ latency improvement on capable hardware