{"id":9993,"library":"nutpie","title":"Nutpie for Stan or PyMC Models","description":"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.","status":"active","version":"0.16.8","language":"python","source_language":"en","source_url":"https://github.com/pymc-devs/nutpie","tags":["MCMC","sampling","Bayesian inference","PyMC","JAX","probabilistic programming"],"install":[{"cmd":"pip install nutpie","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Required for defining probabilistic models; Nutpie acts as an alternative sampler for PyMC models.","package":"pymc","optional":false},{"reason":"Used as the backend for high-performance computation and compilation.","package":"jax","optional":false}],"imports":[{"wrong":"import nutpie; nutpie.sample(...)","symbol":"sample","correct":"from nutpie import sample"}],"quickstart":{"code":"import pymc as pm\nimport nutpie as np\n\n# Define a simple PyMC model\nwith pm.Model() as model:\n    # Priors\n    mu = pm.Normal('mu', mu=0, sigma=1)\n    sigma = pm.HalfNormal('sigma', sigma=1)\n    \n    # Likelihood\n    obs = pm.Normal('obs', mu=mu, sigma=sigma, observed=[1.0, 2.0, 3.0])\n\n# Sample the model using Nutpie\nprint(\"Starting Nutpie sampling...\")\nidata = np.sample(model)\n\nprint(\"Sampling complete. InferenceData:\\n\", idata)","lang":"python","description":"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."},"warnings":[{"fix":"Upgrade Nutpie to version 0.16.7 or newer: `pip install --upgrade nutpie`","message":"Older 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.","severity":"gotcha","affected_versions":"<0.16.7"},{"fix":"Upgrade Nutpie to version 0.16.5 or newer: `pip install --upgrade nutpie`","message":"Nutpie 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.","severity":"gotcha","affected_versions":"<0.16.5"},{"fix":"Upgrade Nutpie to version 0.16.3 or newer to ensure correct `mindepth` behavior: `pip install --upgrade nutpie`","message":"The `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.","severity":"gotcha","affected_versions":"<0.16.3"},{"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).","message":"Starting 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.","severity":"breaking","affected_versions":">=0.16.0"}],"env_vars":null,"search_vec":"'0.16.8':46 'aim':37 'altern':30 'bayesian':66 'bug':57 'cadenc':53 'comput':26 'current':43 'depend':59 'design':12 'effici':19 'enhanc':63 'featur':62 'fix':58 'frequent':51 'high':24 'high-perform':23 'infer':67 'jax':21,69 'leverag':20 'librari':11 'maintain':49 'mcmc':31,64 'minor':56 'model':6,18,36 'nutpi':1,7 'often':54 'perform':25 'probabilist':34,70 'program':35,71 'provid':28 'pymc':5,17,68 'python':10 'releas':52 'robust':41 'sampl':14,65 'sampler':32 'speed':39 'stan':3,15 'updat':60 'version':44","created_at":"2026-04-17T01:21:50.162676+00:00","updated_at":"2026-04-17T01:21:50.162676+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.16.10","cli_name":"","cli_version":null,"type":"library","homepage":"https://pymc-devs.github.io/nutpie/","github":"https://github.com/pymc-devs/nutpie","docs":null,"changelog":null,"pypi":"https://pypi.org/project/nutpie/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml","data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-08-02","install_tag":null}}