Beautiful, local-first experiment tracking. A lightweight alternative to wandb / tensorboard.
Project description
pandm
pandm tracks ML experiments locally. The Python SDK writes metrics and images straight to a .pandm/ directory next to your code — no account, no daemon, no cloud — and pandm ui serves a dashboard to compare runs. Unlike wandb there is nothing to sign up for, and unlike tensorboard the data is plain SQLite + PNG files you can query yourself. The same scripts report to a shared server over HTTP when you set one env var.
Install
pip install pandm
Quick start
import pandm
run = pandm.init(project="mnist", config={"lr": 1e-3, "batch_size": 64})
for step in range(1000):
loss, acc = train_step()
run.log({"train/loss": loss, "train/acc": acc}, step=step)
if step % 100 == 0:
run.log_image("samples", sample_grid, step=step) # PIL / numpy / torch / path
run.finish()
pandm ui # opens http://127.0.0.1:7878
The dashboard overlays selected runs per metric, with smoothing, log scale, step/time axes, an image browser with a step slider, and a config/summary comparison table. It polls while runs are alive, so curves grow during training.
Usage
step is optional (an internal counter is used). Runs end as finished or crashed: uncaught exceptions are detected via sys.excepthook (and the context manager), and hard-killed processes (kill -9, OOM) are presumed crashed once their 15s heartbeat goes quiet for 60s — self-healing if the process was merely suspended.
with pandm.init(project="mnist") as run:
run.log({"loss": 0.5})
Inspect, export or delete runs from the terminal:
pandm ls # list runs
pandm show <run_id> # config, summary, logged metrics
pandm export <run_id> > data.csv # full series as CSV (or --json, -k <key>)
pandm delete <run_id> # local + cloud copy when signed in
Data lives in ./.pandm by default; override with --dir or PANDM_DIR.
Hugging Face Accelerate
Pass a PandmTracker instance to Accelerator (Accelerate only resolves strings for its built-in trackers) — accelerator.log then reports to pandm, and end_training finishes the run:
from accelerate import Accelerator
from pandm.integrations.accelerate import PandmTracker
accelerator = Accelerator(log_with=PandmTracker(project="mnist", name="baseline"))
accelerator.init_trackers("mnist", config={"lr": 1e-3})
accelerator.log({"loss": 0.42}, step=10)
accelerator.end_training()
For images, unwrap the raw run: accelerator.get_tracker("pandm", unwrap=True).log_image("samples", img, step=step, caption=prompt).
Cloud mode
Training scripts never change — sign in once per machine and pandm.init() dual-writes: local stays the source of truth, a background thread syncs to the server, and anything logged offline is backfilled on reconnect. Delivery is exact-once (re-pushes are deduped server-side).
pandm login # hosted cloud (pandm.jannchie.com); pass a URL for self-hosted
python train.py # local + cloud
pandm sync # backfill runs whose process already exited
Each user signs in with GitHub and sees only their own runs. Two interchangeable server implementations speak the same protocol — the full walkthrough (OAuth App, custom domain, backups, troubleshooting) is in docs/deploy.md:
Cloudflare Workers (serverless: D1 for metrics, R2 for media — workers/):
cd workers && pnpm install
npx wrangler d1 create pandm # paste the database_id into wrangler.jsonc
npx wrangler secret put GITHUB_CLIENT_ID # OAuth App callback: https://<domain>/api/auth/callback
npx wrangler secret put GITHUB_CLIENT_SECRET
npx wrangler secret put PANDM_SECRET_KEY # e.g. `openssl rand -hex 32`
npx wrangler d1 migrations apply pandm --remote
pnpm run deploy
Note: D1 bills per row written (100k/day free). Logging ~10 metrics/sec around the clock lands in the paid tier — a few dollars a month.
Self-hosted Python server (same binary as pandm ui):
GITHUB_CLIENT_ID=… GITHUB_CLIENT_SECRET=… docker compose up -d # multi-user mode
Without OAuth env vars the server falls back to single-tenant mode — pandm server --api-key my-secret plus PANDM_REMOTE/PANDM_API_KEY on the client (remote-only, no local copy, no accounts).
API
pandm.init(project, name=None, config=None, *, directory=None, remote=None, api_key=None) |
start a run |
run.log(metrics, step=None) |
log scalar metrics |
run.log_image(key, image, step=None, caption=None) |
log an image |
run.finish(status="finished") |
end the run (also via atexit) |
GET /api/docs |
REST API reference on any running server |
Development
uv sync && uv run pytest # python sdk + server
cd web && pnpm install && pnpm dev # dashboard dev server (proxies to :7878)
pnpm build # bundles the dashboard into src/pandm/static
cd workers && pnpm install && pnpm test # cloudflare workers server (contract tests)
License
MIT
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 pandm-0.8.0.tar.gz.
File metadata
- Download URL: pandm-0.8.0.tar.gz
- Upload date:
- Size: 859.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee9a1bceb71e5f9ca550e35d1b0f31a046fe68e4281f50d4279ceeca4c822d00
|
|
| MD5 |
a4eb0b69fff2b09273f1edd0886eca34
|
|
| BLAKE2b-256 |
0a16f5789344ff78b0e019bc00e97df02e95411c06d19c7c85caa5fb60b99c73
|
Provenance
The following attestation bundles were made for pandm-0.8.0.tar.gz:
Publisher:
release.yml on Jannchie/pandm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pandm-0.8.0.tar.gz -
Subject digest:
ee9a1bceb71e5f9ca550e35d1b0f31a046fe68e4281f50d4279ceeca4c822d00 - Sigstore transparency entry: 1747810067
- Sigstore integration time:
-
Permalink:
Jannchie/pandm@34f978da1038ac97776d427d610f02cfae37270d -
Branch / Tag:
refs/tags/v0.8.0 - Owner: https://github.com/Jannchie
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@34f978da1038ac97776d427d610f02cfae37270d -
Trigger Event:
push
-
Statement type:
File details
Details for the file pandm-0.8.0-py3-none-any.whl.
File metadata
- Download URL: pandm-0.8.0-py3-none-any.whl
- Upload date:
- Size: 454.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c14ef43ec69bce18fdd9f96b35c9ce609fe006aad2842574f7e7014f4615a21
|
|
| MD5 |
fb0fa3060c249a3fa620d5e70706cc72
|
|
| BLAKE2b-256 |
5b823a4567ac2735c6d181152f14057d42ebbfac65c7c65f65eaee50bad9485b
|
Provenance
The following attestation bundles were made for pandm-0.8.0-py3-none-any.whl:
Publisher:
release.yml on Jannchie/pandm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pandm-0.8.0-py3-none-any.whl -
Subject digest:
5c14ef43ec69bce18fdd9f96b35c9ce609fe006aad2842574f7e7014f4615a21 - Sigstore transparency entry: 1747810185
- Sigstore integration time:
-
Permalink:
Jannchie/pandm@34f978da1038ac97776d427d610f02cfae37270d -
Branch / Tag:
refs/tags/v0.8.0 - Owner: https://github.com/Jannchie
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@34f978da1038ac97776d427d610f02cfae37270d -
Trigger Event:
push
-
Statement type: