--- id: mnn version: "3.6.1" license: BSD-3 license_treatment: permissive maintenance: active --- # mnn — C methods for MNN Package License: permissive · Maintenance: active · Downloads: 210.4K/mo ## What it is and what it does MNN is a production-grade deep learning framework designed for efficient on-device inference and training. It abstracts away the complexity of deploying neural networks across heterogeneous hardware—CPUs (ARM, x86/x64), GPUs (Metal, OpenCL, Vulkan, CUDA), and NPUs (CoreML, HIAI, NNAPI)—while keeping binary size small (12MB on iOS, 800KB on Android core). The framework supports model conversion from TensorFlow, Caffe, ONNX, and TorchScript, and includes graph optimization, quantization (FP16, Int8), and a lightweight image processing library. It powers inference in over 30 Alibaba applications across live broadcast, video capture, search, and recommendation systems. Developers use MNN to deploy trained models locally on mobile phones, IoT devices, and edge servers without cloud dependencies. The Python API provides a high-level interface for inference, training, and image processing without requiring C++ knowledge. MNN also includes specialized runtimes: MNN-LLM for large language models (supporting Qianwen, Baichuan, LLAMA) and MNN-Diffusion for stable diffusion models, both designed to run entirely on-device. Use it for: - Deploy trained deep learning models to iOS and Android apps for real-time inference without cloud calls. - Run large language models (Qianwen, Baichuan, LLAMA) locally on mobile devices and edge servers. - Optimize and quantize neural networks to reduce model size by 50–70% for memory-constrained devices. - Build computer vision pipelines (image classification, object detection) on embedded IoT devices. - Generate images using stable diffusion models entirely on-device without external APIs. - Accelerate inference on Qualcomm Hexagon DSPs using the new Hexagon backend for power-efficient processing. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. MNN is a lightweight deep learning inference and training framework that runs neural network models efficiently on mobile devices, embedded systems, and servers with support for multiple hardware backends including CPU, GPU, and NPU. Yes. MNN is a mature, actively maintained framework (latest release 23 days old, 15881 GitHub stars) with permissive BSD-3 licensing and zero known vulnerabilities. It solves a real problem—efficient on-device neural network inference—with proven production use across 30+ Alibaba applications. The single numpy dependency and broad platform support (Python 3.8–3.14, macOS/Linux/Windows) make installation straightforward. Install if you need to deploy models to mobile, embedded, or resource-constrained environments. ## Install pip install mnn uv add mnn poetry add mnn ## Installing mnn Before you install: Medium install friction due to precompiled wheels for multiple Python versions (3.8–3.14) and platforms (macOS, Linux, Windows). Active maintenance with a recent release (23 days old) and strong repository activity (15881 stars, last commit 2026-08-14). Single runtime dependency on numpy keeps the footprint lean. License in practice: BSD-3 permissive license allows commercial and private use with minimal restrictions, making it suitable for proprietary applications and production deployments. Quickstart: import mnn import numpy as np # Load and run inference on a model interpreter = mnn.Interpreter('model.mnn') session = interpreter.createSession() output = interpreter.runSession(session) Requires a pre-converted MNN model file (.mnn format); models must be converted from TensorFlow, Caffe, ONNX, or TorchScript using MNN-Converter before inference. Verify before relying: - Specific performance benchmarks comparing MNN to TensorFlow Lite, PyTorch Mobile, and TVM on representative models. - Quantization support details for FP16, BF16, and Int8 across all supported architectures and backends. - Availability and maturity of the Hexagon backend (released 2026-07-22) on real Qualcomm devices. - Python API coverage for training workflows versus inference-only capabilities. ## Package facts - License: BSD-3 (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 210.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags neural network inference framework, mobile deep learning engine, lightweight model deployment, on-device AI runtime, cross-platform ML inference, edge computing neural networks, model optimization and quantization, on-device-inference, model-optimization, edge-computing [View on SkillFed](https://skillfed.io/packages/mnn) · [View on PyPI](https://pypi.org/project/mnn/)