For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
  • About NVIDIA NeMo Relay
    • Overview
    • Architecture
    • Ecosystem
    • Concepts
    • Release Notes
  • Getting Started
    • Agent Runtime Primer
    • Prerequisites
    • Installation
    • Configuration / Setup
    • Quick Start
  • NVIDIA NeMo Relay CLI
    • About
    • Basic Usage
    • Claude Code
    • Codex
    • Cursor
    • Hermes Agent
  • Supported Integrations
    • About
    • OpenClaw Plugin Guide
    • LangChain Integration Guide
    • LangGraph Integration Guide
    • Deep Agents Integration Guide
  • Instrument Applications
    • About
    • Adding Scopes and Marks
    • Instrument a Tool Call
    • Instrument an LLM Call
    • Add Middleware
    • Code Examples
  • Observability Plugin
    • About
    • Configuration
    • Agent Trajectory Interchange Format (ATIF)
    • Agent Trajectory Observability Format (ATOF)
    • OpenTelemetry
    • OpenInference
  • Adaptive Plugin
    • About
    • Configuration
    • Adaptive Cache Governor (ACG)
    • Adaptive Hints
  • NeMo Guardrails Plugin
    • About
    • Configuration
  • Integrate into Frameworks
    • About
    • Adding Scopes
    • Wrap Tool Calls
    • Wrap LLM Calls
    • Handle Non-Serializable Data
    • Using Codecs
    • Provider Codecs
    • Provider Response Codecs
    • Code Examples
  • Build Plugins
    • About
    • Define a Plugin
    • Validate Plugin Configuration
    • Plugin Configuration Files
    • Register Plugin Behavior
    • Design Plugin Configuration
    • NeMo Guardrails Example Plugin
    • Code Examples
  • Contribute
    • About
    • Development Setup
    • Workflow and Reviews
    • Testing and Documentation
  • Reference
    • APIs
      • Python Library Reference
      • Node.js Library Reference
      • Rust Library Reference
        • nemo-relay
        • nemo-relay-adaptive
          • acg
          • acg_component
          • acg_learner
          • acg_profile
          • adaptive_hints_intercept
          • cache_diagnostics
          • config
          • context_helpers
          • drain
          • error
          • intercepts
          • learner
          • plugin_component
          • redis
          • storage
          • subscriber
          • tool_parallelism_learner
          • trie
          • types
          • AdaptiveRuntime
        • nemo-relay-ffi
    • Performance
  • Resources
    • Support and FAQs
    • Glossary
    • Troubleshooting Guide
    • Community
    • Legal
NVIDIANVIDIA
Developer-friendly docs for your API
Privacy Policy | Your Privacy Choices | Terms of Service | Accessibility | Corporate Policies | Product Security | Contact

Copyright © 2026, NVIDIA Corporation.

LogoLogo
On this page
  • Implementations
  • impl AdaptiveRuntime
  • new
  • Parameters
  • Returns
  • Errors
  • validate_config
  • Parameters
  • Returns
  • report
  • Returns
  • wait_for_idle
  • Notes
  • build_cache_request_facts
  • Parameters
  • Returns
  • bind_scope
  • Errors
  • register
  • Returns
  • Errors
  • deregister
  • Returns
  • Errors
  • shutdown
  • Returns
  • Errors
  • Trait Implementations
  • impl Debug for AdaptiveRuntime
  • fmt
  • impl Drop for AdaptiveRuntime
  • drop
ReferenceAPIsRust Library Referencenemo-relay-adaptive

Struct Adaptive Runtime

||View as Markdown|
Previous

Enum Call Kind

Next

nemo-relay-ffi

Generated from cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-ffi.

1pub struct AdaptiveRuntime { /* private fields */ }

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

impl AdaptiveRuntime

new

pub async fn new(config: AdaptiveConfig) -> Result<Self>

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

pub fn validate_config(config: &AdaptiveConfig) -> ConfigReport

Validate an adaptive runtime configuration without constructing a runtime.

Parameters
  • config: Configuration to validate.
Returns

A ConfigReport containing validation diagnostics.

report

pub fn report(&self) -> &ConfigReport

Return the configuration report captured during construction.

Returns

The ConfigReport associated with this runtime.

wait_for_idle

pub fn wait_for_idle(&self)

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

pub fn build_cache_request_facts(
    &self,
    agent_id: &str,
    provider: &str,
    annotated_request: &AnnotatedLlmRequest,
) -> 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

pub fn bind_scope(&mut self, scope_uuid: 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

pub async fn register(&mut self) -> Result<()>

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

pub fn deregister(&mut self) -> Result<()>

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.

shutdown

pub async fn shutdown(self) -> Result<()>

Deregister the runtime and consume it.

Returns

A Result that is Ok(()) when shutdown completes.

Errors

Propagates any error returned by Self::deregister.

Trait Implementations

impl Debug for AdaptiveRuntime

impl Debug for AdaptiveRuntime

fmt

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Drop for AdaptiveRuntime

impl Drop for AdaptiveRuntime

drop

fn drop(&mut self)