nnrp-rs
nnrp-rs is the Rust canonical SDK workspace for NNRP Preview3. NNRP is a domain-level application-layer protocol for long-lived, real-time AI model runtime communication: session lifecycle, flow control, cache/schema negotiation, recovery, transport selection, and typed payload exchange live above TCP/QUIC/Web transports.
This repository is intended to be the implementation source for Rust users and for downstream language bindings.
What Ships Here
| Package | Purpose |
|---|---|
nnrp-core |
Wire codecs, strict validation, protocol enums/errors, lifecycle state machines, cache/schema semantics, recovery, and conformance-facing core types. |
nnrp-runtime |
Transport-neutral async client/server session runtime over framed transport slots. |
nnrp-transport-provider |
Provider registry, local/remote capability intersection, native library discovery, policy resolution, and probe-score selection. |
nnrp-transport-tcp |
TCP provider package for runtime transport/listener slots. |
nnrp-transport-quic |
Default Quinn/Rustls QUIC provider, certificate config helpers, and injection hooks for custom backends. |
nnrp-ffi |
C-compatible ABI facade, handle/event model, header surface, and native link-library packaging. |
nnrp-wasm |
Low-level WASM primitives and TypeScript declarations for future nnrp-js wrappers. |
nnrp-conformance |
Rust-owned golden vectors, fixture manifests, adapter wrappers, and conformance export helpers. |
Install
After the Preview3 crates are published, choose only the pieces your application needs:
[]
= "1.0.0-preview.3"
= "1.0.0-preview.3"
= "1.0.0-preview.3"
# Optional packages
= "1.0.0-preview.3"
= "1.0.0-preview.3"
= "1.0.0-preview.3"
= "1.0.0-preview.3"
For repository builds before publishing:
[]
= { = "https://github.com/NagareWorks/nnrp-rs", = "nnrp-runtime" }
= { = "https://github.com/NagareWorks/nnrp-rs", = "nnrp-transport-tcp" }
Runtime Shape
use ;
# async
TCP is available as a provider package. QUIC is also available out of the box through nnrp-transport-quic using Quinn/Rustls, while the runtime still exposes framed transport/listener slots for deployments that need native, WASM-facing, or platform-specific QUIC backends.
Native And WASM Artifacts
Native link libraries are for C#/Python/Unity and Node.js backend native-addon scenarios:
python scripts\package_native_artifacts.py --out artifacts\native
WASM primitives are for future nnrp-js wrapping. Node.js should probe native libraries first and fall back to WASM when native loading is unavailable; browsers consume WASM plus WebSocket/WebTransport adapters from the JS/TS layer.
rustup target add wasm32-unknown-unknown
python scripts\package_wasm_primitives.py --out artifacts\wasm
Workspace Layout
crates/: Rust crates listed above.include/nnrp/: C ABI headers for native consumers.scripts/: native and WASM packaging helpers.doc/todo/: Preview3 implementation planning and rollout checklists.
Quality Gates
Before commits, the Rust workspace is expected to pass:
cargo fmt --all --check
cargo test --workspace
cargo clippy --workspace --all-targets -- -D warnings
cargo llvm-cov --workspace --lcov --output-path target\llvm-cov\lcov.info
The current project rule is 90%+ total line coverage and 90%+ incremental line coverage for every commit.
Documentation
- Protocol and SDK docs: https://nagareworks.github.io/nnrp-doc/
- Rust SDK docs: https://nagareworks.github.io/nnrp-doc/en/sdk/rust/
- Conformance docs: https://nagareworks.github.io/nnrp-doc/en/conformance/
License
Apache-2.0. See LICENSE.