NeMo Relay Native Plugin SDK
nemo-relay-plugin is the Rust authoring SDK and stable ABI for trusted,
in-process NeMo Relay dynamic plugins. Use it to build a Rust cdylib that
Relay loads through the versioned native plugin interface.
Native plugins run in the Relay process and are not sandboxed. They should
depend on this crate rather than the host nemo-relay runtime crate, keeping
the dynamic-library boundary on the stable C-compatible ABI.
Why Use It?
- Author native plugins safely: Implement
NativePluginwith typed Rust callbacks instead of constructing ABI tables directly. - Register real runtime behavior: Use
PluginContextfor subscribers, guardrails, and intercepts. - Keep a stable boundary: Export one versioned native entry point through
the
nemo_relay_plugin!macro. - Use host runtime helpers: Emit events and manage scope state through the
high-level
PluginRuntimewrapper.
What You Get
NativePlugin: Plugin kind, configuration validation, and registration lifecycle contract.PluginContext: Component-scoped registration APIs for middleware and subscribers.PluginRuntime: Typed helpers for Relay-owned scopes and marks.- Stable native ABI v1: C-compatible host and plugin tables behind the safe Rust authoring interface.
Installation
Add the SDK to a Rust dynamic-plugin project:
Configure the library as a dynamic library:
[]
= ["cdylib"]
Getting Started
Implement NativePlugin and export a constructor symbol:
use ;
use Map;
;
nemo_relay_plugin!;
Build the cdylib, describe its entry symbol and compatibility in a
relay-plugin.toml manifest, then register it through the Relay CLI. See the
complete example for platform-specific artifact and manifest setup.