Struct Adaptive Runtime
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.
Hosted adaptive runtime that registers NeMo Relay plugin components.
This type validates configuration, builds the configured storage backend, registers intercepts and subscribers, and maintains the hot cache used by adaptive features on the request path.
Implementations
impl AdaptiveRuntime
Referenced types: AdaptiveRuntime
new
Referenced types: AdaptiveConfig, Result
Create a new adaptive runtime from configuration.
Parameters
config: Adaptive runtime configuration to validate and apply.
Returns
A Result containing a new AdaptiveRuntime.
Errors
Returns AdaptiveError::InvalidConfig when validation reports errors, or any backend-construction error produced while building the configured state backend.
validate_config
Referenced types: AdaptiveConfig, ConfigReport
Validate an adaptive runtime configuration without constructing a runtime.
Parameters
config: Configuration to validate.
Returns
A ConfigReport containing validation diagnostics.
validate_document
Referenced types: Value, Result, AdaptiveConfig, ConfigReport
Parse and validate an adaptive config document from a binding or FFI caller.
Unlike deserializing into AdaptiveConfig directly, this reports the former response_cache section as the adaptive.response_cache_moved error instead of silently dropping it.
Errors
Returns the deserialization error when the document is not an adaptive config.
report
Referenced types: ConfigReport
Return the configuration report captured during construction.
Returns
The ConfigReport associated with this runtime.
wait_for_idle
Block until the telemetry drain has processed all pending events.
Notes
This method performs a simple polling wait and is intended for tests, shutdown paths, or other coordination points.
build_cache_request_facts
Referenced types: str, Option, CacheRequestFacts
Build cache-diagnostics facts for an annotated request.
Parameters
agent_id: Agent identifier associated with the request.provider: Logical provider name associated with the request.annotated_request: Annotated request to analyze.
Returns
Some(CacheRequestFacts) when enough hot-cache state is available to derive them and None otherwise.
bind_scope
Referenced types: Uuid, Result, ()
Bind the runtime’s ACG request rewrite to an active scope.
External framework integrations can bind the runtime to a session scope and then invoke nemo_relay.llm.request_intercepts(...) explicitly at the provider boundary. Once any scope is bound, this runtime’s hosted ACG execution intercept becomes pass-through so external frameworks do not double-translate requests.
Errors
Returns an error when the runtime is not yet registered, when ACG is not configured for this runtime, or when the scope-local request intercept cannot be constructed or registered.
register
Register all configured adaptive features with the shared runtime.
Returns
A Result that is Ok(()) when registration succeeds.
Errors
Returns any error raised while seeding state or registering features.
deregister
Deregister all previously registered adaptive features.
Returns
A Result that is Ok(()) after registrations have been rolled back.
Errors
Returns any rollback error surfaced by the hosted plugin system.
Runtime lifecycle
This method returns before the telemetry drain finishes. Callers using a Tokio current_thread runtime must keep that runtime alive and driven until the drain completes. Call Self::shutdown when completion must be observed before the runtime is dropped.
shutdown
Deregister the runtime and consume it.
Returns
A Result that is Ok(()) when shutdown completes.
Errors
This method currently always returns Ok(()) after deregistering features and either draining or aborting telemetry work.
Trait Implementations
impl Debug for AdaptiveRuntime
Referenced types: Debug, AdaptiveRuntime
fmt
Referenced types: fmt, Formatter, Result
impl Drop for AdaptiveRuntime
Referenced types: Drop, AdaptiveRuntime
drop
Referenced types: drop