MNN

(โ˜… 15,940)

MNN: A blazing-fast, lightweight inference engine battle-tested by Alibaba, powering high-performance on-device LLMs and Edge AI.

Showing a partial file list โ€” download the zip above to see everything.

  • .clang-format
  • .git-blame-ignore-revs
  • .gitattributes
  • .gitignore
  • .pre-commit-config.yaml
  • .readthedocs.yaml
  • .travis.yml
  • .trivyignore
  • AGENTS.md
  • CLAUDE.md
  • CMakeLists.txt
  • CONTRIBUTING.md
  • LICENSE.txt
  • MNN.podspec
  • MNN_Render.podspec
  • README.md
  • README_CN.md
  • README_JP.md
  • README_TW.md
  • SECURITY.md

๐Ÿš€ Installation Guide

1. Get the code
git clone https://github.com/alibaba/MNN

Downloads the entire project code from GitHub to your computer.

cd MNN

Moves into the project folder you just downloaded.

2. CMake

Medium Recommended
Prerequisites
  • Git Needed to download the project code from GitHub.
  • CMake The tool used to generate build configuration.
  • C/C++ ์ปดํŒŒ์ผ๋Ÿฌ Windows needs Visual Studio (Community edition, free), macOS needs Xcode Command Line Tools, Linux needs the gcc/g++ package.
cd 3rd_party/flatbuffers

This project's files live in a subfolder, so move into it first.

mkdir build && cd build

Creates a folder to hold the build output and moves into it.

cmake ..

Analyzes the source code and generates build configuration files (must be run inside the build folder).

make

Compiles the code based on the generated build configuration to produce an executable.

โœ… Check that an executable was created inside the build folder, then run it directly (e.g. ./build/app_name).

3. Maven (Java)

Medium
Prerequisites
  • Git Needed to download the project code from GitHub.
  • JDK (Java) Required to build and run Java projects.
  • Maven The build tool used for the mvn command.
cd 3rd_party/flatbuffers/grpc/flatbuffers-java-grpc

This project's files live in a subfolder, so move into it first.

mvn clean install

Installs dependencies and builds the project using Maven.

โœ… A BUILD SUCCESS message means it worked. The output is created under target/.

4. Gradle (Java/Kotlin)

Medium
Prerequisites
  • Git Needed to download the project code from GitHub.
  • JDK (Java) Required to build and run Java/Kotlin projects.
  • Gradle If the repo includes gradlew (Gradle Wrapper), you don't need to install Gradle separately.
cd 3rd_party/flatbuffers/samples/android

This project's files live in a subfolder, so move into it first.

./gradlew build

Builds the project using Gradle.

โœ… A BUILD SUCCESSFUL message means it worked. The output is created under build/.

5. Node.js

Easy
Prerequisites
  • Git Needed to download the project code from GitHub.
  • Node.js Node.js must be installed to use npm. The LTS version is recommended.
cd 3rd_party/flatbuffers

This project's files live in a subfolder, so move into it first.

npm install

Downloads and installs the libraries listed in package.json.

npm start

Starts the development/run server.

โœ… After running the command, open the address shown in the terminal (usually something like http://localhost:3000) in your browser.

6. PHP (Composer)

Easy
Prerequisites
  • Git Needed to download the project code from GitHub.
  • PHP A PHP runtime is required.
  • Composer The package manager used to install PHP libraries.
cd 3rd_party/flatbuffers

This project's files live in a subfolder, so move into it first.

composer install

Installs the PHP libraries listed in composer.json.

โœ… Run it with a built-in server like php -S localhost:8000, then open http://localhost:8000 in your browser.
// repository documentation