Skip to main content

Whitebox - E2E machine learning monitoring

Whitebox

Whitebox is an open source E2E ML monitoring platform with edge capabilities that plays nicely with kubernetes


Documentation: https://whitebox-ai.github.io/whitebox

Source Code: https://github.com/whitebox-ai/whitebox

Roadmap: https://github.com/whitebox-ai/whitebox/milestones

Issue tracking https://github.com/orgs/whitebox-ai/projects/1/views/3

Discord: https://discord.gg/bkAcsx4V


Whitebox is an open source E2E ML monitoring platform with edge capabilities that plays nicely with kubernetes.

The key features are:

  • Classification models metrics
  • Regression models metrics
  • Data / model drift monitoring
  • Alerts

Design 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.

Installation

Install the server using docker compose. See the docs for more info.

Install the SDK with pip:

pip install whitebox-sdk

How to use

After 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:

from whitebox import Whitebox

wb = Whitebox(host="127.0.0.1:8000", api_key="some_api_key")

Now you're ready to start using Whitebox! Read the documentation to learn more about the SDK.

Set up locally for development

Whitebox 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 the DATABASE_URL environment 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 the DATABASE_URL environment variable to the database URL.

Install packages:

python -m venv .venv
pip install -r requirements.txt
pre-commit install

Run the server:

ENV=dev uvicorn whitebox.main:app --reload

Quick way to start a postgres database:

docker compose up postgres -d

Tests:

  • Run: ENV=test pytest or ENV=test pytest -s to preserve logs.
  • Watch: ENV=test ptw
  • Run test coverage ENV=test coverage run -m pytest
  • Look at coverage report: coverage report or coverage html to generate an html. To view it in your browser open the htmlcov/index.html file.

Docs

Documentation is hosted bby GitHub here: https://whitebox-ai.github.io/whitebox

mkdocs serve -f docs/mkdocs/mkdocs.yml -a localhost:8001

Deploy Whitebox

Using docker

Whitebox uses postgres as its database. They need to run in the same docker network. An example docker-compose file is located in the examples folder. Make sure you replace the SECRET_KEY with one of your own. Look below for more info.

docker-compose -f examples/docker-compose/docker-compose.yml up

If you just need to run Whitebox, make sure you set the DATABASE_URL in the environment.

docker run -dp 8000:8000 sqdhub/whitebox:main -e DATABASE_URL=postgresql://user:password@host:port/db_name

To 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=$(docker exec <postgres_container_id> /bin/sh -c "psql -U postgres -c \"SELECT api_key FROM users WHERE username='admin';\" -tA")

echo $API_KEY

If you've set the SECRET_KEY in the environment get the decrypted key using:

docker exec <whitebox_container_id> /usr/local/bin/python scripts/decrypt_api_key.py $API_KEY

Using Helm

You can also install Whitebox server and all of its dependencies in your k8s cluster using helm

helm repo add squaredev https://chartmuseum.squaredev.io/
helm repo update
helm install whitebox squaredev/whitebox

Contributing

We happily welcome contributions to Whitebox. You can start by opening a new issue!

Metadata

Release files for whitebox-sdk 0.0.20

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for whitebox-sdk 0.0.20
File Size Uploaded Provenance Actions
whitebox-sdk-0.0.20.tar.gz 35.5 kB Without provenance Details for whitebox-sdk-0.0.20.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for whitebox-sdk 0.0.20
File Interpreter ABI Platform Actions
whitebox_sdk-0.0.20-py3-none-any.whl Python 3 none any Details for whitebox_sdk-0.0.20-py3-none-any.whl

Total release size: 93.2 kB

Release files / whitebox-sdk-0.0.20.tar.gz

Download URL whitebox-sdk-0.0.20.tar.gz
Size 35.5 kB
Tags Source
SHA-256 checksum
How to use checksums
49b5d7687d6eb3a8e29ff7b805b41a1387e3b7049f19fcd91a0aea16ca91559d
BLAKE2b-256 checksum
How to use checksums
7e2c047341dfebb6e13cfa85ee10bc8dec0ed05304b3b78268f46c23e97c9926
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release files / whitebox_sdk-0.0.20-py3-none-any.whl

Download URL whitebox_sdk-0.0.20-py3-none-any.whl
Size 57.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bc7188521900de10c4c073660fe6c8eca4bb50ffc8299287af24e6a37d4a20c2
BLAKE2b-256 checksum
How to use checksums
d66bc374c69336e78d28860836edcea116b2edf37be00fb9b50b299bd4bcbfc7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Security for whitebox-sdk 0.0.20

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page