Skip to main content

ModelBrief

Train your model your way. ModelBrief analyses it and turns the results into a complete model report.

PyPI version Downloads Python Tests Python Version License

ModelBrief accepts an already-trained model plus any available train, validation, and test data. It never calls fit, never retrains the model, and produces console, standalone HTML, and PDF reports.

Overview

ModelBrief is an open-source Python library for analysing trained machine-learning models and automatically generating structured reports. Reports can include:

Model overview and parameters, Dataset summary, Task detection, Feature importance, Model performance and evaluation metrics, Confusion matrix, Error analysis, Visualisations, Optional AI-generated explanation and recommendations

Supported workflows

  • Scikit-learn classifiers, regressors, clusters and compatible estimators
  • XGBoost, LightGBM and CatBoost through optional extras
  • PyTorch and TensorFlow/Keras classification models
  • CNN/image classification data, plus extensible detection and segmentation metrics
  • NLP pipelines, PyTorch/TensorFlow text models, token and text error utilities
  • Regression, classification, clustering, time-series forecast evaluation and anomaly detection

Deep-learning inputs differ by project. Pass model-ready tensors or arrays. For custom data loaders, output schemas, object detection, generation, segmentation, or unusual prediction APIs, subclass BaseAdapter and pass adapter=YourAdapter(model).

ModelBrief(model, X_test=X_test, y_test=y_test, task="time_series")
ModelBrief(model, X_test=images, y_test=labels, task="computer_vision")
ModelBrief(model, X_test=texts, y_test=labels, task="nlp")
ModelBrief(model, X_test=X, task="clustering")

Design guarantees

  • The supplied model is treated as trained and is never fitted.
  • Validation is optional and independently reported when present.
  • Optional frameworks are not heavily imported.
  • A failed optional analysis is recorded as a warning rather than destroying the whole report.
  • HTML is standalone. PDF creation uses ReportLab.

Current version: 0.2.1 Python: 3.10+

Quick start

pip install modelbrief
from modelbrief import ModelBrief

report = ModelBrief(
    model=model,
    X_train=X_train, y_train=y_train,
    X_val=X_val, y_val=y_val,       # optional
    X_test=X_test, y_test=y_test,
    ai=False,
)
print(report.show())
report.pdf("reports/model.pdf")
report.html("reports/model.html")

Reports include: Model overview, Dataset, Task, Parameters, Feature importance, Model performance, Confusion matrix, Error analysis, Charts, and Optional AI guidance.

Framework-specific dependencies remain optional.

pip install modelbrief
pip install "modelbrief[xgboost]"
pip install "modelbrief[lightgbm]"
pip install "modelbrief[catboost]"
pip install "modelbrief[pytorch]"       # includes torch and torchvision
pip install "modelbrief[tensorflow]"
pip install "modelbrief[vision]"
pip install "modelbrief[nlp]"           # transformers and torch
pip install "modelbrief[ai]"            # Groq SDK
pip install "modelbrief[all]"           # every integration

Setting Up the Development Environment including pytest

git clone <your-fork-url>
cd modelbrief
python -m venv .venv
# Windows: .venv\Scripts\activate
# macOS/Linux: source .venv/bin/activate
pip install -e ".[dev]"
pytest

Groq AI, optional

  1. Create or retrieve an API key from GroqCloud.
  2. Install the optional client: pip install "modelbrief[ai]".
  3. Set the key in the environment. Never put it in source code or commit it.

PowerShell:

$env:GROQ_API_KEY="your-api-key"
$env:MODELBRIEF_GROQ_MODEL="openai/gpt-oss-20b" # optional

Windows CMD:

set GROQ_API_KEY=your-api-key
set MODELBRIEF_GROQ_MODEL=openai/gpt-oss-20b

macOS/Linux:

export GROQ_API_KEY="your-api-key"
export MODELBRIEF_GROQ_MODEL="openai/gpt-oss-20b" # optional

Install or Update

Using pip: pip install --upgrade modelbrief # Get the latest features!, if you already have modelbrief installed .

Run tests:

pytest

Then use ModelBrief(..., ai=True). With ai=False, Groq is neither imported nor called. AI output is supplementary and should be reviewed by a qualified human.

contributing,workflow and example

Contributions are welcome! ModelBrief is intended to be an open-source project where developers and data scientists can add adapters, analyses, visualisations, tests and improvements.

See examples/ for classification, regression, clustering, time series, anomaly detection, PyTorch, TensorFlow, computer vision, CNN, object detection, segmentation, NLP, sentiment, Transformers, and text generation examples.

Fork, clone, create a branch, install .[dev], add code and tests, run pytest, and open a pull request. Keep framework-specific dependencies optional. Do not commit secrets, datasets, checkpoints, or large model weights.

Branching Strategy

  • main → Production-ready code
  • dev → Active development
  • feature/* → New features
  • fix/* → Bug fixes

Maintainers

ModelBrief is maintained by a data scientist and software developer:

Name GitHub Email
Chidiebere Njoku @ChidiebereNjoku chidexnj@gmail.com
Micheal Adegoro @micheal adegboromicheal@gmail.com

License

Apache License 2.0

Metadata

Release files for modelbrief 0.2.2

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

Source distribution (sdist)

Source distribution for modelbrief 0.2.2
File Size Uploaded Provenance
modelbrief-0.2.2.tar.gz 29.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for modelbrief 0.2.2
File Interpreter ABI Platform
modelbrief-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 62.9 kB

Release files / modelbrief-0.2.2.tar.gz

Download URL modelbrief-0.2.2.tar.gz
Size 29.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7ebd41fec19f9aec207e2113487a75234b1cdca002e09157a6cc1a21c23cb1fd
BLAKE2b-256 checksum
How to use checksums
31f0843b95fbba7fc5bb92fd39b386f651b5a78de2c4192e7fa032a539290352
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.20

Release files / modelbrief-0.2.2-py3-none-any.whl

Download URL modelbrief-0.2.2-py3-none-any.whl
Size 33.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a81ae3eaa42209245eabff7e2d6e7490904bde1f2c7d06f21829d3e21169b993
BLAKE2b-256 checksum
How to use checksums
180f99676543761fb5936b73d9ab0b13c873e8d763b491da659a10516d2f2fc9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.20

Security for modelbrief 0.2.2

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.

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files No provenance

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