Skip to content

mammoth-eu/mammoth-commons

Repository files navigation

MAI-BIAS modules and local runer

MAI_BIAS toolkitIntegration tests Coverage Contributor Covenant Downloads

This software is part of MAI-BIAS; a low-code toolkit for fairness analysis and mitigation, with an accompanying suite of coding tools. Our ecosystem operates in multidimensional and multi-attribute settings (safeguarding multiple races, genders, etc), and across multiple data modalities (like tabular data, images, text, graphs). Learn more here.

This repository holds the toolkit's local runner, as well as implementation and documentation of 40+ modules.

👥 Who is this for?

  • ML engineers and data scientists building or evaluating models in Python.
  • Researchers studying AI bias across data modalities (tabular, vision, LLMs, etc).
  • Bias auditors and compliance teams needing standardized, traceable fairness reports, and system comparison across different datasets, parameters, and over time.
  • Policymakers and analysts who seek reproducible evidence for decision‑making.

✨ About

This repository is created by the MAMMOth project and holds the mammoth-commons library, which contains supporting datatypes and decorators for developing fairness modules. It also hosts a catalogue of 40+ modules. Finally, find a desktop application that runs those modules in your local machine.

logo

🔗 Links

⚡ Manual local runner installation

  1. Make sure you are on Python 3.11. Most modules also work in Python 3.13 or later too.
  2. Install the mai-bias package.
  3. Launch the desktop app.
# may need to replace python with python3
python --version
pip install mai-bias
python -m mai_bias.app

You can try this boostrapping command:

curl -fsSL https://raw.githubusercontent.com/mammoth-eu/mammoth-commons/dev/mai_bias.sh -o mai_bias.sh && chmod +x mai_bias.sh && ./mai_bias.sh

Modules will install further missing dependencies they need to run. This may take some time, especially for modules depending on torch or tensorflow.

experiment results

Ubuntu: Example of full installation pipeline
sudo add-apt-repository ppa:deadsnakes/ppa -y
sudo apt update
sudo apt install python3.13
sudo apt install python3.13-pip
sudo apt install python3.13-venv
python3 -m venv venv
source venv/bin/activate
python3 install mai-bias
python3 -m mai_bias.app
Windows: WSL missing .so files

If you are in WSL, you are likely to get errors like this ImportError: libGL.so.1: cannot open shared object file: No such file or directory. This is due to the lack of a graphical environment. Install one like like below, including missing font symbols needed to properly display certain UI element.

sudo apt update
sudo apt install fonts-noto-color-emoji fonts-symbola
sudo apt install libgl1
sudo apt install libxkbcommon-x11-0
sudo apt install libegl1
sudo apt install libnss3
sudo apt install libxcomposite1
sudo apt install libxdamage1
sudo apt install libxrender1
sudo apt install libxrandr2
sudo apt install libxtst6
sudo apt install libxi6
sudo apt install libasound2
sudo apt install libxkbfile-dev
sudo apt install --reinstall qt6-wayland libxcb-cursor0 libxkbcommon-x11-0
sudo apt install libx11-xcb1 libxcb-xinerama0 libxcb-cursor0
The app never opens

First time, it needs to hypdrate itself with some images. If it crashes nonetheless, there could be an issue with GPU acceleration in your environment. Try starting the app with the following command as a first remedy (after making a virtual environment as described above, if not there).

python -m mai_bias.app_safe
MAC: Illegal hardware instruction

We have encountered this error in at least one M2 machine. This is likely due to a mismatch between Python's x86-x64 vs arm64e choice. Please make sure that you have a matching architecture between the system and python. Ideally install the latter through brew.

VSCode launch profile
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python Debugger: Current File",
            "type": "debugpy",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "justMyCode": false,
            "cwd": "${workspaceFolder}",
        },
        {
            "name": "Python: Test",
            "type": "debugpy",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "justMyCode": false,
            "cwd": "${workspaceFolder}",
            "env": {
                "PYTHONPATH": "${workspaceFolder}"
            }
        },
        {
            "name": "MAI-BIAS Desktop",
            "type": "debugpy",
            "request": "launch",
            "module": "mai_bias.app",
            "justMyCode": false
        },
        {
            "name": "MAI-BIAS Terminal",
            "type": "debugpy",
            "request": "launch",
            "module": "mai_bias.cli",
            "justMyCode": false
        }
    ]
}

📜 License

This repository is distributed under the Apache 2.0 License, Copyright 2026 MAMMOth.

Third-party licenses:

About

Contains modules with MAMMOths research results, and a lightweight demonstrator for running those

Resources

License

Code of conduct

Contributing

Stars

22 stars

Watchers

4 watching

Forks

Packages

 
 
 

Contributors