We've actually used a Swagger API definition to create a REST API model that then declaratively generates the Python framework in order for us to serve that API. We just had to put in a very small amount of code in order to get it running. Then, we created a Docker container that captures not only our running code that is our service, but our pre-trained machine learning model, which then forms a package so that we are able to deploy and use our container. Finally, we used this container in order to serve and make predictions.