Package: whitebox-sdk
Whitebox - E2E machine learning monitoringWhitebox is an open source E2E ML monitoring platform with edge capabilities that plays nicely with kubernetesDocumentation:https://whitebox-ai.github.io/whiteboxSource Code:https://github.com/whitebox-ai/whiteboxRoadmap:https://github.com/whitebox-ai/whitebox/milestonesIssue trackinghttps://github.com/orgs/whitebox-ai/projects/1/views/3Discord:https://discord.gg/bkAcsx4VWhitebox is an open source E2E ML monitoring platform with edge capabilities that plays nicely with kubernetes.The key features are:Classification models metricsRegression models metricsData / model drift monitoringAlertsDesign guidelines:Easy: Very easy to set up and get started with.Intuitive: Designed to be intuitive and easy to use.Pythonic SDK: Pythonic SDK for building your own monitoring infrastructure.Robust: Get production-ready MLOps system.Kubernetes: Get production-ready code. With automatic interactive documentation.InstallationInstall the server usingdocker compose. See thedocsfor more info.Install the SDK withpip:pipinstallwhitebox-sdkHow to useAfter you are done installing the server and the SDK, you can start using it.After you get the API key, all you have to do is create an instance of the Whitebox class adding your host and API key as parameters:fromwhiteboximportWhiteboxwb=Whitebox(host="127.0.0.1:8000",api_key="some_api_key")Now you're ready to start using Whitebox! Read thedocumentationto learn more about the SDK.Set up locally for developmentWhitebox supports Postgres and SQLite. You can use either one of them.
If you want to use SQLite, you need to set up a SQLite database and set theDATABASE_URLenvironment variable to the database URL.
If you want to use Postgres, you don't need to do anything. Just have a Postgres database running and set theDATABASE_URLenvironment variable to the database URL.Install packages:python-mvenv.venv
pipinstall-rrequirements.txt
pre-commitinstallRun the server:ENV=devuvicornwhitebox.main:app--reloadQuick way to start a postgres database:dockercomposeuppostgres-dTests:Run:ENV=test pytestorENV=test pytest -sto preserve logs.Watch:ENV=test ptwRun test coverageENV=test coverage run -m pytestLook at coverage report:coverage reportorcoverage htmlto generate an html. To view it in your browser open thehtmlcov/index.htmlfile.DocsDocumentation is hosted bby GitHub here:https://whitebox-ai.github.io/whiteboxmkdocs serve -f docs/mkdocs/mkdocs.yml -a localhost:8001Deploy WhiteboxUsing dockerWhitebox uses postgres as its database. They need to run in the same docker network. An example docker-compose file is located in theexamplesfolder. Make sure you replace the SECRET_KEY with one of your own. Look below for more info.docker-compose-fexamples/docker-compose/docker-compose.ymlupIf you just need to run Whitebox, make sure you set theDATABASE_URLin the environment.dockerrun-dp8000:8000sqdhub/whitebox:main-eDATABASE_URL=postgresql://user:password@host:port/db_nameTo save the api key encrypted in the database, provide a SECRET_KEY variable in the environment that is consisted of a 16 bytes string.python-c"from secrets import token_hex; print(token_hex(16))"Save this token somewhere safe.The api key can be retrieved directly from the postgres database:API_KEY=$(dockerexec<postgres_container_id>/bin/sh-c"psql -U postgres -c \"SELECT api_key FROM users WHERE username='admin';\" -tA")echo$API_KEYIf you've set theSECRET_KEYin the environment get the decrypted key using:dockerexec<whitebox_container_id>/usr/local/bin/pythonscripts/decrypt_api_key.py$API_KEYUsing HelmYou can also install Whitebox server and all of its dependencies in your k8s cluster usinghelmhelmrepoaddsquaredevhttps://chartmuseum.squaredev.io/
helmrepoupdate
helminstallwhiteboxsquaredev/whiteboxContributingWe happily welcome contributions to Whitebox. You can start by opening a new issue!