harmonia
Bring harmony to your ML dependency stack.
harmonia detects your GPU, CUDA, driver, OS, Python, and installed packages — then tells you exactly what's compatible with what. Zero dependencies. Works offline.
pip install harmonia-ml
The problem
You install torch, then transformers, then accelerate — and something breaks. You get a cryptic AttributeError or a silent CUDA mismatch. You spend an hour on GitHub issues to discover your driver doesn't support the CUDA version your PyTorch was built for.
harmonia fixes this in one command.
Usage
harmonia check — full environment scan
$ harmonia check
_ _
| |__ __ _ _ __ _ __ ___ ___ _ __ (_) __ _
| '_ \ / _` | '__| '_ ` _ \ / _ \| '_ \| |/ _` |
| | | | (_| | | | | | | | | (_) | | | | | (_| |
|_| |_|\__,_|_| |_| |_| |_|\___/|_| |_|_|\__,_|
System:
OS: Ubuntu 22.04 (jammy)
Arch: x86_64
glibc: 2.35
Python:
Version: 3.10.12
Path: /home/user/.venv/bin/python
Env: venv:myproject
GPU (1 detected):
[0] NVIDIA RTX 4090 (24564 MB)
CUDA:
Driver: 535.54.03
CUDA (smi): 12.2
CUDA (nvcc):12.1
CUDA (torch):12.1
cuDNN: 8.9.7
Packages:
torch==2.5.1
torchaudio==2.3.0
torchvision==0.20.1
transformers==4.44.2
accelerate==0.30.0
────────────────────────────────────────────────────────
❌ 1 error(s):
[torchaudio] torchaudio==2.3.0 is NOT compatible with torch==2.5.1.
↳ Expected torchaudio==2.5.1
📦 Recommended compatible set:
torch==2.5.1
torchaudio==2.5.1
torchvision==0.20.1
harmonia doctor — deep system diagnostics
Inspects your GPU, CUDA driver chain, glibc, virtualenv, and checks for mismatches:
$ harmonia doctor
harmonia suggest — find compatible versions
# What goes with torch 2.5.1?
harmonia suggest torch==2.5.1
# What goes with transformers 4.44.2?
harmonia suggest transformers==4.44.2
# Best stack for my Python + CUDA?
harmonia suggest transformers --python 3.11 --cuda 12.1
harmonia matrix — compatibility tables
# PyTorch ecosystem
harmonia matrix pytorch
# Transformers ecosystem
harmonia matrix transformers
# As JSON (for scripts)
harmonia matrix pytorch --json
harmonia conflicts — known conflict database
$ harmonia conflicts
1. transformers>=4.38 breaks with torch<1.13
When: transformers>=4.38.0 + torch<1.13.0
Error: AttributeError: module 'torch.utils._pytree' has no attribute 'register_pytree_node'
Fix: Upgrade torch to >=1.13.0 or downgrade transformers to <4.38.0
2. transformers>=5.0 requires torch>=2.1 (is_torch_fx_available removed)
...
What it checks
| Check | What it detects |
|---|---|
| OS / glibc | Distro, version, glibc compatibility with manylinux wheels |
| Python | Version, virtualenv, EOL warnings |
| GPU | Model, VRAM, count via nvidia-smi --query-gpu |
| CUDA driver | nvidia-smi driver version, max CUDA supported |
| CUDA toolkit | nvcc version, driver compatibility |
| torch CUDA | PyTorch's built-in CUDA vs driver mismatch |
| cuDNN | Version detection via torch.backends |
| PyTorch | torch ↔ torchvision ↔ torchaudio version lock |
| Transformers | torch minimum, accelerate, tokenizers constraints |
| Known conflicts | Pattern-matched against real-world bug reports |
Use as a library
from harmonia.checker import check, suggest
from harmonia.detector import detect
# Full environment scan
env = detect()
print(env.summary())
print(f"GPU: {env.gpus[0].name if env.gpus else 'none'}")
print(f"CUDA: {env.cuda_info.best_version}")
# Check for issues
result = check()
for issue in result.issues:
print(f"{issue.severity}: [{issue.package}] {issue.message}")
# Suggest compatible versions
versions = suggest(package="transformers", version="4.44.2")
JSON output
For CI pipelines and scripts:
harmonia check --json
Returns structured JSON with errors, warnings, and environment info.
OpenClaw Skill
harmonia is available as an OpenClaw skill. Install it and your AI agent can diagnose ML environments through chat:
clawhub install harmonia
Then just tell your agent: "check my ML environment", "what torch works with transformers 5?", or "I'm getting a CUDA error" — it runs harmonia and gives you the answer.
Contributing
The compatibility databases live in data/*.json. To add new versions or ecosystems:
- Edit the relevant JSON file in
data/ - Run
pytestto verify - Submit a PR
Zero dependencies
harmonia has no runtime dependencies. It uses only the Python standard library. It detects packages through importlib.metadata and system tools through subprocess. It works offline, costs nothing, and installs instantly.
License
MIT
Metadata
Release files for harmonia-ml 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| harmonia_ml-0.3.1.tar.gz | 40.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| harmonia_ml-0.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 79.7 kB
Release files / harmonia_ml-0.3.1.tar.gz
| Download URL | harmonia_ml-0.3.1.tar.gz |
|---|---|
| Size | 40.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
77ab14ce8930f003593f1ca38e2e05abcb7824233f190370feb739f9235b5722
|
|
BLAKE2b-256 checksum How to use checksums |
cdb12eb32ba9ef40e88a4a6b46fc0cc775552d5e3b684b4ca8b3286c56dbe67b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.6
|
Release files / harmonia_ml-0.3.1-py3-none-any.whl
| Download URL | harmonia_ml-0.3.1-py3-none-any.whl |
|---|---|
| Size | 39.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
26ced6f02bb18e810b5f725d1f98d873b5ae6d60f0a59947295665e7fd567bc2
|
|
BLAKE2b-256 checksum How to use checksums |
cc62b694584a7024f7386fa5ac3ccc3267c70e288cfd8b59fb160a91ccd7dc54
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.6
|
Security for harmonia-ml 0.3.1
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.