Skip to content

Guidelines

Until nahpu_dl is published, milu builds against a local copy of the NAHPU API checked out next to it.

  1. Install the latest stable Rust toolchain.

  2. Clone both repositories into the same parent directory.

    Terminal window
    git clone https://github.com/hhandika/milu.git
    Terminal window
    git clone https://github.com/nahpu/nahpu_api.git

    milu expects the NAHPU API at ../nahpu_api.

  3. Build and check milu.

    Terminal window
    cargo build --release

    Run milu --help to list all commands and options.

  • Use only data you have permission to share. Synthetic or anonymized samples are welcome for examples and tests.
  • Keep a holdout set the model never sees during training, and evaluate it with milu test.
  • For tables, set the column to predict with -t and an identifier column with --id-column, so predictions can be traced back to specimens.
  • For NAHPU data packages, choose the label rank with --rank, for example genus.
  • Share the whole package directory: manifest.toml and its weight file.
  • Keep the manifest's provenance and metrics so others know where the model came from and how well it performed.
  • Run milu models info on the package before you share it.

milu is the command line front end. Changes to models, data loading, fine-tuning, or weight storage belong in nahpu_dl in the NAHPU API. Read the AGENTS.md file of each repository before you start. In short:

  • Rust edition 2024 in a Cargo workspace. Keep main.rs thin: argument parsing goes in cli/, and logic goes in core/.
  • Return Result and propagate errors with ?. Use anyhow with context in application code and thiserror in library crates. Avoid unwrap() outside tests.
  • Log with the log macros instead of println! in library code.
  • Build paths with Path::join so the code works on Linux, macOS, and Windows.
  • Keep dependencies minimal and aim for a single self-contained executable.
  • Document every public item, and put unit tests next to the code they test.

Before opening a pull request, run:

Terminal window
cargo fmt --all
Terminal window
cargo clippy --workspace --all-targets -- -D warnings
Terminal window
cargo test --workspace

When behavior changes for users, add an entry under "Upcoming Release" in CHANGELOG.md. See Become a contributor for other ways to help.