Skip to main content

Mujou

Asynchronous Distributed Deep Learning Library for Continuous Learning.

Test Type Check Format & Lint License: MIT Python 3.14

Mujou (無常, "impermanence") is a deep learning framework where inference and learning happen at the same time. You write nodes in PyTorch code and connect them into a network that runs in the background. Most models are trained once and then frozen; Mujou is for machines that keep learning from a stream, such as real-time systems and robots.

Status: early development (0.x). The API works but will still change; a minor release (0.x.0) may break it. See the changelog.

Key ideas

  • No epochs, no train/inference modes. A running network takes input, produces output and learns, all at once.
  • Synchronous inside, asynchronous outside. Each node computes synchronously in ordinary PyTorch code. Nodes never wait for each other; a node reads the latest value its neighbour sent.
  • One time axis per run. A node updates by an amount proportional to dt, the time since its last update, so nodes that update at different rates share one flow of time.
  • Any update rule. The rule is written inside the nodes: PC-ALM (Augmented Lagrangian Predictive Coding, the nodes of mujou.pc), which learns with updates local to each node, backpropagation kept inside one node, or a rule of your own.

Install

Mujou is on PyPI. It needs Python 3.14 or later; the free-threaded build 3.14t is recommended, because the nodes run on several threads at once.

uv add mujou       # in a uv project
pip install mujou  # or in a virtual environment with Python 3.14

Wheels are built for Linux (x86_64, aarch64), macOS (arm64) and Windows (x86_64), for both 3.14 and 3.14t. PyTorch is installed as a dependency. On other platforms, pip builds Mujou from the source, which needs a Rust toolchain (rustup). The installation guide also explains how to build from a clone of the repository.

Example

Two nodes compute y = 2x + 1 in the background; the program writes x and waits for y (examples/quickstart.py).

from typing import override

import torch

import mujou
from mujou import Network, Node, Port, TensorSpec

VECTOR = TensorSpec((3,))  # every message here is a float32 vector of 3


class Affine(Node):
    """Sends ``a * x + b``, where ``x`` is the latest input."""

    def __init__(self, a: float, b: float) -> None:
        super().__init__()
        self.a, self.b = a, b  # settings, not state
        self.prev = Port(recv=VECTOR)  # receives from the previous node
        self.next = Port(send=VECTOR)  # sends to the next node

    @override
    def on_update(self, dt: float) -> None:
        super().on_update(dt)
        self.next.send(self.a * self.prev.recv() + self.b)  # recv() never waits


class Pipeline(Network):
    """``x -> scale -> shift ->``: y = 2 x + 1."""

    def __init__(self) -> None:
        super().__init__()
        self.scale = Affine(2.0, 0.0)
        self.shift = Affine(1.0, 1.0)
        self.scale.next.connect(self.shift.prev)
        self.prev, self.next = self.scale.prev, self.shift.next  # exposed as its own


net = Pipeline()
x = torch.tensor([1.0, 2.0, 3.0])
# The nodes run on the run's worker threads until the end of the `with` block.
with mujou.run(net) as run:
    run.write({net.prev: x})
    # x takes a few updates to pass through the nodes: wait until y arrives, with
    # the time it was sent (TimeoutError after 5 s of real time).
    y, t = run.wait_for(net.next, lambda y: torch.equal(y, 2 * x + 1), timeout=5.0)
    assert t is not None  # None only for the zeros before the first send

print(f"y = {y} at t = {float(t):.3f} s")

More programs, from writing a node to learning MNIST with PC-ALM, are in examples/.

Documentation

The documentation is at https://geson-anko.github.io/mujou/ (English and Japanese). To serve it locally, run just docs (needs just) and open http://127.0.0.1:8000. You can also read the Markdown in docs/en/ (English) and docs/ja/ (Japanese).

Contributing

Issues and pull requests are welcome. See CONTRIBUTING.md for the development setup, the dev container, the commands and the rules.

License

MIT. See LICENSE.

Metadata

Release files for mujou 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mujou 0.1.0
File Size Uploaded Provenance Actions
mujou-0.1.0.tar.gz 160.0 kB With provenance Details for mujou-0.1.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for mujou 0.1.0
File Actions
mujou-0.1.0-cp314-cp314t-win_amd64.whl CPython 3.14 CPython 3.14 free-threading Windows x86-64 Details for mujou-0.1.0-cp314-cp314t-win_amd64.whl
mujou-0.1.0-cp314-cp314t-manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ x86-64 Details for mujou-0.1.0-cp314-cp314t-manylinux_2_28_x86_64.whl
mujou-0.1.0-cp314-cp314t-manylinux_2_28_aarch64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ ARM64 Details for mujou-0.1.0-cp314-cp314t-manylinux_2_28_aarch64.whl
mujou-0.1.0-cp314-cp314t-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 free-threading macOS 11.0+ ARM64 Details for mujou-0.1.0-cp314-cp314t-macosx_11_0_arm64.whl
mujou-0.1.0-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for mujou-0.1.0-cp314-cp314-win_amd64.whl
mujou-0.1.0-cp314-cp314-manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64 Details for mujou-0.1.0-cp314-cp314-manylinux_2_28_x86_64.whl
mujou-0.1.0-cp314-cp314-manylinux_2_28_aarch64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ ARM64 Details for mujou-0.1.0-cp314-cp314-manylinux_2_28_aarch64.whl
mujou-0.1.0-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details for mujou-0.1.0-cp314-cp314-macosx_11_0_arm64.whl

Total release size: 4.5 MB

Release files / mujou-0.1.0.tar.gz

Download URL mujou-0.1.0.tar.gz
Size 160.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b7402c7d5263bc79346e9059ad030a6a58f32478c43464fa8d4912a86b7be028
BLAKE2b-256 checksum
How to use checksums
20cbe457007bf16cf43013f65db18c60526ec60df0959263ada2bd4731bed528
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / mujou-0.1.0-cp314-cp314t-win_amd64.whl

Download URL mujou-0.1.0-cp314-cp314t-win_amd64.whl
Size 427.2 kB
Tags CPython 3.14 CPython 3.14 free-threading Windows x86-64
SHA-256 checksum
How to use checksums
3d180a26668b01616c5ac7a2866ae4ca9f82ad0c33914adc2a31d8ffe039db46
BLAKE2b-256 checksum
How to use checksums
8d24f7b8b65d33016db8a506e0180ff0b354a9482d9cd945d22fcd8f371e283e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / mujou-0.1.0-cp314-cp314t-manylinux_2_28_x86_64.whl

Download URL mujou-0.1.0-cp314-cp314t-manylinux_2_28_x86_64.whl
Size 604.2 kB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
5dfff5ce2f590758a7828e4084d85485587644844144373012ce392bcf9f6a88
BLAKE2b-256 checksum
How to use checksums
5b7702dc85b961ed1567b63fb1d8e9cdae0e909ea90b51544f18574034e61381
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / mujou-0.1.0-cp314-cp314t-manylinux_2_28_aarch64.whl

Download URL mujou-0.1.0-cp314-cp314t-manylinux_2_28_aarch64.whl
Size 604.5 kB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
0dc5e0946d5a9974efcd27bf098f846070b5dc853d815e4e7ca0da48e9576c01
BLAKE2b-256 checksum
How to use checksums
a3f6609b0147ed5a9e2a335b8d6275b72dd7731af079e93ca8d0df15c46a331c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / mujou-0.1.0-cp314-cp314t-macosx_11_0_arm64.whl

Download URL mujou-0.1.0-cp314-cp314t-macosx_11_0_arm64.whl
Size 551.9 kB
Tags CPython 3.14 CPython 3.14 free-threading macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
57970315ac0bc45bc617bfe6be03e57ed6fbe90df94780996dc8f25e9c6c87fa
BLAKE2b-256 checksum
How to use checksums
26d623629337b4e21973fac2e55ff5ad96a467fca41c3db4c2ad6aece5856de3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / mujou-0.1.0-cp314-cp314-win_amd64.whl

Download URL mujou-0.1.0-cp314-cp314-win_amd64.whl
Size 428.6 kB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
cbdd5314b6b120aafc6c37e4100c18ca8b48ecaa6e9efda2652a14047a01da06
BLAKE2b-256 checksum
How to use checksums
d41064d155aa2c98b2e9a835643cdbdcd180276a648ebee660f14ec9a6ca9662
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / mujou-0.1.0-cp314-cp314-manylinux_2_28_x86_64.whl

Download URL mujou-0.1.0-cp314-cp314-manylinux_2_28_x86_64.whl
Size 606.4 kB
Tags CPython 3.14 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
a20be5909a0d8705b9786d54fd1d7f42449a3dbe981440b5fbca551b6f4586c1
BLAKE2b-256 checksum
How to use checksums
e8c3f7085056e689bd0f3d4349738be2763a009733a38a3f24d299ed716fc7e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / mujou-0.1.0-cp314-cp314-manylinux_2_28_aarch64.whl

Download URL mujou-0.1.0-cp314-cp314-manylinux_2_28_aarch64.whl
Size 607.5 kB
Tags CPython 3.14 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
09e032325a9f7589b73181d138480f83bf78f736f3587a83fea76756ea139e80
BLAKE2b-256 checksum
How to use checksums
8d6c9a41fc4e8855e4d068dc2558ab5a73a3cad5d17ca28348c71c97b113c488
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / mujou-0.1.0-cp314-cp314-macosx_11_0_arm64.whl

Download URL mujou-0.1.0-cp314-cp314-macosx_11_0_arm64.whl
Size 550.5 kB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e9383f6464a3c11e5afba1751d2fb63dbbce7f0d6d4effa487a30b3b11c8fe86
BLAKE2b-256 checksum
How to use checksums
831c86bbf29800a69508f60e115e69077b2d5ffeaca0ea32221ed3d29a95a565
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Security for mujou 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 9 files in this release have been uploaded with provenance metadata.

Select from 9 files

Attestation for mujou-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

9 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page