> This page is for NeMo Relay, version v1.0.0.
> For other versions, use one of these documentation indexes:
> - Latest (v0.11.2) (default): https://docs.nvidia.com/nemo/relay/latest/llms.txt
> - dev: https://docs.nvidia.com/nemo/relay/dev/llms.txt
> - v1.0.0: https://docs.nvidia.com/nemo/relay/v1.0.0/llms.txt
> - v0.11.2: https://docs.nvidia.com/nemo/relay/v0.11.2/llms.txt
> - v0.10.4: https://docs.nvidia.com/nemo/relay/v0.10.4/llms.txt
> - v0.9.4: https://docs.nvidia.com/nemo/relay/v0.9.4/llms.txt
> - v0.8.4: https://docs.nvidia.com/nemo/relay/v0.8.4/llms.txt

> For clean Markdown of any page, append .md to the page URL. For a task-oriented documentation index, fetch https://docs.nvidia.com/nemo/relay/llms.txt. Use the documentation version matching the installed NeMo Relay package: latest follows the latest stable release, vX.Y.Z identifies a retained release snapshot, and dev documents development changes. Preserve the selected version when following links; do not mix examples or API contracts from different versions. Fetch the relevant section's /llms.txt before individual pages instead of loading a complete version index.

# Module plugin

> Plugin contracts, configuration, and activation.

Generated from `cargo doc --no-deps -p nemo-relay-builtins -p nemo-relay-diagnostics -p nemo-relay-logging -p nemo-relay-plugin-host -p nemo-relay-codecs -p nemo-relay -p nemo-relay-runtime -p nemo-relay-model-pricing -p nemo-relay-resource-metrics -p nemo-relay-observability -p nemo-relay-adaptive -p nemo-relay-pii-redaction -p nemo-relay-ffi -p nemo-relay-types -p nemo-relay-plugin -p nemo-relay-worker-proto -p nemo-relay-worker`.

Plugin contracts, configuration, and activation.

Verified-artifact activation is provided by `nemo-relay-plugin-host`:

```rust
use nemo_relay::plugin::initialize_with_verified_specs;
```

Use `initialize` for configuration-selected process diagnostics or `initialize_with_diagnostics` to inject an application-owned service. Exact activation is provided by `nemo-relay-plugin-host`:

```rust
use nemo_relay::plugin::initialize_exact;
```

Initialize through the functions in this module so the SDK composes its built-in plugins before validation and activation. Host-only constructors are not available on the returned handle:

```rust
use nemo_relay::plugin::{PluginConfig, PluginHostActivation};
async fn bypass_composition() {
    let _ = PluginHostActivation::initialize_exact(PluginConfig::default()).await;
}
```

## Structs

* [ConfigDiagnostic](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/struct-configdiagnostic): Structured diagnostic reported while validating or activating plugin configuration.
* [ConfigPolicy](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/struct-configpolicy): Policy for how unsupported plugin/runtime config is handled.
* [ConfigReport](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/struct-configreport): Structured configuration and activation report.
* [DynamicPluginFailure](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/struct-dynamicpluginfailure): One structured recent failure summary.
* [DynamicPluginValidationReport](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/struct-dynamicpluginvalidationreport): One validation result produced by core before dynamic code is loaded.
* [DynamicPluginValidationStatus](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/struct-dynamicpluginvalidationstatus): Decomposed validation results for one plugin record.
* [PluginComponentSpec](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/struct-plugincomponentspec): One configured plugin component.
* [PluginConfig](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/struct-pluginconfig): Canonical plugin configuration document.
* [PluginHostActivation](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/struct-pluginhostactivation): Owns one process-wide dynamic plugin configuration and its loaded runtimes.
* [PluginHostConfig](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/struct-pluginhostconfig): Embedded startup configuration. Service settings are not plugin component configuration and never enter plugin fingerprints or legacy reports.
* [PluginHostReport](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/struct-pluginhostreport): Combined static and dynamic host report.
* [PluginRegistration](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/struct-pluginregistration): Bookkeeping for one middleware/subscriber registration.
* [RuntimeDiagnostic](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/struct-runtimediagnostic): Bounded aggregate for a runtime failure observed by an active plugin.

## Enums

* [DiagnosticLevel](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/enum-diagnosticlevel): Severity of a plugin configuration or activation diagnostic.
* [DynamicPluginCheckState](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/enum-dynamicplugincheckstate): High-level verification state for one validation axis.
* [DynamicPluginFailurePhase](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/enum-dynamicpluginfailurephase): Recent failure phase or policy-gate context for diagnostics and operator UX.
* [DynamicPluginKind](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/enum-dynamicpluginkind): Plugin execution lane.
* [PluginError](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/enum-pluginerror): Error type for generic plugin operations.
* [PluginRegistrationCleanupOutcome](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/enum-pluginregistrationcleanupoutcome): Outcome of a tracked resource cleanup operation.
* [UnsupportedBehavior](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/enum-unsupportedbehavior): Per-policy behavior for unsupported configuration.

## Traits

* [Plugin](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/trait-plugin): Implemented by custom plugins that register runtime middleware.
* [PluginRegistrationContext](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/trait-pluginregistrationcontext): Host capabilities available to plugins during component activation.

## Functions

* [apply_global_config_policy](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/fn-apply-global-config-policy): Applies non-default global policy fields to a component policy.
* [deregister_plugin](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/fn-deregister-plugin): Remove a component registration. Default components are restored on next lookup.
* [ensure_builtin_plugins_registered](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/fn-ensure-builtin-plugins-registered): Make the default component implementations available to the runtime host.
* [initialize](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/fn-initialize): Initialize the plugin host with the default components.
* [initialize_with_diagnostics](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/fn-initialize-with-diagnostics): Initialize the host using an application-owned diagnostic service.
* [list_plugin_kinds](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/fn-list-plugin-kinds): Return component kinds after composing default components.
* [lookup_plugin](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/fn-lookup-plugin): Look up a component after composing default components.
* [plugin_config_schema](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/fn-plugin-config-schema): Return the host configuration schema.
* [register_plugin](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/fn-register-plugin): Register an application plugin after reserving the default built-in kinds.
* [validate](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/fn-validate): Validate host configuration with normal discovery and policy resolution.
* [validate_exact](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/fn-validate-exact): Validate an exact host configuration with default preflight checks.
* [validate_static_plugin_config](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/fn-validate-static-plugin-config): Validate configured components against the default's component implementations.

## Type Aliases

* [PluginFuture](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/type-pluginfuture): Shared future returned by Rust plugin activation methods.
* [Result](/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/plugin/type-result): Result of validating, activating, or cleaning up a component.