Skip to main content

3. Deploy Your Model

Now, you are ready to deploy your model to Modelify. Firstly, you need create a application from Modelify Cloud . To do so, you must first establish an account. It is very simple to create an account, and no need credit card.

After logging in to the platform, use the right menu to create an application. The application will appear on your home page after it has been created. Click this application, you will have seen 2 information;

  • Connection Api Key
  • APP UID

Firstly, link your Modelify Cloud account with your connection api key.

import modelify

modelify.connect("YOUR_API_KEY")

After connection established, you are able to deploy your model with your APP UID and model inference object.


modelify.deploy(inference, app_uid="YOUR_APP_UID")

Final code would be as follows;

import pandas as pd
from sklearn.datasets import load_iris
from lightgbm import LGBMClassifier, Dataset, train as train_lgbm
import modelify
from modelify import ModelInference
from modelify.helpers import create_schema

# import data
iris = load_iris()
df= pd.DataFrame(data= np.c_[iris['data'], iris['target']],
columns= iris['feature_names'] + ['target'])

# train test split
train, test = train_test_split(df, test_size=0.2 )
y_train = df["target"]
X_train = df.drop(columns=["target"])

# build your model
clr = LGBMClassifier()
clr.fit(X_train, y_train)

# deployment
inference = ModelInference(model=model, framework="LIGHTGBM", inputs=create_schema(X_train))

modelify.connect("YOUR_API_KEY")

modelify.deploy(inference, app_uid="YOUR_APP_UID")

Finally, refresh your application page on Modelify Cloud. After making the settings of the serverless API you will create according to your needs, click the "Deploy Application" button. Your service will be ready in 1-2 minutes on average.

What's next?