Skip to content
Model Server for Apache MXNet is a tool for serving neural net models for inference
Branch: master
Clone or download
vdantu and ddavydenko Update docs/
Co-Authored-By: ddavydenko <>
Latest commit 4d0611f Mar 22, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
benchmarks Fix lstm input json file. Feb 1, 2019
ci Fix buildspec.yml for missing artifacts files. Jan 25, 2019
docker Containers / Continers typo Mar 19, 2019
docs Update docs/ Mar 21, 2019
examples Fix bug #759, reset previous error in handle function. Mar 2, 2019
frontend Removing checks from backend. Backend is not standalone and frontend … Mar 15, 2019
mms Addressed PR comments Mar 15, 2019
model-archiver Bump up version to 1.0.2 Jan 30, 2019
.coveragerc Bumping up the test coverage further. Added test cases for Oct 18, 2018
.gitignore Benchmark AI fixes for config template file Oct 18, 2018
LICENSE.txt Updated CLI naming from mxnet-* to deep-* (#3) Oct 14, 2017
PyPiDescription.rst PyPi description changes Oct 31, 2018
_config.yml Set theme jekyll-theme-cayman Jun 20, 2018 Use --release parameter to build release python package. Oct 23, 2018

Model Server for Apache MXNet

ubuntu/python-2.7 ubuntu/python-3.6
Python3 Build Status Python2 Build Status

Model Server for Apache MXNet (MMS) is a flexible and easy to use tool for serving deep learning models exported from MXNet or the Open Neural Network Exchange (ONNX).

Use the MMS Server CLI, or the pre-configured Docker images, to start a service that sets up HTTP endpoints to handle model inference requests.

A quick overview and examples for both serving and packaging are provided below. Detailed documentation and examples are provided in the docs folder.

Join our slack channel to get in touch with development team, ask questions, find out what's cooking and more!

Contents of this Document

Other Relevant Documents

Quick Start


Before proceeding further with this document, make sure you have the following prerequisites.

  1. Ubuntu, CentOS, or macOS. Windows support is experimental. The following instructions will focus on Linux and macOS only.

  2. Python - MXNet model server requires python to run the workers.

  3. pip - Pip is a python package management system.

  4. Java 8 - MXNet Model Server requires Java 8 to start. You have the following options for installing Java 8:

    For Ubuntu:

    sudo apt-get install openjdk-8-jre-headless

    For CentOS:

    sudo yum install java-1.8.0-openjdk

    For macOS:

    brew tap caskroom/versions
    brew update
    brew cask install java8

Installing MXNet Model Server with pip


Step 1: Setup a Virtual Environment

We recommend installing and running MXNet Model Server in a virtual environment. It's a good practice to run and install all of the Python dependencies in virtual environments. This will provide isolation of the dependencies and ease dependency management.

One option is to use Virtualenv. This is used to create virtual Python environments. You may install and activate a virtualenv for Python 2.7 as follows:

pip install virtualenv

Then create a virtual environment:

# Assuming we want to run python2.7 in /usr/local/bin/python2.7
virtualenv -p /usr/local/bin/python2.7 /tmp/pyenv2
# Enter this virtual environment as follows
source /tmp/pyenv2/bin/activate

Refer to the Virtualenv documentation for further information.

Step 2: Install MXNet MMS won't install the MXNet engine by default. If it isn't already installed in your virtual environment, you must install one of the MXNet pip packages.

For CPU inference, mxnet-mkl is recommended. Install it as follows:

# Recommended for running MXNet Model Server on CPU hosts
pip install mxnet-mkl

For GPU inference, mxnet-cu92mkl is recommended. Install it as follows:

# Recommended for running MXNet Model Server on GPU hosts
pip install mxnet-cu92mkl

Step 3: Install or Upgrade MMS as follows:

# Install latest released version of mxnet-model-server 
pip install mxnet-model-server

To upgrade from a previous version of mxnet-model-server, please refer migration reference document.


  • A minimal version of model-archiver will be installed with MMS as dependency. See model-archiver for more options and details.
  • See the advanced installation page for more options and troubleshooting.

Serve a Model

Once installed, you can get MMS model server up and running very quickly. Try out --help to see all the CLI options available.

mxnet-model-server --help

For this quick start, we'll skip over most of the features, but be sure to take a look at the full server docs when you're ready.

Here is an easy example for serving an object classification model:

mxnet-model-server --start --models squeezenet=

With the command above executed, you have MMS running on your host, listening for inference requests. Please note, that if you specify model(s) during MMS start - it will automatically scale backend workers to the number equal to available vCPUs (if you run on CPU instance) or to the number of available GPUs (if you run on GPU instance). In case of powerful hosts with a lot of compute resoures (vCPUs or GPUs) this start up and autoscaling process might take considerable time. If you would like to minimize MMS start up time you can try to avoid registering and scaling up model during start up time and move that to a later point by using corresponding Management API calls (this allows finer grain control to how much resources are allocated for any particular model).

To test it out, you can open a new terminal window next to the one running MMS. Then you can use curl to download one of these cute pictures of a kitten and curl's -o flag will name it kitten.jpg for you. Then you will curl a POST to the MMS predict endpoint with the kitten's image.


In the example below, we provide a shortcut for these steps.

curl -O
curl -X POST -T kitten.jpg

The predict endpoint will return a prediction response in JSON. It will look something like the following result:

    "probability": 0.8582232594490051,
    "class": "n02124075 Egyptian cat"
    "probability": 0.09159987419843674,
    "class": "n02123045 tabby, tabby cat"
    "probability": 0.0374876894056797,
    "class": "n02123159 tiger cat"
    "probability": 0.006165083032101393,
    "class": "n02128385 leopard, Panthera pardus"
    "probability": 0.0031716004014015198,
    "class": "n02127052 lynx, catamount"

You will see this result in the response to your curl call to the predict endpoint, and in the server logs in the terminal window running MMS. It's also being logged locally with metrics.

Other models can be downloaded from the model zoo, so try out some of those as well.

Now you've seen how easy it can be to serve a deep learning model with MMS! Would you like to know more?

Stopping the running model server

To stop the current running model-server instance, run the following command:

$ mxnet-model-server --stop

You would see output specifying that mxnet-model-server has stopped.

Create a Model Archive

MMS enables you to package up all of your model artifacts into a single model archive. This makes it easy to share and deploy your models. To package a model, check out model archiver documentation

Recommended production deployments

  • MMS doesn't provide authentication. You have to have your own authentication proxy in front of MMS.
  • MMS doesn't provide throttling, it's vulnerable to DDoS attack. It's recommended to running MMS behind a firewall.
  • MMS only allows localhost access by default, see Network configuration for detail.
  • SSL is not enabled by default, see Enable SSL for detail.
  • MMS use a file to configure MMS's behavior, see Manage MMS page for detail of how to configure MMS.
  • For better security, we recommend running MMS inside docker container. This project includes Dockerfiles to build containers recommended for production deployments. These containers demonstrate how to customize your own production MMS deployment. The basic usage can be found on the Docker readme.

Other Features

Browse over to the Docs readme for the full index of documentation. This includes more examples, how to customize the API service, API endpoint details, and more.

External demos powered by MMS

Here are some example demos of deep learning applications, powered by MMS:

Product Review Classification demo4 Visual Search demo1
Facial Emotion Recognition demo2 Neural Style Transfer demo3


We welcome all contributions!

To file a bug or request a feature, please file a GitHub issue. Pull requests are welcome.

You can’t perform that action at this time.