skillfed

pyro-api

Generic API for dispatch to Pyro backends.

pyro-api v0.1.2 1.2M downloads/30d#4,199 on PyPI16
Permissive license Apache License 2.0 Abandoned released

What it is and what it does

Pyro API is a thin abstraction layer for probabilistic programming that lets you write models and inference code once and dispatch them to different Pyro backends—such as funsor or numpyro—without rewriting. It defines a generic interface for handlers, distributions, and other core components, then routes calls to whichever backend you register at runtime.

The package itself has no runtime dependencies and is designed primarily for testing backend implementations. You register a backend using a context manager, then run your models and tests against it. This is useful if you're building a new Pyro backend or need to validate that your models work across multiple inference engines, but it's a library for framework developers rather than end users.

Use it for:

  • Test a new Pyro backend implementation against a standard suite of models in pyro_api.testing
  • Write probabilistic models that can switch between backends (e.g., funsor and numpyro) at runtime
  • Validate backend compatibility by running the same inference code against multiple Pyro implementations
  • Build a wrapper around a custom Pyro backend and expose it through the standard pyro_api interface

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides a generic dispatch API for probabilistic programming backends, allowing code to run against different Pyro implementations without modification.

No—unless you are actively developing or maintaining a Pyro backend. The package is abandoned (last commit 2022-02-13), has no runtime dependencies so it's not a burden to remove, but offers no value to users of existing backends. If you need probabilistic programming, install a specific backend (funsor, numpyro) directly.

Install

pyro-api on PyPI

pip

pip install pyro-api

uv

uv add pyro-api

poetry

poetry add pyro-api

Installing pyro-api

Before you install

Installation is frictionless with no runtime dependencies. However, the package is abandoned—last release was 2020-05-15 and last commit 2022-02-13—so expect no maintenance, bug fixes, or updates.

License in practice

Licensed under Apache License 2.0 (permissive), so you can use, modify, and distribute the package freely in commercial and private projects with minimal restrictions.

Quickstart

pip install pyro-api

from pyro_api.dispatch import pyro_backend
from pyro_api.testing import MODELS

with pyro_backend(handlers='my_backend.handlers', distributions='my_backend.distributions'):
    for model_name in MODELS:
        f = MODELS[model_name]()
        model, model_args = f['model'], f.get('model_args', ())
        model(*model_args)

Requires a registered Pyro backend (e.g., funsor or numpyro) to be installed and importable; the package itself provides only the dispatch interface.

Verify before relying

  • Whether the package remains compatible with modern Pyro backends (funsor, numpyro) given its abandonment since 2022
  • Whether Python 3.6 support claim is current or whether the package works on modern Python versions

Package facts

License Apache License 2.0 (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance abandoned — 2,282 days since the last release
Last repo commit
First released
Downloads 1,223,131/month — #4,199 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pyro_api-0.1.2-py3-none-any.whl

Keywords: probabilistic, machine, learning, bayesian, statistics

Intended Audience :: DevelopersIntended Audience :: EducationIntended Audience :: Science/ResearchLicense :: OSI Approved :: Apache Software LicenseOperating System :: MacOS :: MacOS XOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3.6

Tags

probabilistic programming dispatchpyro backend abstractionbayesian inference apigeneric pyro interfacebackend-agnostic modelingprobabilistic model testingpyro abstraction layer
probabilistic-programmingbackend-abstractiontesting-framework

More Artificial Intelligence packages