skillfed

pyro-ppl

A Python library for probabilistic modeling and inference

pyro-ppl v1.9.1 1.2M downloads/30d#4,186 on PyPI9,038
Permissive license Apache 2.0 Active released

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-ppl

uv

uv add pyro-ppl

poetry

poetry add pyro-ppl

Installing 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

Intended Audience :: DevelopersIntended Audience :: EducationIntended Audience :: Science/ResearchLicense :: OSI Approved :: Apache Software LicenseOperating System :: MacOS :: MacOS XOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

probabilistic programming pythonbayesian inference pytorchdeep generative modelsvariational inference libraryprobabilistic modeling framework
bayesian-inferenceprobabilistic-modelingpytorch-based

More Artificial Intelligence packages