SweatMeter
CPU/RAM/GPU/VRAM/thermal/power telemetry and static machine profiling; degrades honestly to Unsupported rather than fabricating a value.
Status: Phases 1–4 implemented (sweatmeter 0.4.0). Linux host readers, NVIDIA telemetry,
non-raising snapshots, stable machine profiles, bounded background sampling, per-device window
statistics, telemetry-derived energy estimates, and explained throttling verdicts are available.
Part of the Local AI Suite — see docs/architecture/executive-summary.md for how SweatMeter fits with the suite's other applications and packages.
Install
pip install sweatmeter
# Optional NVML backend: reads NVIDIA GPUs in-process instead of running `nvidia-smi` per sample.
pip install "sweatmeter[pynvml]"
Quickstart
from sweatmeter import TelemetryCollector
snapshot = TelemetryCollector().snapshot()
print("CPU:", snapshot.cpu_percent, "RAM:", snapshot.ram_used_bytes)
for gpu in snapshot.gpus:
print(f"GPU {gpu.index}:", gpu.utilization_percent, "VRAM:", gpu.vram_used_bytes)
snapshot() and machine_profile() isolate ordinary sensor failures and do not raise. An absent
tool, unreadable source, malformed value, or unsupported sensor degrades honestly: collections
become empty and individual measurements become BaseAiCore's explicit UNSUPPORTED value, never
zero. Every degraded snapshot field has a reason in snapshot.unavailable_reasons().
Background sampling and per-device derived metrics stay bounded and explicit:
from sweatmeter import TelemetrySampler, TelemetryWindow
collector = TelemetryCollector()
with TelemetrySampler(collector, interval_seconds=1.0, buffer_size=60) as sampler:
run_work() # your workload
window = TelemetryWindow(sampler.buffered())
print("GPU 0 peak VRAM:", window.peak_vram_bytes(0))
print("GPU 0 energy estimate (J):", window.energy_joules(0))
print("Power samples used:", window.supported_sample_count("energy_joules", 0))
Two GPU backends read the same devices and return identical values: the always-available
nvidia-smi command, and NVML through the optional pynvml extra, which is selected automatically
when installed and removes the per-sample subprocess. One conformance suite runs against both.
Energy is always a telemetry-derived estimate, never hardware instrumentation. No derived method
aggregates devices: each GPU figure takes a gpu_index and describes only that device.
Documentation
This repository carries its own copy of the relevant suite documentation under docs/,
so it can be read and implemented independently of the other eight suite repositories. Start with
docs/README.md.
| Read this | For |
|---|---|
| docs/packages/sweatmeter/spec.md | Purpose, scope, non-goals, public contracts, configuration, acceptance criteria |
| docs/packages/sweatmeter/development-plan.md | The phased build plan: goals, work, tests, acceptance criteria per phase |
| docs/quickstart.md | Snapshot, profile, sampler, deterministic-test, and derived-metric examples |
| docs/platform-support.md | Exact Linux, NVIDIA, Windows, and macOS support and degradation behaviour |
| docs/performance-validation.md | Recorded Phase 4 overhead measurements and methodology |
| docs/standards/ | Coding, testing, security, API, database and packaging standards every phase follows |
| docs/adr/ | The architectural decisions this design rests on |
Development
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pre-commit install
pytest -m "not live and not performance"
See CONTRIBUTING.md for the full workflow and SECURITY.md for
how to report a vulnerability.
License
Apache-2.0 — see LICENSE.
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 sweatmeter-0.4.0.tar.gz.
File metadata
- Download URL: sweatmeter-0.4.0.tar.gz
- Upload date:
- Size: 351.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
026b952ebcb1a090510cfb44c79e6e23fb8b23f8e006f5524ebad8819bdbb2c7
|
|
| MD5 |
d31abbfcc4e2c9ae0f38f0d3962368be
|
|
| BLAKE2b-256 |
6b69aadcaeccb68e42512224b06c3dfd349aee023e761be6ec19d3592fc663f0
|
Provenance
The following attestation bundles were made for sweatmeter-0.4.0.tar.gz:
Publisher:
release.yml on JPKell/SweatMeter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sweatmeter-0.4.0.tar.gz -
Subject digest:
026b952ebcb1a090510cfb44c79e6e23fb8b23f8e006f5524ebad8819bdbb2c7 - Sigstore transparency entry: 2569601451
- Sigstore integration time:
-
Permalink:
JPKell/SweatMeter@b89a897c21fba45b3ab363677f5ad2524d049a07 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/JPKell
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b89a897c21fba45b3ab363677f5ad2524d049a07 -
Trigger Event:
push
-
Statement type:
File details
Details for the file sweatmeter-0.4.0-py3-none-any.whl.
File metadata
- Download URL: sweatmeter-0.4.0-py3-none-any.whl
- Upload date:
- Size: 54.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae405aab5fb3b280e545baee5044035b1ca15707a4e5003ea29f1e584d43ff5d
|
|
| MD5 |
f14caaed0087294d41bbedb3706ade83
|
|
| BLAKE2b-256 |
81ab8225fa3716b50d5cfbcc03eb04c83e910d118eebb72dd97c132198b5a171
|
Provenance
The following attestation bundles were made for sweatmeter-0.4.0-py3-none-any.whl:
Publisher:
release.yml on JPKell/SweatMeter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sweatmeter-0.4.0-py3-none-any.whl -
Subject digest:
ae405aab5fb3b280e545baee5044035b1ca15707a4e5003ea29f1e584d43ff5d - Sigstore transparency entry: 2569601468
- Sigstore integration time:
-
Permalink:
JPKell/SweatMeter@b89a897c21fba45b3ab363677f5ad2524d049a07 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/JPKell
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b89a897c21fba45b3ab363677f5ad2524d049a07 -
Trigger Event:
push
-
Statement type: