Registry / ai-ml / nutpie

nutpie

JSON →
library0.16.10pypypi✓ verified 79d ago

Nutpie is a Python library designed to sample Stan or PyMC models efficiently, leveraging JAX for high-performance computation. It provides an alternative MCMC sampler for probabilistic programming models, aiming for speed and robustness. The current version is 0.16.8, and it maintains a frequent release cadence, often with minor bug fixes, dependency updates, and feature enhancements.

pip install nutpie
INSTALL
IMPORT
SIG · NUTPIE
N
nutpie
ai-mlpythonv0.16.10
Install
19.8s avg
Import
Disk
583MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.15.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
build_error
glibc
py 3.103.910 runs
installs and imports cleanly · install 19.8s · import 0.000s · 566MB
583MB installed
● package 583MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

sample
from nutpie import sample
import nutpie; nutpie.sample(...)

This example demonstrates how to define a basic PyMC model and then use `nutpie.sample()` to perform MCMC sampling. The results are returned in an `arviz.InferenceData` object.

import pymc as pm import nutpie as np # Define a simple PyMC model with pm.Model() as model: # Priors mu = pm.Normal('mu', mu=0, sigma=1) sigma = pm.HalfNormal('sigma', sigma=1) # Likelihood obs = pm.Normal('obs', mu=mu, sigma=sigma, observed=[1.0, 2.0, 3.0]) # Sample the model using Nutpie print("Starting Nutpie sampling...") idata = np.sample(model) print("Sampling complete. InferenceData:\n", idata)
Debug
Known issues
gotchaOlder versions of Nutpie (pre-0.16.7) might encounter compatibility issues when sampling PyMC models that heavily utilize `pymc.dims`. Ensure you are on a recent version for full `pymc.dims` support.
fix
Upgrade Nutpie to version 0.16.7 or newer: `pip install --upgrade nutpie`
affects: <0.16.7
gotchaNutpie versions prior to 0.16.5 had a bug affecting compatibility with pandas 3.0 for string coordinates. If you use pandas 3.0 or later with models containing string coordinates, you might encounter errors.
fix
Upgrade Nutpie to version 0.16.5 or newer: `pip install --upgrade nutpie`
affects: <0.16.5
gotchaThe `mindepth` parameter when `check_turning=True` was misbehaving in versions before 0.16.3. This could lead to incorrect or inefficient sampling behavior under specific configurations.
fix
Upgrade Nutpie to version 0.16.3 or newer to ensure correct `mindepth` behavior: `pip install --upgrade nutpie`
affects: <0.16.3
breakingStarting from v0.16.0, step size jitter is enabled by default during NUTS sampling. This changes the default behavior, potentially leading to slightly different sampling paths compared to previous versions where it was disabled by default.
fix
If you rely on the previous behavior without step size jitter, you can explicitly disable it by passing appropriate arguments to `nutpie.sample()` (e.g., `init_strategy='advi_map'` or setting `step_size_jitter` to 0 if an option is exposed, refer to docs).
affects: >=0.16.0
Upgrade
Version history
0.16.10latest on PyPI · released May 11, 2026
Audit
Dependencies
pymcrequiredRequired for defining probabilistic models; Nutpie acts as an alternative sampler for PyMC models.
jaxrequiredUsed as the backend for high-performance computation and compilation.
Agent activity
15 hits · last 30 days
node
12
Amazon
1
Resources
nutpie — pip install nutpie · libregistry