Skip to content

Installation

Hydronnx ships in two pieces, and you may need either or both:

  1. Two Rust CLIs, chelis-hydronnx-inspect and chelis-hydronnx-emit. You run these on an .onnx file ahead of time, before you build your Chelis program. The emit CLI is the build-time code generator behind the model-load surface: Chelis is ahead-of-time compiled, so a model is turned into importable .ch source ahead of time.
  2. The Hydronnx Chelis module surface, the module Hydronnx.<Name> files the emit CLI writes. These are ordinary Chelis source files; you add them to your reef project alongside any other .ch you write.

The two pieces are independent. The CLIs are Rust binaries with no Chelis dependency at install time, and an emitted .ch module compiles under chelis with no Hydronnx runtime.

Hydronnx is built and tested against a specific chelis release. The repo's reef.toml pins that compiler version. The emit CLI's output is chelis check, chelis test, and chelis prove clean under exactly that version. Mixing emitted .ch from one Hydronnx revision with a different chelis toolchain is not supported.

Hydronnx requires the chelis CLI on PATH. The emitted .ch is consumed by chelis check, chelis test, and chelis prove, and the worked example's acceptance test invokes the CLI directly. Consume the released tarball from the chelis releases for the pinned binary; do not build from source.

Hydronnx's Rust crate depends on chelis crates via path dependencies (../chelis/crates/chelis-ir, ../chelis/crates/chelis-types), so a from-source build needs both repos checked out as siblings:

Terminal window
cd /some/workspace
git clone https://github.com/Chelis-Lang/chelis
git clone https://github.com/Chelis-Lang/hydronnx
cd hydronnx
cargo build --release --bin chelis-hydronnx-inspect --bin chelis-hydronnx-emit

The two CLIs land in target/release/. Add that directory to your PATH, or invoke the binaries by absolute path. There is no cargo install flow: the path dependency on chelis blocks publishing to crates.io until chelis itself is published.

You can also invoke either CLI through cargo run:

Terminal window
cargo run --release --bin chelis-hydronnx-inspect -- path/to/model.onnx
cargo run --release --bin chelis-hydronnx-emit -- path/to/model.onnx -o out.ch

Both forms are equivalent; the released binary is faster to launch.

The release-gate flow attaches a tarball and a .chb bundle to the GitHub release. The tarball contains the prebuilt CLIs for use without a chelis source checkout. A cargo install --git flow is not supported, for the reason above.

Adding Hydronnx-emitted modules to a Chelis project

Section titled “Adding Hydronnx-emitted modules to a Chelis project”

An emitted .ch is a normal Chelis module. There is no runtime dependency to declare in your reef.toml. A minimal project that uses one:

reef.toml
[package]
name = "my-project"
version = "<your project version>"
compiler = "=<pinned chelis version>"
module_prefix = "Hydronnx"
[dependencies]
# nothing Hydronnx-specific here.

The module_prefix = "Hydronnx" line matches the prefix the emit CLI puts on every module it generates (module Hydronnx.MyModel). The module-pascal-components lint allows Hydronnx as a known prefix.

Place the emitted file at the path that matches its module: module Hydronnx.MyModel lives at src/mymodel.ch. Reef matches the module ladder to the file path literally (lowercase, no underscores). The emit CLI's default output path already follows this rule.

The worked example at examples/tabular_classifier/ is a complete self-contained reef project showing this layout end to end.

Python environment (only for fixture generation)

Section titled “Python environment (only for fixture generation)”

The Python scripts in scripts/ regenerate the ONNX fixtures used by the test suite and the worked examples. A user emitting their own .onnx does not need Python. The Hydronnx CLIs are pure Rust.

If you want to regenerate or extend the fixtures, the repo uses a uv-managed venv:

Terminal window
python3 scripts/setup_env.py # creates .venv, installs onnx + numpy (once)
source .venv/bin/activate
python3 scripts/gen_fixtures.py

One-shot without setup: uv run --with onnx python3 scripts/gen_fixtures.py.

A quick health check that both CLIs are reachable:

Terminal window
chelis-hydronnx-inspect --help
chelis-hydronnx-emit --help

Both should print usage; a non-zero exit means the binary is not on PATH. Inspect a model:

Terminal window
chelis-hydronnx-inspect examples/tabular_classifier/iris_classifier.onnx

You should see a printed model inventory ending with a non-differentiable operators (0): section. See the CLI reference for the full output and Loading a model for the end-to-end walkthrough.