Package: airdot
🚀 Airdot DeployerDeploy your ML models inminutes, notweeks.Detailed documentation can be foundhereAirdot Deployer will automatically:Restructure your Python code (from Jupyter Notebook/local IDEs) into modules.Builds a REST API around your code.Conterize the app.Spins up the required hardware (local or K8s or cloud).Monitors for model/data drift and performance (in development)Take your ML model from Local to Production with one-line of codefromairdot.deployerimportDeployerdeployer_obj=Deployer().run(<your-ml-predictor>)Once deployed, your model will be up and running on the intra/internet, accessible to your users. No more worrying about complex server setups or manual configuration. Airdot Deployer does all the heavy lifting for you.curl-XPOST<url>-H'Content-Type: application/json'-d'{"args": "some-value"}'Whether you're a data scientist, developer, or tech enthusiast, Airdot Deployer empowers you to showcase your machine learning prowess and share your creations effortlessly.What does Airdot Deployer supports ?Local Deployment with DockerK8s Deployment with seldon coreWant to try Airdot ? follow setup instructions📋 Setup InstructionsBefore we get started, you'll need to have Docker, Docker Compose, and s2i installed on your machine. If you don't have these installed yet, no worries! Follow the steps below to get them set up:Docker InstallPlease visit the appropriate links to install Docker on your machine:For macOS, visithereFor Windows, visithereFor Linux, visithereS2I installFor Mac
You can either follow the installation instructions for Linux (and use the darwin-amd64 link) or you can just install source-to-image with Homebrew:$ brew install source-to-imageFor Linux just run following commandcurl-shttps://api.github.com/repos/openshift/source-to-image/releases/latest|grepbrowser_download_url|greplinux-amd64|cut-d'"'-f4|wget-qi-For Windows please follow instructionhere💻 Airdot Deployer InstallationInstall the Airdot Deployer package using pip:pipinstall"git+https://github.com/airdot-io/airdot-deployer.git@main#egg=airdot"orpipinstallairdot🎯 Let's try outLocal DeploymentsRun following in terminal to setup minio and redis on your machinedockernetworkcreateminio-network&&wgethttps://raw.githubusercontent.com/airdot-io/airdot-deployer/main/docker-compose.yaml&&docker-compose-pairdotupTrain your modelfromsklearn.model_selectionimporttrain_test_splitfromsklearn.linear_modelimportLogisticRegressionfromairdot.deployerimportDeployerfromsklearnimportdatasetsimportpandasaspdimportnumpyasnpiris=datasets.load_iris()iris=pd.DataFrame(data=np.c_[iris['data'],iris['target']],columns=iris['feature_names']+['target'])X=iris.drop(['target'],axis=1)X=X.to_numpy()[:,(2,3)]y=iris['target']X_train,X_test,y_train,y_test=train_test_split(X,y,test_size=0.5,random_state=42)log_reg=LogisticRegression()log_reg.fit(X_train,y_train)Test your modeldefpredict(value):returnlog_reg.predict(value)Deploy in one step 🤯deployer_obj=Deployer().run(predict)Use your deployed Modelcurl-XPOSThttp://127.0.0.1:8000-H'Content-Type: application/json'-d'{"value": [[4.7, 1.2]]}'Want to stop your deploymentdeployer.stop('predict')# to stop containerDeployment on k8s using seldon-core deploymentNote - This method will use your current cluster and uses seldon-core to deployfromairdotimportDeployerimportpandasaspd# this is using default seldon-deployment configuration.config={'deployment_type':'seldon','bucket_type':'minio','image_uri':'<registry>/get_value_data:latest'}deployer=Deployer(deployment_configuration=config)df2=pd.DataFrame(data=[[10,20],[10,40]],columns=['1','2'])defget_value_data(cl_idx='1'):returndf2[cl_idx].values.tolist()deployer.run(get_value_data)you can also deploy using seldon custom configurationfromairdotimportDeployerimportpandasaspd# this is using default seldon-deployment configuration.config={'deployment_type':'seldon','bucket_type':'minio','image_uri':'<registry>/get_value_data:latest','seldon_configuration':''# your custom seldon configuration}deployer=Deployer(deployment_configuration=config)df2=pd.DataFrame(data=[[10,20],[10,40]],columns=['1','2'])defget_value_data(cl_idx='1'):returndf2[cl_idx].values.tolist()deployer.run(get_value_data)