Package: budgetml
BudgetML: Deploy ML models on a budgetInstallation•Quickstart•Community•DocsGive us aGitHub starto show your love!WhyBudgetML is perfect for practitioners who would like to quickly deploy their models to an endpoint, but not waste a lot of
time, money, and effort trying to figure out how to do this end-to-end.We built BudgetML because it's hard to find a simple way to get a model in productionfastandcheaply.Cloud functions are limited in memory and cost a lot at scale.Kubernetes clusters are an overkill for one single model.Deploying from scratch involves learning too many different concepts like SSL certificate generation, Docker, REST, Uvicorn/Gunicorn, backend servers etc., that are simply not within the scope of a typical data scientist.BudgetML is our answer to this challenge. It is supposed to be fast, easy, and developer-friendly. It is by no means meant to be used in a full-fledged
production-ready setup. It is simply a means to get a server up and runningas fast as possiblewith thelowest costs possible.BudgetML lets you deploy your model on aGoogle Cloud Platform preemptible instance(which is~80% cheaperthan a regular instance) with asecured HTTPS APIendpoint.
The tool sets it up in a way that the instance autostarts when it shuts down (at least once every 24 hours) withonly a few minutes of downtime.
BudgetML ensures the cheapest possible API endpoint with the lowest possible downtime.Key FeaturesAutomaticFastAPIserver endpoint generation (its faster than Flask).Fully interactive docs viaSwagger.Built-in SSL certificate generation viaLetsEncryptanddocker-swag.Uses cheap preemtible instances but has 99% uptime!Complete OAuth2 secured endpoints withPassword and Bearer pattern.Cost comparisonBudgetML uses Google Cloud Preemptible instances under-the-hood to reduce costs by 80%. This can potentially mean hundreds of dollars
worth of savings. Here is a screenshot of thee2-highmemGCP series, which is regular family of instances to be using for
memory intense tasks like ML model inference functions. See the following price comparison (as of Jan 31, 2021 [source])Even with the lowest machine_type, there is a$46/monthsavings, and with the highest configuration this is$370/monthsavings!InstallationBudgetML is available for easy installation into your environment via PyPI:pipinstallbudgetmlAlternatively, if you’re feeling brave, feel free to install the bleeding edge:NOTE:Do so on your own risk, no guarantees given!pipinstallgit+https://github.com/ebhy/budgetml.git@main--upgradeQuickstartBudgetML aims for as simple a process as possible. First set up a predictor:# predictor.pyclassPredictor:defload(self):fromtransformersimportpipelineself.model=pipeline(task="sentiment-analysis")asyncdefpredict(self,request):# We know we are going to use the `predict_dict` method, so we use# the request.payload patternreq=request.payloadreturnself.model(req["text"])[0]Then launch it with a simple script:# deploy.pyimportbudgetmlfrompredictorimportPredictor# add your GCP project name here.budgetml=budgetml.BudgetML(project='GCP_PROJECT')# launch endpointbudgetml.launch(Predictor,domain="example.com",subdomain="api",static_ip="32.32.32.322",machine_type="e2-medium",requirements=['tensorflow==2.3.0','transformers'],)For a deeper dive,check out the detailed guidein theexamplesdirectory. For
more information about the BudgetML API, refer to thedocs.ScreenshotsInteractive docs to test endpoints. Support for Images.Password-protected endpoints:Simple prediction interface:Projects using BudgetMLWe are proud that BudgetML is actively being used in the following live products:PicHanceyou-tldrZenML: For production scenariosBudgetML is for users on a budget. If you're working in a more serious production environment, then consider usingZenMLas the perfect open-source MLOPs framework for ML production needs. It does
more than just deployments, and is more suited for professional workplaces.Proudly built by two brothersWe are two brothers who love building products, especially ML-related products that make life easier for people.
If you use this tool for any of your products, we would love to hear about it and potentially add it to this space.
Please get in touchvia email.Oh and please do consider giving us a GitHub star if you like the repository - open-source is hard, and the support
keeps us going.