Set up the tools
Section titled “Set up the tools”Until nahpu_dl is published, milu builds against a local copy of the NAHPU API checked out next to it.
Install the latest stable Rust toolchain.
Clone both repositories into the same parent directory.
Terminal window git clone https://github.com/hhandika/milu.gitTerminal window git clone https://github.com/nahpu/nahpu_api.gitmilu expects the NAHPU API at
../nahpu_api.Build and check milu.
Terminal window cargo build --releaseRun
milu --helpto list all commands and options.
Prepare data
Section titled “Prepare data”- 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
-tand 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 examplegenus.
Share a model
Section titled “Share a model”- Share the whole package directory:
manifest.tomland its weight file. - Keep the manifest's
provenanceandmetricsso others know where the model came from and how well it performed. - Run
milu models infoon the package before you share it.
Contribute code
Section titled “Contribute code”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.rsthin: argument parsing goes incli/, and logic goes incore/. - Return
Resultand propagate errors with?. Useanyhowwith context in application code andthiserrorin library crates. Avoidunwrap()outside tests. - Log with the
logmacros instead ofprintln!in library code. - Build paths with
Path::joinso 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:
cargo fmt --allcargo clippy --workspace --all-targets -- -D warningscargo test --workspaceWhen behavior changes for users, add an entry under "Upcoming Release" in CHANGELOG.md. See Become a contributor for other ways to help.