Integration Partners
MLOps

WhyLabs

3min

WhyLabs is a platform that helps organizations manage and monitor their machine learning models. By automating data pipeline management and providing real-time monitoring and insights, WhyLabs makes it easier for teams to build, test, and deploy models with confidence. With WhyLabs, organizations can streamline their MLOps pipeline and ensure the security and compliance of their models.

Follow the steps below to integrate AI Shield with Whylabs:

To learn more, see the reference implementation on GitHub for WhyLabs.

Requirements

To integrate AI Shield with WhyLabs, you'll need the following:

  1. A Conda or Python environment

Steps

Follow these steps to integrate AI Shield with WhyLabs:

  1. Clone the Iris code from GitHub.
  2. Sign up for the WhyLabs website and note the API key. Edit the .env file with the respective API key and organization ID. The API key is valid for one year.
  3. Create a Conda environment using conda env create -f environment.yml. This will create the environment and install all the packages listed in the environment.yml file. However, you can also create the environment manually using conda create -n whylabs python=3.7.13 numpy==1.21.5 and install the necessary packages based on requirements.
  4. Build the Dockerfile without VPN and proxy off using docker build -f Dockerfile --build-arg PYTHON_VERSION=3.7 -t whylabs-flask. This will create an image/container named whylabs-flask, which has all the packages present in the requirement.txt file. You need to do this build every time you want to create the container.
  5. Run the Docker container using docker run --rm -p 5000:5000 whylabs-flask.
  6. Access the WhyLogs by hitting the API endpoint. You can do this through Swagger UI or a Python post request.
  7. You can see the logs in "https://hub.whylabsapp.com/models".
  8. First, create a model ID on the WhyLabs website, and then enter that ID in the .env file.
  9. Make changes to views.py by adding the product defense prenet and logging changes to WhyLabs (about MNIST).
  10. Baseline for MNIST: 0 to 9: original model output. If the prediction is non-integer, generate an alert in WhyLabs.



Updated 09 Aug 2023
Did this page help you?