SuperAPIAI Directory

MNN

github.com · AI developer platforms

A Device-Inference framework, including LLM Inference on device(Mobile Phone/PC/IOT)

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsiOS · Android

About this tool

MNN is an efficient, lightweight deep learning framework open-sourced by Alibaba. It supports inference and training of deep learning models and has industry-leading performance in on-device (device-side) inference and training. It involves Alibaba teams such as the Taobao Technology Department, the Search Engineering Team, DAMO Academy, and Youku, and has been integrated into more than 30 Alibaba applications such as Taobao, Tmall, Youku, DingTalk, and Xianyu, covering more than 70 usage scenarios including live streaming, short video capture, search and recommendation, image-based product search, interactive marketing, benefit distribution, and security risk control. It is also used in embedded devices such as IoT.

Purpose and Positioning MNN is positioned as an on-device inference engine, aimed at deployment on mobile devices and various embedded devices. Within Alibaba, MNN serves as a foundational module of the Walle system's computing container. Walle is the first large-scale general-purpose production system for device-cloud collaborative machine learning, and the related results were published at the systems conference OSDI'22. An initial version of MNN, as a mobile inference engine oriented toward manual optimization, was also published at MLSys 2020.

Main Capabilities

  1. Lightweight and dependency-free: optimized for devices, with no third-party dependencies, and can be conveniently deployed to mobile devices and various embedded devices. On the iOS platform, with all options for armv7+arm64, the static library size is about 12MB, and the incremental size of the linked executable is about 2MB; on the Android platform, the core so size is about 800KB (armv7a - c++_shared). Using MNN_BUILD_MINI can further reduce the size by about 25% (limited to fixed model input dimensions).
  2. Quantization support: supports FP16 / Int8 quantization, which can reduce model size by 50%-70%.
  3. Model format and network support: supports Tensorflow, Caffe, ONNX, and Torchscripts, and supports common networks such as CNN, RNN, GAN, and Transformer. The converter supports 178 Tensorflow OPs, 52 Caffe OPs, 163 Torchscripts OPs, and 158 ONNX OPs. It supports multiple inputs and multiple outputs, various dimension formats, dynamic inputs, and control flow (Controlflow).
  4. Platform and hardware support: supports iOS 8.0+, Android 4.3+, and embedded devices with POSIX interfaces. It supports multi-device hybrid computing and currently supports CPU and GPU. On the CPU side, a large amount of optimized assembly code is used to fully utilize ARM / x64; Mobile GPU inference uses Metal / OpenCL / Vulkan; NVIDIA GPU uses CUDA and tensorcore to improve performance.
  5. High-performance operators: Convolution and transposed convolution algorithms are efficient and stable, and the Winograd convolution algorithm is widely used for symmetric convolutions such as 3x3, 4x4, 5x5, 6x6, 7x7, etc. The new ARM v8.2 architecture can achieve twice the speed under FP16 half-precision computation, and using sdot (ARM v8.2) and VNNI can make it 2.5 times faster again.
  6. General computing and image processing: Supports numpy-like numerical computation using MNN's OP; provides a lightweight image processing module similar to OpenCV, with a size of only about 100k; supports building and training models on PC / mobile.
  7. Python API: The MNN Python API makes it convenient for machine learning engineers to perform inference, training, and image processing without writing C++ code.

Supporting toolchain (based on the MNN tensor computing engine)

  • MNN-Converter: Converts other models such as Tensorflow(lite), Caffe, ONNX, Torchscripts, etc. into MNN models for inference, and performs graph optimization to reduce computation.
  • MNN-Compress: Compresses models, reduces size, and improves performance and speed.
  • MNN-Express: Supports models with control flow and uses MNN's OP for general computing.
  • MNN-CV: An OpenCV-like library that is more lightweight because it is based on MNN.
  • MNN-Train: Supports training MNN models.

MNN-LLM and MNN-Diffusion MNN-LLM is a large language model runtime solution developed based on the MNN engine. Its goal is to deploy LLM models locally on everyone's platform (mobile / PC / IoT), supports popular large language models such as Tongyi Qianwen, Baichuan, Zhipu, LLAMA, etc., and provides a user guide. MNN-Diffusion is a Stable Diffusion model runtime solution developed based on the MNN engine. Its goal is to deploy Stable Diffusion models locally on various platforms and provide a user guide.

Version and application progress (excerpted from the official repository update records) 2026/07/22: MNN 3.6.1 released, adding Hexagon backend, which can accelerate model inference on Qualcomm Hexagon DSP. 2026/03/05: Support for the Qwen3.5 series. 2026/02/13: MNN-Sana-Edit-V2 is provided in apps, offering cartoon-style photo editing based on Sana. 2025/10/16: Support for the Qwen3-VL series. 2025/06/11: New application MNN TaoAvatar released, enabling offline conversations with a 3D Avatar, with the LLM, ASR, TTS, A2BS, and NNR models all running locally on the device. 2025/05/12: The Android app supports qwen2.5 omni 3b and 7b (MNN Chat App). 2025/04/30: The Android app supports qwen3 and dark mode (MNN Chat App). 2025/02/18: iOS multimodal LLM application released (MNN LLM iOS). 2025/02/11: The Android app supports deepseek r1 1.5b. 2025/01/23: Released the complete multimodal LLM Android application MNN-LLM-Android, including text-to-text, image-to-text, audio-to-text, and text-to-image generation.

Documentation and Workbench MNN documentation is hosted on Read the docs, and you can also read docs/README to build the documentation HTML. MNN Workbench can be downloaded from the MNN homepage and provides pretrained models, visual training tools, and the ability to deploy models to devices with one click.

Usage and applicable scenarios Developers can use MNN-Converter to convert existing models into MNN format, combine it with MNN-Compress for compression, MNN-Train for training, and MNN-CV for image processing; use the MNN Python API for inference and training; and use MNN-LLM and MNN-Diffusion to deploy large language models and diffusion models on the edge. The code and repository address are https://github.com/alibaba/MNN。适用场景包括移动端与嵌入式设备上的高性能推理、端侧大模型部署、端云协同机器学习、图像与多模态应用,以及 AI inference on IoT devices.

Community and Help The community discussions are primarily in Chinese, but English speakers are also welcome and will be helped. DingTalk discussion groups: Group #4 (available) 160170007549; Group #3 (full); Group #2 (full) 23350225; Group #1 (full) 23329087.

Limitations and Notes The architectures and precisions supported by MNN are subject to the annotations in the official table (S means supported and performs well, deeply optimized, recommended for use; A means supported and performs well, usable; B means supported but has bugs or is not optimized, not recommended for use). Some information (such as specific charges, prices, etc.) is not yet available in the provided materials.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools