Anaconda Enterprise enables you to deploy your machine learning or predictive models as a REST API endpoint. You can then share your deployment with colleagues and have them query your model as you continue to update, improve, and redeploy as needed.There are many tools available in the open-source market for building REST APIs within the Python ecosystem. This topic explains how to generate a REST API endpoint from a python function you’ve created within a Jupyter Notebook.
REST API endpoints deployed using Anaconda Enterprise are secure and only
accessible to users that you’ve shared the deployment with or users that have
generated a token that can be used to query the REST API endpoint outside of
Anaconda Enterprise.
Decorated functions are identified by the Tranquilizer server. These functions are executed when HTTP requests are made to the server.Here is an example of a temperature conversion function with the tranquilizer decoration:
When the Tranquilizer server starts, the entire Jupyter Notebook is executed.
Consider carefully how you arrange operations that are heavy on CPU or memory
usage, like reading data or loading models. Computations for reusable objects
should be performed only once, rather than every time the function is called.
With tranquilizer downloaded and your function decorated, you must now prepare the deployment command. Open your anaconda-project.yml file and add the following code: