pymc-monitor
Local streaming convergence diagnostics and adaptive stopping for PyMC 5.28 and 6.
Before a PyPI release, install from Git after the repository is published:
python -m pip install 'pymc-monitor @ git+https://github.com/justmytwospence/pymc-monitor.git@main'
# For the local dashboard (optional FastAPI/uvicorn):
python -m pip install 'pymc-monitor[dashboard] @ git+https://github.com/justmytwospence/pymc-monitor.git@main'
For development from a local checkout: uv sync --locked --group dev --group docs --extra dashboard.
The version is declared in pyproject.toml and checked against src/pymc_monitor/__init__.py.
import pymc as pm
import pymc_monitor as monitor
with pm.Model() as model:
mu = pm.Normal("mu")
y = pm.Normal("y", mu, observed=[0.1, -0.2])
idata = monitor.sample(model=model, draws=1000, tune=500, until="draft")
print(monitor.read_report(idata))
sample returns the inference data. start returns a SamplingHandle with wait(), stop(), close(), done, snapshot() and dashboard_url. For custom consumers, iter_sample(model, sample_kwargs, ...) yields typed PhaseUpdate, SamplingProgress, ConvergenceUpdate, and RunFinished events; its StopIteration.value is a SamplingResult containing idata, report, requested_sampler, and effective_sampler. RunControl(stop_requested=predicate) may be shared between a caller and either API; external polling is throttled to 0.5 seconds, and failures warn once without aborting sampling. event_to_dict/event_from_dict exchange versioned events with cloud transports. JAX samplers have phase-only progress and cannot abort early; requesting adaptive stopping with JAX raises ValueError.
The default sampler is nutpie when installed for a continuous model, otherwise native PyMC. Custom steps, discrete free variables and native callbacks select PyMC. Automatic nutpie import/compilation failures before sampling starts warn and retry once with native PyMC; explicit sampler selection and sampling failures never fall back. The attached report records requested and effective samplers. Set nuts_sampler explicitly for reproducibility.
Install the notebook extra for notebook widgets, nutpie for background nutpie sampling, or jax for JAX samplers. dashboard=True starts an authenticated local loopback dashboard (install the dashboard extra first); pass a shared Dashboard() instance to reuse it across runs. No Modal or cloud cache is required.
until=True uses the final policy; until="draft" uses development thresholds; a dict can override target and controller settings. Diagnostics use every element of every monitored free variable and HMC sample statistics. check_convergence(idata, until=True) independently assesses a completed trace. Stopped runs include a final report when at least one complete post-warmup draw can be recovered.
See the quick start, sampler compatibility and stop lifecycle, convergence policies, dashboard guide, tested examples, API overview, and generated API reference. Quarto never executes examples during rendering; the sampler and browser suites provide acceptance coverage. Use start() with a context manager when you want to keep a dashboard open after sampling; sample() closes its resources before returning.
Metadata
Release files for pymc-monitor 0.1.0
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 | Actions |
|---|---|---|---|---|
| pymc_monitor-0.1.0.tar.gz | 368.1 kB | With provenance | Details for pymc_monitor-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pymc_monitor-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for pymc_monitor-0.1.0-py3-none-any.whl |
Total release size: 452.2 kB
Release files / pymc_monitor-0.1.0.tar.gz
| Download URL | pymc_monitor-0.1.0.tar.gz |
|---|---|
| Size | 368.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5c96830ae388f9734567cdd2923786dd8219dc378effb5faa41fbbf29f3225c5
|
|
BLAKE2b-256 checksum How to use checksums |
2066bb39d07aa20d7a8de4242850863df2b63711cdfab695c05f65c176a4d191
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logRelease files / pymc_monitor-0.1.0-py3-none-any.whl
| Download URL | pymc_monitor-0.1.0-py3-none-any.whl |
|---|---|
| Size | 84.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8f8fcd4ca14cc158a18a7d06f5f0752ea027d0e1f22cafd77421306af1732fcc
|
|
BLAKE2b-256 checksum How to use checksums |
54286fb8fd2d1acc738beacd613c05f07eeac2cc58f9029592e89bc58afb1165
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logSecurity for pymc-monitor 0.1.0
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for pymc_monitor-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logA 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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.