python/ contains the Python-facing pieces of Aether: a PyO3 extension,
Python model backends, a distributed sidecar protocol, vLLM bridge helpers, and
tests that guard import-time behavior.
src/lib.rs: Rust package entry for the Python extension crate.extension-impl/: PyO3 implementation crate and embedded-Python initializer.python/aether/: importable Python package.python/aether/models/: CausalLM interface plus HF Transformers and Torchtitan backends.python/aether/sidecar/: TCPStore/process-group sidecar protocol and main loop.python/aether/vllm/: optional vLLM engine wrapper and Rust bridge registry.tests/: Python tests using stubs for heavy optional dependencies.stub/torch/: placeholder package used byuvbecause Nix supplies real Torch.
The top-level aether package lazily exposes:
- Rust extension objects such as
Trainer,DistroResult, andstart_process_watcher. - Model-source dataclasses and CausalLM factory helpers.
- Heavy dependencies only when the relevant module is imported.
HfAuto: Hugging Face Transformers backend.Torchtitan: Torchtitan-backed model implementation.
Both backends implement the shared causal LM interface and are selected by
make_causal_lm().
The sidecar is a Python worker used for distributed model operations. It initializes a Torch process group/TCPStore, receives operation messages, and handles training, optimization, extraction, BF16 truncation, forward passes, and shutdown.
The vLLM modules are optional. The bridge keeps a thread-safe registry of Python vLLM engines for Rust callers and exposes create, run, stats, list, and shutdown operations.
Run Python tests:
cd python
uv run --frozen --extra tests pytestRun Rust tests that link the Python/Torch extension:
bash scripts/with-libtorch-env.sh cargo test -p aether-python-extension
bash scripts/with-libtorch-env.sh cargo test -p aether-python-extension-impl- Python is pinned to
==3.12.*inpyproject.toml. transformers==4.57.3andflash-linear-attention==0.4.0are normal project dependencies.- Torch, Torchtitan, FlashAttention, and Liger are intentionally overridden/stubbed for
uv; Nix or the host environment provides them. extension-implsets a defaultTRITON_HOME=/tmp/aether-tritonbefore importing the Python package.