A lightweight Python tool to silence and simplify noisy ML logs globally or temporarily.
Project description
๐งโโ๏ธ QuietML โ Make Machine Learning Logs Calm & Clean
QuietML is a lightweight Python library that helps you silence, simplify, and structure noisy logs from ML frameworks like LightGBM, XGBoost, CatBoost, and TensorFlow โ in just one line.
Whether you're a student tired of endless [Info] spam or a developer who likes clean notebooks, QuietML keeps your console peaceful and professional.
๐ Why QuietML?
If youโve ever seen this ๐
[LightGBM] [Info] Number of positive: 4178, number of negative: 4178
[LightGBM] [Info] Auto-choosing row-wise multi-threading...
[LightGBM] [Warning] No further splits with positive gain, best gain: -inf
You know how painful it is to find your real output among hundreds of logs.
โ QuietML fixes that instantly โ clean outputs, no spam, one line of code.
โ๏ธ Installation
pip install quietml
or if you want the latest build directly from source:
pip install --upgrade --no-cache-dir quietml
๐ Quick Start
๐งฉ Simplest Way โ One-Line Setup
from quietml import configure
import lightgbm as lgb
from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split
X, y = load_breast_cancer(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
# Configure QuietML and model in one go
model = configure(lgb.LGBMClassifier(), mode="smart")
model.fit(X_train, y_train)
๐ง Output:
[QuietML] Global mode set to: SMART
[LightGBM] [Warning] No further splits with positive gain, best gain: -inf
โ
Model training complete!
๐๏ธ Manual Control (Multiple Frameworks)
from quietml import set_mode, apply_to_model
import xgboost as xgb
set_mode("silent") # or "smart" / "debug"
model = apply_to_model(xgb.XGBClassifier())
model.fit(X_train, y_train)
๐ง Output (silent mode):
[QuietML] Global mode set to: SILENT
โ
Model training complete!
๐ Temporary Silence Mode
from quietml import silence
import lightgbm as lgb
model = lgb.LGBMClassifier()
print("Training normally...")
model.fit(X_train, y_train)
with silence("silent"):
print("Training silently...")
model.fit(X_train, y_train)
print("Logs restored.")
๐ง Output:
Training normally...
[LightGBM] [Info] ...
Training silently...
โ
(no logs)
Logs restored.
๐ง Available Modes
| Mode | Description | What You See |
|---|---|---|
๐ค silent |
Suppresses all logs | Only warnings/errors |
๐ค smart |
Keeps essential info, hides spam | Warnings + important info |
๐งฉ debug |
Shows everything | Full developer logs |
๐งฑ Supported Frameworks
| Library | Supported | Controlled Parameter |
|---|---|---|
| LightGBM | โ | verbosity |
| XGBoost | โ | verbosity |
| CatBoost | โ | logging_level |
| TensorFlow | โ | TF_CPP_MIN_LOG_LEVEL |
| Scikit-learn | ๐ธ (indirectly) | via wrapped models |
| PyTorch | ๐ (planned) | โ |
| Transformers / LLMs | ๐ (planned) | โ |
๐งฉ API Reference
| Function | Purpose |
|---|---|
set_mode(mode) |
Set global mode (silent, smart, or debug) |
get_mode() |
Get current global mode |
apply_to_model(model) |
Apply current mode to a model |
configure(model, mode) |
Set mode + apply to a model in one call |
silence(mode) |
Temporarily change mode using a with block |
๐งช Example Output Comparison
Before QuietML:
[LightGBM] [Info] Number of positive: 4178, number of negative: 4178
[LightGBM] [Info] Auto-choosing row-wise multi-threading...
[LightGBM] [Warning] No further splits with positive gain...
After QuietML (smart mode):
[LightGBM] [Warning] No further splits with positive gain...
โ
Training complete.
After QuietML (silent mode):
โ
Training complete.
๐ Project Structure
quietml/
โ
โโโ quietml/
โ โโโ __init__.py # public API exports
โ โโโ core.py # main logic (modes, apply, silence)
โ
โโโ examples/
โ โโโ test_suppress.py # demo file
โ
โโโ README.md
โโโ LICENSE
โโโ .gitignore
๐งโ๐ป Contributing
Want to improve QuietML? Weโre open to contributions!
Ideas you can work on:
- Add PyTorch or Transformers (LLMs) support
- Add custom mode configurations
- Add auto-detection of ML frameworks
How to contribute:
git clone https://github.com/<your-username>/quietml.git
cd quietml
pip install -e .
๐งก Author
๐จโ๐ป Kaustubh Aggarwal Computer Science Engineer, VIT Vellore Passionate about building cleaner, smarter, and more user-friendly ML tools.
๐ License
This project is licensed under the MIT License โ free for personal and commercial use.
โจ TL;DR for Users
| You want to... | Use this |
|---|---|
| Clean all logs instantly | set_mode("silent") |
| Keep only key info | set_mode("smart") |
| Debug your model deeply | set_mode("debug") |
| Simplify everything | model = configure(model, "smart") |
| Silence logs temporarily | with silence("silent"): |
๐งโโ๏ธ QuietML โ Because your console deserves peace.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file quietml-2.1.0.tar.gz.
File metadata
- Download URL: quietml-2.1.0.tar.gz
- Upload date:
- Size: 18.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
041e1dbdd553ea2e17ee81ef66c1ca915bba072dcce74154da33b656d2e28a74
|
|
| MD5 |
aface66a365fa4dfa25194a4adb79490
|
|
| BLAKE2b-256 |
4da025efde0b8817417f8d8981dd1f96880e3601596568330478ec5fdf9864d6
|
File details
Details for the file quietml-2.1.0-py3-none-any.whl.
File metadata
- Download URL: quietml-2.1.0-py3-none-any.whl
- Upload date:
- Size: 18.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ddc065261bd4a78d262ab366029c22835e625de857bcf1b7b15c993e59efe676
|
|
| MD5 |
a10c7f5675cdc1d11ce829690f5c9435
|
|
| BLAKE2b-256 |
9660b5b647480600a6b4acce995bb5a88ea535ce86ca5a180e28d8f7ed6043d3
|