Skip to main content

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

sweatmeter-0.4.0.tar.gz (351.6 kB view details)

Uploaded Source

Built Distribution

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

sweatmeter-0.4.0-py3-none-any.whl (54.1 kB view details)

Uploaded Python 3

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

Hashes for sweatmeter-0.4.0.tar.gz
Algorithm Hash digest
SHA256 026b952ebcb1a090510cfb44c79e6e23fb8b23f8e006f5524ebad8819bdbb2c7
MD5 d31abbfcc4e2c9ae0f38f0d3962368be
BLAKE2b-256 6b69aadcaeccb68e42512224b06c3dfd349aee023e761be6ec19d3592fc663f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for sweatmeter-0.4.0.tar.gz:

Publisher: release.yml on JPKell/SweatMeter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for sweatmeter-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ae405aab5fb3b280e545baee5044035b1ca15707a4e5003ea29f1e584d43ff5d
MD5 f14caaed0087294d41bbedb3706ade83
BLAKE2b-256 81ab8225fa3716b50d5cfbcc03eb04c83e910d118eebb72dd97c132198b5a171

See more details on using hashes here.

Provenance

The following attestation bundles were made for sweatmeter-0.4.0-py3-none-any.whl:

Publisher: release.yml on JPKell/SweatMeter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 files

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