zuko
Normalizing flows in PyTorch
Decision gist · record as of 2026-08-14
Yes. Zuko fills a genuine need in PyTorch's probabilistic modeling ecosystem—making normalizing flows trainable and GPU-compatible. It is actively maintained, has no known vulnerabilities, low install friction, and a permissive MIT license. Install it if you need conditional probability distributions or flow-based generative models in PyTorch.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later and PyTorch installed.
- Low friction: pure Python wheel with only numpy and torch as runtime dependencies.
- Active maintenance with a release 157 days ago and ongoing repository activity.
License · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution in commercial and private projects without warranty.
last release 2026-03-10 (157 days) · last repo commit 2026-03-10 · 467 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 76,257 downloads/mo, #14,640 on PyPI
Alternatives
Verify before relying
pip install zuko
import torch
import zuko
flow = zuko.flows.NSF(3, 5, transforms=3, hidden_features=[128] * 3)
optimizer = torch.optim.Adam(flow.parameters(), lr=1e-3)
for x, c in trainset:
loss = -flow(c).log_prob(x)
optimizer.zero_grad()
loss.backward()
optimizer.step()- Whether the package supports GPU acceleration beyond PyTorch's standard .to() mechanism.
- Performance characteristics and scalability limits for large-dimensional flows.
- Availability and completeness of tutorials for each flow type listed in the documentation.
What it is and what it does
Zuko bridges a gap in PyTorch's probabilistic modeling: the built-in Distribution and Transform classes cannot be sent to GPU or treated as trainable modules. Zuko wraps these concepts in LazyDistribution and LazyTransform—modules whose forward pass returns a distribution or transformation—enabling conditional probability modeling and normalizing flows to work seamlessly within PyTorch's training pipeline.
The package provides a suite of flow architectures (NSF, RealNVP, MAF, NICE, and others) that can be instantiated with configurable hyperparameters and trained end-to-end. It also supports custom flows built from individual components like masked autoregressive transforms and rotation transforms, making it suitable for both standard use cases and research-driven extensions.
Use it for
- Train a neural spline flow to model complex conditional distributions for density estimation or variational inference tasks.
- Build custom generative models by composing flow components like masked autoregressive transforms and base distributions.
- Implement probabilistic inference pipelines where conditional distributions must be parameterized by neural networks.
- Experiment with different normalizing flow architectures (RealNVP, MAF, NSF, etc.) for research or production density modeling.
- Sample from learned conditional distributions p(x|c) after training a flow on paired data.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Zuko fills a genuine need in PyTorch's probabilistic modeling ecosystem—making normalizing flows trainable and GPU-compatible. It is actively maintained, has no known vulnerabilities, low install friction, and a permissive MIT license. Install it if you need conditional probability distributions or flow-based generative models in PyTorch.
Install
zuko on PyPI
Before you install
Low friction: pure Python wheel with only numpy and torch as runtime dependencies. Active maintenance with a release 157 days ago and ongoing repository activity.
Requires Python 3.10 or later and PyTorch installed.
License in practice
MIT license permits unrestricted use, modification, and distribution in commercial and private projects without warranty.
Quickstart
pip install zuko
import torch
import zuko
flow = zuko.flows.NSF(3, 5, transforms=3, hidden_features=[128] * 3)
optimizer = torch.optim.Adam(flow.parameters(), lr=1e-3)
for x, c in trainset:
loss = -flow(c).log_prob(x)
optimizer.zero_grad()
loss.backward()
optimizer.step()
Verify before relying
- Whether the package supports GPU acceleration beyond PyTorch's standard .to() mechanism.
- Performance characteristics and scalability limits for large-dimensional flows.
- Availability and completeness of tutorials for each flow type listed in the documentation.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesnumpytorch |
| Maintenance | Actively maintained 157 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 76,257 / month, #14,640 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: DevelopersIntended Audience :: Science/ResearchNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3 |
Evidence: zuko-1.6.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “normalizing flows pytorch”
- zukoZuko implements normalizing flows in PyTorch as trainable neural…
- torchvizGenerates visual diagrams of PyTorch neural network computation…
- torchinfoGenerates detailed summaries of PyTorch neural network models,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.
Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.
Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.
Install it if you work with Hugging Face Hub models or datasets.
LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.
hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.
Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.
Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.
Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.
See also pyro-ppl · torch · pytorchcv · torchsde · gpytorch · opacus · pytorch · pytorch-forecasting · torch-optimizer · pytorch_optimizer