pyro-ppl
A Python library for probabilistic modeling and inference
What it is and what it does
Pyro is a probabilistic programming library that lets you express Bayesian models and perform inference on them using PyTorch as its computational backbone. It abstracts away the complexity of building custom inference algorithms by providing high-level primitives for sampling, conditioning, and inference, while still allowing expert users to customize inference strategies when needed.
The library is designed around the principle that you write generative models as ordinary Python functions, then use Pyro's inference engines to fit those models to data. It handles both discrete and continuous random variables, supports automatic differentiation for gradient-based inference, and scales to large datasets. The five core runtime dependencies (numpy, opt-einsum, pyro-api, torch, tqdm) keep the footprint minimal while providing the numerical and progress-tracking infrastructure needed for practical probabilistic modeling.
Use it for:
- Build Bayesian regression or classification models where you need posterior distributions over parameters, not just point estimates.
- Perform approximate inference on complex generative models using variational inference or other automated inference strategies.
- Design and run experimental designs or sensitivity analyses by sampling from posterior predictive distributions.
- Model time-to-event data or other censored observations in survival analysis or reliability engineering.
- Prototype custom probabilistic models for scientific research without writing low-level inference code from scratch.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Pyro is a deep probabilistic programming library built on PyTorch that enables you to define, fit, and sample from arbitrary probability distributions using composable abstractions for generative and inference models.
Yes. Pyro is actively maintained, has no known vulnerabilities, installs with low friction, and is licensed permissively. It is the right choice if you need to build or fit probabilistic models in Python and want a mature, well-documented framework that abstracts away inference complexity while remaining flexible for expert customization.
Install
pyro-ppl on PyPI
pip
pip install pyro-ppluv
uv add pyro-pplpoetry
poetry add pyro-pplInstalling pyro-ppl
Before you install
Installation is straightforward with low friction—the package is a pure Python wheel with five runtime dependencies (numpy, opt-einsum, pyro-api, torch, tqdm). Maintenance is active; the repository shows recent commits and the project is backed by community contributors including a team at the Broad Institute.
License in practice
Licensed under Apache 2.0 (permissive), so you can use Pyro in commercial and proprietary projects without restriction, though you must include a copy of the license.
Quickstart
pip install pyro-ppl
import pyro
import pyro.distributions as dist
def model():
x = pyro.sample('x', dist.Normal(0, 1))
return x
Requires torch as a runtime dependency; ensure torch is available in your environment.
Verify before relying
- Whether the package's inference algorithms scale efficiently to the specific data sizes and model complexity you plan to use.
- Performance characteristics and memory overhead compared to hand-written code for your particular use case.
Package facts
| License | Apache 2.0 (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — numpy, opt-einsum, pyro-api, torch, tqdm |
| Maintenance | actively maintained — 803 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,232,081/month — #4,186 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyro_ppl-1.9.1-py3-none-any.whl
Keywords: machine, learning, statistics, probabilistic, programming, bayesian, modeling, pytorch
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
amalgam-langAmalgam is a Python wrapper that lets you call…
agpl · top 15,000 on PyPI
pyro-apiProvides a generic dispatch API for…
permissive · top 5,000 on PyPI
zukoZuko implements normalizing flows in PyTorch as…
permissive · top 15,000 on PyPI
numpyroNumPyro is a probabilistic programming library…
permissive · top 15,000 on PyPI
botorchBoTorch provides a modular, PyTorch-based…
permissive · top 5,000 on PyPI
tensorflow-probabilityTensorFlow Probability provides probabilistic…
permissive · top 5,000 on PyPI
problogProbLog is a probabilistic logic programming…
permissive · top 15,000 on PyPI
pyjptpyjpt learns and reasons about joint…
unclear · top 15,000 on PyPI
gluontsGluonTS provides deep learning models for…
permissive · top 5,000 on PyPI
Pyro4Pyro4 enables Python objects to communicate…
permissive · top 15,000 on PyPI