MNN README

The project's README from github.com/alibaba/MNN. As one markdown file: README.md.

MNN

License Documentation 簡體中文版本 繁體中文版本 日本語バージョン MNN Homepage zread

MNN Chat App TaoAvatar Sana

News 🔥

History News
  • [2026/03/05] Support Qwen3.5 Series.

Icon Icon Icon

  • [2026/02/13] MNN-Sana-Edit-V2 is now available at apps, offering cartoon-style photo editing based on Sana.

Icon

  • [2025/10/16] Support Qwen3-VL Series.
  • [2025/06/11] New App MNN TaoAvatar released, you can talk with 3DAvatar offline with LLM, ASR, TTS, A2BS and NNR models all run local on your device!! MNN TaoAvatar

Icon

  • [2025/05/12] android app support qwen2.5 omni 3b and 7b MNN Chat App.

Icon Icon Icon

  • [2025/04/30] android app support qwen3 and dark mode MNN Chat App.

Icon

  • [2025/02/18] iOS multimodal LLM App is released MNN LLM iOS.

Icon

Icon

  • [2025/01/23] We released our full multimodal LLM Android App:MNN-LLM-Android. including text-to-text, image-to-text, audio-to-text, and text-to-image generation.

Icon Icon Icon Icon

Intro

MNN is a highly efficient and lightweight deep learning framework. It supports inference and training of deep learning models and has industry-leading performance for inference and training on-device. At present, MNN has been integrated into more than 30 apps of Alibaba Inc, such as Taobao, Tmall, Youku, DingTalk, Xianyu, etc., covering more than 70 usage scenarios such as live broadcast, short video capture, search recommendation, product searching by image, interactive marketing, equity distribution, security risk control. In addition, MNN is also used on embedded devices, such as IoT.

MNN-LLM is a large language model runtime solution developed based on the MNN engine. The mission of this project is to deploy LLM models locally on everyone's platforms(Mobile Phone/PC/IOT). It supports popular large language models such as Qianwen, Baichuan, Zhipu, LLAMA, and others. MNN-LLM User guide

MNN-Diffusion is a stable diffusion model runtime solution developed based on the MNN engine. The mission of this project is to deploy stable diffusion models locally on everyone's platforms. MNN-Diffusion User guide

architecture

Inside Alibaba, MNN works as the basic module of the compute container in the Walle System, the first end-to-end, general-purpose, and large-scale production system for device-cloud collaborative machine learning, which has been published in the top system conference OSDI’22. The key design principles of MNN and the extensive benchmark testing results (vs. TensorFlow, TensorFlow Lite, PyTorch, PyTorch Mobile, TVM) can be found in the OSDI paper. The scripts and instructions for benchmark testing are put in the path “/benchmark”. If MNN or the design of Walle helps your research or production use, please cite our OSDI paper as follows:

@inproceedings {proc:osdi22:walle,
    author = {Chengfei Lv and Chaoyue Niu and Renjie Gu and Xiaotang Jiang and Zhaode Wang and Bin Liu and Ziqi Wu and Qiulin Yao and Congyu Huang and Panos Huang and Tao Huang and Hui Shu and Jinde Song and Bin Zou and Peng Lan and Guohuan Xu and Fei Wu and Shaojie Tang and Fan Wu and Guihai Chen},
    title = {Walle: An {End-to-End}, {General-Purpose}, and {Large-Scale} Production System for {Device-Cloud} Collaborative Machine Learning},
    booktitle = {16th USENIX Symposium on Operating Systems Design and Implementation (OSDI 22)},
    year = {2022},
    isbn = {978-1-939133-28-1},
    address = {Carlsbad, CA},
    pages = {249--265},
    url = {https://www.usenix.org/conference/osdi22/presentation/lv},
    publisher = {USENIX Association},
    month = jul,
}

Documentation and Workbench

MNN's docs are in place in Read the docs.

You can also read docs/README to build docs's html.

MNN Workbench could be downloaded from MNN's homepage, which provides pretrained models, visualized training tools, and one-click deployment of models to devices.

Key Features

Lightweight

Versatility

High performance

Ease of use

The Architecture / Precision MNN supported is shown below:

Architecture / Precision Normal FP16 BF16 Int8
CPU Native B C B B
x86/x64-SSE4.1 A C C A
x86/x64-AVX2 S C C A
x86/x64-AVX512 S C C S
ARMv7a S S (ARMv8.2) S S
ARMv8 S S (ARMv8.2) S(ARMv8.6) S
GPU OpenCL A S C S
Vulkan A A C A
Metal A S C S
CUDA A S C A
NPU CoreML A C C C
HIAI A C C C
NNAPI B B C B
QNN C B C C

Tools

Base on MNN (Tensor compute engine), we provided a series of tools for inference, train and general computation.

How to Discuss and Get Help From the MNN Community

The group discussions are predominantly Chinese. But we welcome and will help English speakers.

Dingtalk discussion groups:

Group #4 (Available): 160170007549

Group #3 (Full)

Group #2 (Full): 23350225

Group #1 (Full): 23329087

Historical Paper

The preliminary version of MNN, as mobile inference engine and with the focus on manual optimization, has also been published in MLSys 2020. Please cite the paper, if MNN previously helped your research:

@inproceedings{alibaba2020mnn,
  author = {Jiang, Xiaotang and Wang, Huan and Chen, Yiliu and Wu, Ziqi and Wang, Lichuan and Zou, Bin and Yang, Yafeng and Cui, Zongyang and Cai, Yu and Yu, Tianhang and Lv, Chengfei and Wu, Zhihua},
  title = {MNN: A Universal and Efficient Inference Engine},
  booktitle = {MLSys},
  year = {2020}
}

License

Apache 2.0

Acknowledgement

MNN participants: Taobao Technology Department, Search Engineering Team, DAMO Team, Youku and other Alibaba Group employees.

MNN refers to the following projects:

MNN (alibaba/MNN)

Searching Database…

16.2K ·GitHub
What is this?MNN is a lightweight, high-performance deep learning inference (and training) engine built by Alibaba, used to run models like LLMs, diffusion models, and CNNs efficiently on mobile, embedded, and edge devices.
Is this a framework I build apps on, or just a model file format?It is a full inference/training framework and toolchain: it includes a converter, the compute engine itself, compression tools, and an OpenCV-like CV library, plus ready-made LLM/Diffusion runtime layers on top.
How do I get a model running with MNN?You first convert an existing model (TensorFlow, Caffe, ONNX, or TorchScript) into MNN's format using MNN-Converter, then run it with the MNN engine via its C++ or Python API on your target device.
Do I need Python or a GPU toolkit to use it?No, MNN is designed to run with no external dependencies on-device; it optionally uses Metal, OpenCL, Vulkan, or CUDA for GPU acceleration if available, and offers a Python API for easier use.
Does every backend work equally well?No, support quality varies a lot by backend/precision: some combinations (like CPU Native FP16 or NNAPI) are marked as buggy or unoptimized ('B') or entirely unsupported ('C'), while others like ARM/AVX512 are fully optimized ('S').
Who is already using MNN in production?MNN is integrated into 30+ Alibaba apps (Taobao, Tmall, Youku, DingTalk, Xianyu) across 70+ scenarios, and is also used in IoT and other embedded devices.
What platforms and devices does it run on?MNN supports iOS 8.0+, Android 4.3+, and other embedded devices with a POSIX interface, running on CPU (x86/ARM) and GPU backends.
Not Stated In READMEApache 2.0 licensed — no stated restrictions beyond the standard permissive terms.
What is MNN-LLM and what models does it support?MNN-LLM is a runtime built on MNN for deploying large language models locally on phones, PCs, or IoT devices, supporting models like Qianwen (Qwen), Baichuan, Zhipu, LLaMA, DeepSeek-R1, and Qwen3.
Is there a ready-made app I can try instead of building from source?Yes, MNN has released Android and iOS chat apps (MNN-LLM-Android, MNN LLM iOS) with text, image, audio-to-text, and text-to-image generation, plus an MNN TaoAvatar app for offline 3D avatar conversations.
How small is MNN compared to other frameworks?It is very compact: the iOS static library is about 12MB and the Android core shared library is only about 800KB, with an optional minimal build (MNNBUILDMINI) cutting package size by another ~25%.
Why was MNN built instead of just using TensorFlow Lite or PyTorch Mobile?MNN was built for Alibaba's own device-cloud production needs and was benchmarked against TensorFlow, TensorFlow Lite, PyTorch, PyTorch Mobile, and TVM, claiming industry-leading on-device performance, as documented in its OSDI'22 paper.
Creator
alibaba
Size
357.2 MB
Stars
16.2K
Age
7y
Commits · 90 Days