Skip to content
Back to skills

Pyro

ASecurity

"Use Pyro probabilistic programming APIs for models, distributions,

  • 247 stars
  • 0 votes
  • 0 copies
  • 6 views
  • Added September 9, 2026
datapythonbashdockerdebuggingapibackenddocumentation

Works with

  • api

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 20 files and shows the line behind each finding

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill pyro --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Pyro?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Pyro
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-pyro/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-pyro)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: pyro
description: "Use Pyro probabilistic programming APIs for models, distributions,
  SVI, MCMC, poutine, enumeration, and contrib workflows."
disable-model-invocation: true
metadata:
  disco-role: operating
license: Apache 2.0
---

# Pyro Repo Skill

Use this repo skill when the task involves the `pyro-ppl` package imported as
`pyro`: probabilistic models, distributions, stochastic variational inference,
HMC/NUTS/MCMC, posterior prediction, poutine effect handlers, discrete
enumeration, reparameterizers, `PyroModule`, or Pyro contributed modules.

This skill targets the Pyro 1.9.1 API family. It is self-contained for package
use; do not depend on a source checkout, original examples, original tests, or
notebooks at runtime.

## Install and Import Check

Pyro's distribution name is `pyro-ppl` and the import name is `pyro`:

```bash
python -m pip install pyro-ppl
python - <<'PY'
import pyro, torch
print(pyro.__version__)
print(torch.__version__, torch.cuda.is_available())
PY
```

For a safe diagnostic that also reports optional integrations, run
[scripts/check_pyro_environment.py](scripts/check_pyro_environment.py). Start
with `python scripts/check_pyro_environment.py --help`; use `--smoke` to run a
tiny CPU SVI check.

## Route by Task

- Basic stochastic functions, `pyro.sample`, `pyro.param`, observed sites,
  `pyro.plate`, parameter-store state, validation, RNG seeds, `PyroModule`,
  `PyroParam`, and `PyroSample`: read
  [sub-skills/modeling-basics/SKILL.md](sub-skills/modeling-basics/SKILL.md).
- Distribution selection, constraints/transforms, `.to_event()`, `Independent`,
  HMM/zero-inflated/stable/matching distributions, and event/batch/plate shape
  debugging: read
  [sub-skills/distributions-and-shapes/SKILL.md](sub-skills/distributions-and-shapes/SKILL.md).
- SVI training loops, ELBO choice, autoguides, Pyro optimizers, vanilla PyTorch
  optimizer loops, minibatching, JIT/vectorized particles, and SVI
  troubleshooting: read
  [sub-skills/svi-and-autoguides/SKILL.md](sub-skills/svi-and-autoguides/SKILL.md).
- HMC/NUTS/MCMC runs, initialization, warmup/sample/chain choices, diagnostics,
  `Predictive`, `WeighedPredictive`, and posterior/prior predictive shapes:
  read
  [sub-skills/mcmc-and-prediction/SKILL.md](sub-skills/mcmc-and-prediction/SKILL.md).
- Poutine handlers, trace/condition/replay/block/scale/mask/seed/substitute,
  discrete enumeration, `TraceEnum_ELBO`, `infer_discrete`, `config_enumerate`,
  reparameterizers, and inference-tied `pyro.ops`: read
  [sub-skills/effect-handlers-and-enumeration/SKILL.md](sub-skills/effect-handlers-and-enumeration/SKILL.md).
- `pyro.contrib`, MiniPyro/generic backend, forecasting, GP, epidemiology,
  tracking, easyguide, CEVAE, Funsor, Horovod, Lightning, domain examples, and
  optional dependency policy: read
  [sub-skills/contrib-and-domain-workflows/SKILL.md](sub-skills/contrib-and-domain-workflows/SKILL.md).

For a compact root API map and verified signature highlights, read
[references/api-cheatsheet.md](references/api-cheatsheet.md). For install/import,
backend, optional dependency, validation, and routing failures, read
[references/troubleshooting.md](references/troubleshooting.md). For staleness
checks against a repository checkout, read
[references/repo-provenance.md](references/repo-provenance.md).

## Fast Decision Rules

1. If the user has an error, ask first for the Pyro version, PyTorch version,
   CPU/CUDA backend, and a minimal model/guide snippet unless already present.
2. Turn on validation while debugging: `pyro.enable_validation(True)`.
3. Clear parameter state between independent experiments:
   `pyro.clear_param_store()`.
4. For any shape or plate problem, trace the model and inspect
   `trace.format_shapes()` before changing model structure.
5. Do not use HMC/NUTS directly on discrete latent variables. Enumerate,
   marginalize, or use another inference strategy.
6. Treat CUDA, Funsor, Horovod, Lightning, Graphviz, torchvision, pandas,
   scanpy, and long example/tutorial dependencies as optional until the user's
   active environment proves support.
7. Prefer tiny synthetic tensors and this skill's bundled smoke scripts before
   attempting long training, downloads, plotting, or GPU-specific runs.

## What Not to Use This Skill For

- Generic PyTorch training that does not use Pyro primitives or distributions.
- PyMC, NumPyro, Bean Machine, Stan, or TensorFlow Probability code unless the
  task is explicitly translating concepts to Pyro.
- Full scientific reproduction of every Pyro tutorial/example; use this skill
  to implement or debug the package workflow, then request task-specific data,
  runtime, and budget.
- Maintainer release, benchmark, profiling, Docker, or documentation-build work
  unless the user explicitly asks to edit the Pyro repository.

Files in this skill

  • SKILL.md4.7 KB
  • references/api-cheatsheet.md5.5 KB
  • references/repo-provenance.md2.8 KB
  • references/repo-routing-metadata.json329 B
  • references/troubleshooting.md6.3 KB
  • scripts/check_pyro_environment.py5.6 KB
  • sub-skills/contrib-and-domain-workflows/SKILL.md5.4 KB
  • sub-skills/contrib-and-domain-workflows/references/contrib-module-map.md12.7 KB
  • sub-skills/contrib-and-domain-workflows/references/domain-workflows.md14 KB
  • sub-skills/contrib-and-domain-workflows/references/optional-integrations.md9.5 KB
  • sub-skills/contrib-and-domain-workflows/references/troubleshooting.md11.4 KB
  • sub-skills/distributions-and-shapes/SKILL.md4 KB
  • sub-skills/distributions-and-shapes/references/distribution-catalog.md13.8 KB
  • sub-skills/distributions-and-shapes/references/shapes-and-plates.md11.9 KB
  • sub-skills/distributions-and-shapes/references/troubleshooting.md17.6 KB
  • sub-skills/effect-handlers-and-enumeration/SKILL.md5.4 KB
  • sub-skills/effect-handlers-and-enumeration/references/effect-handler-workflows.md12.2 KB
  • sub-skills/effect-handlers-and-enumeration/references/enumeration-and-reparameterization.md19.9 KB
  • sub-skills/effect-handlers-and-enumeration/references/troubleshooting.md13.6 KB
  • sub-skills/effect-handlers-and-enumeration/scripts/enumeration_trace_smoke.py5.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.