Giter Site home page Giter Site logo

boxkite's Introduction

Boxkite logo

PyPI version PyPI license PyPI pyversions CI workflow codecov

{Fast, Correct, Simple} - pick three

Easily compare training and production ML data & model distributions

Goals

Boxkite is an instrumentation library designed from ground up for tracking concept drift in HA (Highly Available) model servers. It integrates well with existing DevOps tools (ie. Grafana, Prometheus, fluentd, kubeflow, etc.), and scales horizontally to multiple replicas with no code or infrastructure change.

  • Fast
    • 0.5 seconds to process 1 million data points (training)
    • Sub millisecond p99 latency (serving)
    • Supports sampling for large data sets
  • Correct
    • Aggregates histograms from multiple server replicas (using PromQL)
    • Separate counters for discrete and continuous variables (ie. categorical and numeric features)
    • Initialises serving histogram bins from training data set (based on Freedman-Diaconis rule)
    • Handles unseen data, nan, None, inf, and negative values
  • Simple
    • One metric for each counter type (no confusion over which metric to choose)
    • Default configuration supports both feature and inference monitoring (easy to setup)
    • Small set of dependencies: prometheus, numpy, and fluentd
    • Extensible metric system (support for image classification coming soon)

Some non-goals of this project are:

  • Adversarial detection

If you are interested in alternatives, please refer to our discussions in FAQ.

Getting Started

Follow one of our tutorials to easily get started and see how Boxkite works with other tools:

See Installation & User Guide for how to use Boxkite in any environment.

FAQ

  1. Does boxkite support anomaly / outlier detection?

Prometheus has supported outlier detection in time series data since 2015. Once you've setup KL divergence and K-S test metrics, outlier detection can be configured on top using alerting rules. For a detailed example, refer to this tutorial: https://prometheus.io/blog/2015/06/18/practical-anomaly-detection/.

  1. Does boxkite support adversarial detection?

Adversarial detection concerns with identifying single OOD (Out Of Distribution) samples rather than comparing whole distributions. The algorithms are also highly model specific. For these reasons, we do not have plans to support them in boxkite at the moment. As an alternative, you may look into Seldon for such capabilities https://github.com/SeldonIO/alibi-detect#adversarial-detection.

  1. Does boxkite support concept drift detection for text / NLP models?

Not yet. This is still an actively researched area that we are keeping an eye on.

  1. Does boxkite support tensorflow / pytorch?

Yes, our instrumentation library is framework agnostic. It expects input data to be a list or np.array regardless of how the model is trained.

Contributors

The following people have contributed to the original concept and code

A full list of contributors, which includes individuals that have contributed entries, can be found here.

Shameless plug

Boxkite is a project from BasisAI, who offer an MLOps Platform called Bedrock.

Bedrock helps data scientists own the end-to-end deployment of machine learning workflows. Boxkite was originally part of the Bedrock client library, but we've spun it out into an open source project so that it's useful for everyone!

boxkite's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

boxkite's Issues

Publish to PyPI

  • Publish as boxkite
  • Add basisai as a collaborator/owner on the PyPI project

Documentation updates

  • replace references to bdrk with boxkite in the readme
  • move reference to Bedrock at the top to a "this project is from" section at the bottom

plan to get boxkite ready for mass adoption

Boxkite can be a useful tool on its own for sophisticated users, but to get mass adoption we will be more successful if we can show boxkite working well as part of a well-established ecosystem of open source tools. In particular, we want to show somewhat complete "sections" of the MLOps lifecycle with popular MLOps stacks. This will both help existing users of those tools see rapidly how these things can fit together (by following a quick tutorial that shows end-to-end working examples), as well as less mature users looking for complete solutions to be able to "copy and paste" our stack to start using it rapidly.

It's important that the stacks we present are both useful, rapid tutorial stacks as well as being reasonably production-ready.

Additionally, a website showing the value prop clearly and a documentation site with clear and easy to follow tutorials, both with high production value, will help significantly to make the tool appear mature and trustworthy.

I propose that we start with one "best of breed" stack as developing one full example is probably better than several half-baked ones.

Stack to develop

Kubeflow (notebooks + pipelines + Seldon core) + MLflow + Boxkite + Prometheus + Grafana

Deployment modes: local k8s cluster (e.g. minikube), and AWS.
Output format: terraform (targeting either an existing-cluster, or AWS with EKS). This makes it easy to reliably spin up the stack both for testing or targeting AWS for production.

User journey:

  • User deploys demo stack using terraform locally or against AWS
  • User trains model in a Kubeflow notebook and/or pipeline, using boxkite sdk
  • They push the model to MLflow model registry, including the boxkite generated prometheus histogram as an MLflow artifact
  • They deploy the model from MLflow to Seldon core, and run a script which sends some inferences against it (the script should send requests with varying distribution over a short timescale, so it demos well)
  • They load the Grafana dashboard and are able to live-visualize the changing model drift, and see how they can set alerts against it using Prom alertmanager

Other stacks

Other tools to consider integrating with: ClearML is one of my new favourites.

Also: Pachyderm + Seldon?

Testing

Testing: need to set up CI so that it repeatedly tests the full stack.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.