Skip to main content

Unified multimodal explainability and responsible AI framework

Project description

(BETA) BitsXAI

Model Agnostic XAI + RAI Middleware Layer Python Package | Bitstek.io

Multi-Modal Explainable and Responsible AI Python Package - V1

A modular Python SDK for Explainable AI (XAI) and Responsible AI (RAI), combining model explainability, trust diagnostics, and multi-modal routing in a unified framework.


Description

Python SDK for modular Explainable & Responsible AI : model adapters, explainers, risk diagnostics, and multi-modal routing in one framework.


Developer

Developed and maintained by @8bitjawad

Overview

This project is designed to provide a structured framework for building, testing, and extending explainability and responsible AI workflows.

Instead of using isolated tools for explanations, fairness checks, and robustness analysis, the SDK unifies them under a layered architecture.

It provides:

  • Explainability algorithms (SHAP, LIME, counterfactuals etc.)
  • Responsible AI diagnostics (bias, drift, robustness)
  • Pluggable model adapters for multiple modalities
  • Routing/orchestration across components
  • Visualization and reporting support

Supported modalities:

  • Tabular models
  • NLP
  • Vision Models
  • LLMs
  • Text-to-Image (TTI) models

Why XAI/RAI Instead of Using Individual Libraries?

Libraries like SHAP or LIME solve explanation problems individually.

This project aims to provide:

  • A unified SDK abstraction
  • Explainability + Responsible AI in one system
  • Multi-modal support via adapters
  • Routing logic across models and modalities
  • Extensible architecture for research and deployment
  • LLM Explanations for ease of understanding

xai_rai combines explainability, responsible AI diagnostics, multi-modal orchestration, and unified result abstractions within a single extensible SDK.---

Architecture

xai_rai follows a layered, result-centric architecture:

Facade
↓
Pipeline
↓
Analyzers / Explainers
↓
Inference Engines / Adapters
↓
Unified Result Objects
↓
Charts / Reports / UI
---

Core Features

Explainability

  • SHAP feature attribution
  • LIME local explanations
  • Counterfactual explanations
  • Natural language narratives
  • Multi-modal explanation pipelines

Responsible AI

  • Fairness diagnostics
  • Population Stability Index (PSI) drift detection
  • Robustness checks
  • Confidence/anomaly scoring

Usage

Installation

Base

pip install xai-rai

Text-to-Image

pip install xai-rai[tti]

Vision

pip install xai-rai[vision]

Full Installation

pip install xai-rai[full]

Example Usage

Quickstart — Text-to-Image XAI

````md id="jlwm8k" ```

from PIL import Image

from xai_rai import TextToImageExplainer

explainer = TextToImageExplainer(
    device="cpu",
    enable_caption_analysis=True,
)

image = Image.open("generated.png")

result = explainer.explain(
    image=image,
    prompt="a futuristic cyberpunk city",
)

print(result.summary())

Design Philosophy

The framework follows:

Modular Architecture

Each concern lives in its own layer.


Adapter Pattern

Models are accessed through standardized interfaces.


Separation of Concerns

Explainability and Responsible AI diagnostics are distinct modules.


Extensibility

New:

  • modalities
  • explainers
  • diagnostics
  • visualization layers

can be added without changing the whole system.


Roadmap

Current

  • Tabular explainability
  • NLP explainability
  • Vision explainability
  • LLM explainability
  • Text-to-image explainability
  • SHAP / LIME integration
  • Counterfactual explanations
  • Multi-modal result objects
  • RAI diagnostics
  • Trust / alignment analysis

Example Use Cases

xai_rai can support:

  • Explainable healthcare models
  • Explainable and Responsible AI for Businesses
  • Responsible AI and toxicity screens

Public APIs

from xai_rai import (
    TabularExplainer,
    VisionExplainer,
    NLPExplainer,
    LLMExplainer,
    TextToImageExplainer,
)

Contribution

This project is currently in Beta and is being actively improved and worked on. If you wish to contribute, please follow the following guidelines: Keep modules modular and loosely coupled Follow the layered architecture Add type hints where possible Prefer result-centric APIs over raw dictionaries Include lightweight tests for new features Keep public APIs clean and stable

For major architectural changes or new modality integrations, open an issue/discussion first before implementing large changes.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xai_rai-0.1.1.tar.gz (192.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xai_rai-0.1.1-py3-none-any.whl (228.9 kB view details)

Uploaded Python 3

File details

Details for the file xai_rai-0.1.1.tar.gz.

File metadata

  • Download URL: xai_rai-0.1.1.tar.gz
  • Upload date:
  • Size: 192.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for xai_rai-0.1.1.tar.gz
Algorithm Hash digest
SHA256 54ac2ad01af0cc89244e11864aaaa8d5469571a9c6e2112931da3eb9c9be5817
MD5 7787edb4d70132c43cebb21f761c8f17
BLAKE2b-256 bb244b982e1668d2e03d00ad0abd3702ff2c901a3f6519063333ee38dcf0add1

See more details on using hashes here.

File details

Details for the file xai_rai-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: xai_rai-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 228.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for xai_rai-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 11a2db1e014896ac60daadb9e1be4f6823556fdcd9526376d75e1d42180aba50
MD5 84b5408b6aed8d1de0c598402358fe5c
BLAKE2b-256 3dfbc37b7894ec8de57c0267d95ebcb0fefb2a8e4e99357d0ab4f41ec116ebf9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page