Links

Model

To deploy on Syndicai, you need to create a Model. A model is a git repository and path in that repository. Each model consist of deployments.

Preparing a model

Add syndicai.py and requirements.txt in your repository. You can add those files whenever you like unless they are in the same directory.
You can also use other methods of model preparation. Go to the Wrappers section for more details on this topic.

syndicai.py

It is the main file that is responsible for running a model. Input and output data are always sent in the form of JSON format in the payload variable.
class PythonPredictor:
def __init__(self, config):
"""
This method is required. It is called once before the API
becomes available. It performs the setup such as downloading /
initializing the model.
:param config (required): Dictionary passed from API configuration.
"""
pass
def predict(self, payload):
"""
This method is required. It is called once per request.
Preprocesses the request payload runs inference, and
post-processes the inference output.
:param payload (optional): The request payload
:returns : Prediction or a batch of predictions.
"""
response = model(payload["url"])
return response
The good practice is to load/download all additional files not placed in repo (e.g. model weights) in the __init__ method.
The input to your model can be sent in different formats such as JSONformat, andstarlette.datastructures.FormData. Go to API input types to explore each one in detail.
The output of your model (predictor method) can be returned also in three different formats such as JSON-parseable, string, and bytes objects. Explore in detail in the API response section.

reuquirements.txt

The file needed to recreate the environment for the model. It is important to give information about the exact version of the library. See the example below.
tensorflow-hub==0.9.0
tensorflow==2.3.0
torch==1.6.0
torchvision==0.7.0
xgboost==1.2.0

Adding a model

You can either import your own from an existing Git repository or use one of our sample models. You can add a model via the platform, or by using our Syndicai Deploy button. See details below.

using the platform

Log in to the Syndicai Platform, go to the Models page and click Add New Model button.
Models page with Add New Model button

using the magic button
🧙

When you go to one of our sample models e.g. Image Classifier, you will see the Syndicai Deploy button. When you click that button, it will automatically redirect you to a Platform filling the form, so that you will only have to click Add. The important note is that you need to be logged in in order to make it work!
Deploy a model with a click-of-a-button.

Editing a model

In order to edit a model go to Model Profile and click a button with three dots (next to the Deploy button).
Edit a model in the Model Profile.