The DEEPaaS API enables a user friendly interaction with the underlying Deep Learning modules and can be used both for training models and doing inference with services.
For a detailed up-to-date documentation please refer to the official DEEPaaS documentation.
Integrate your model with the API¶
To make your Deep Learning model compatible with the DEEPaaS API you have to:
1. Define the API methods for your model¶
Create a Python file (named for example
deep_api.py) inside your package. In this file you can define any of the
You don’t need to define all the methods, just the ones you need.
Every other method will return a
NotImplementError when queried from the API.
- Enable prediction: implement
- Enable training: implement
- Enable model weights preloading: implement
- Enable model info: implement
2. Define the entrypoints to your model¶
You must define the entrypoints pointing to this file in the
setup.cfg as following:
[entry_points] deepaas.v2.model = pkg_name = pkg_name.deep_api
Here is an example of the entrypoint
definition in the
When developing a model with the DEEP Data Science template, the Python file
with the API methods will automatically be created at
pkg_name/models/deep_api.py, as well as the entrypoints
pointing to it. This path can of course be modified.