Skip to main content

mainboard banner

CI Publish PyPI Python Docs Coverage

Installation

pip install mainboard         # CPU and Apple probing, pure Python
pip install mainboard[cuda]   # adds NVIDIA telemetry via the CUDA Python bindings

Working in a chefe project? Add it to your manifest:

chefe add mainboard -l python

The base install is light and pure Python, so GPU-less Linux hosts like a Raspberry Pi pull nothing CUDA-related. The cuda extra installs the NVIDIA bindings on Linux for full GPU detection and telemetry, and provider detection degrades gracefully to no NVIDIA devices whenever the bindings or the hardware are absent.

The root API uses the PEP 810 __lazy_modules__ compatibility bridge. Python 3.14 keeps the normal eager import behavior. Python 3.15 defers only the audited Mainboard modules until their exported names are first used. Mainboard does not enable global lazy imports. GPU.all() and NPU.all() explicitly load provider registration before probing, so lazy imports cannot hide hardware backends.

What it is

mainboard tells Python what compute is on the current machine, without assuming the world is only CUDA. It models CPUs, GPUs, and NPUs as Units, keeps vendor-specific probing behind providers (Apple and NVIDIA today), and gives you the whole board in one call.

from mainboard import Machine

print(Machine().model_dump_json(indent=2))  # cpu, memory, gpus, npus, and the host environment

Usage

machine = Machine()
machine.cpu.snapshot()  # CPU identity and capacity
machine.gpus[0].snapshot()  # per-GPU telemetry
machine.environment  # user, group(s), and job scheduler on the host
machine.model_dump_json()  # one-call JSON probe of the whole machine

The CLI renders a Rich schematic of the board:

mainboard

Timing spans

span is a dormant annotation that is safe to leave in application code. It contains no collection policy and performs no clock, memory, marker, device, or context variable work until a Profiler is active. The profiler decides what to collect through Profiler.Feature flags. The resulting Profile shows only evidence that was observed.

from mainboard.profiling import Profiler, span

with Profiler(features=Profiler.Feature.SPANS) as profiler:
    with span("pipeline"):
        with span("extract"):
            ...
        with span("embed"):
            ...

profiler.show()

Profiler.run("package.module") profiles a module or script once. Python 3.15 sampling, span timing, process GPU telemetry, native markers, and GPU activity all feed the same result. A detected but unused GPU creates no GPU section. See docs/profiling.md for feature costs, CLI usage, Tachyon requirements, and native activity behavior.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mainboard-0.0.9.tar.gz (172.3 kB view details)

Uploaded Source

Built Distribution

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

mainboard-0.0.9-py3-none-any.whl (143.1 kB view details)

Uploaded Python 3

File details

Details for the file mainboard-0.0.9.tar.gz.

File metadata

  • Download URL: mainboard-0.0.9.tar.gz
  • Upload date:
  • Size: 172.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for mainboard-0.0.9.tar.gz
Algorithm Hash digest
SHA256 adac387c1fe9561d9f45bd06a6fe2727c37b7d42d2be6b81d3556d24288f52b8
MD5 706251f43136ff30b210bbaf7f6762c3
BLAKE2b-256 c8bf70b3c926a383ba4c8193ccaae34b0249435b211d076c34989f1c4b7715ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for mainboard-0.0.9.tar.gz:

Publisher: publish.yml on phvv-me/mainboard

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

File details

Details for the file mainboard-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: mainboard-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 143.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for mainboard-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 79f8b0f991c8de40049da3a83df56c08ef702a35b21c51ea6d7d3135d2e494b8
MD5 3bfeaea2684c698f9125ba74d883d03b
BLAKE2b-256 d56c1a118b4102ed6664da56e086b03c78cdd1cbcefdccc2390bc906e210268d

See more details on using hashes here.

Provenance

The following attestation bundles were made for mainboard-0.0.9-py3-none-any.whl:

Publisher: publish.yml on phvv-me/mainboard

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

Release history Release notifications | RSS feed

0.4.8

2 files

0.4.7

2 files

0.4.6

2 files

0.4.5

2 files

0.4.4

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

This release

0.0.9 This release

2 files

0.0.8

2 files

0.0.6

2 files

0.0.5

2 files

0.0.2

2 files

0.0.1

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