Skip to main content

nemo_flow_adaptive/
lib.rs

1// SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2// SPDX-License-Identifier: Apache-2.0
3
4//! # NeMo Flow Adaptive
5//!
6//! Adaptive config helpers and core-plugin integration for NeMo Flow.
7//! Adaptive behavior is enabled through the generic core plugin system.
8//!
9//! This crate provides the adaptive runtime, persistence abstractions, learner
10//! implementations, and Adaptive Cache Governor (ACG) analysis types used to
11//! derive and apply runtime hints from observed NeMo Flow executions.
12pub mod acg;
13pub mod acg_component;
14pub mod acg_learner;
15pub mod acg_profile;
16pub mod adaptive_hints_intercept;
17pub mod cache_diagnostics;
18pub mod config;
19pub mod context_helpers;
20pub mod drain;
21pub mod error;
22pub mod intercepts;
23/// Learning primitives and built-in learner implementations.
24pub mod learner;
25pub mod plugin_component;
26#[cfg(feature = "redis-backend")]
27pub mod redis;
28mod runtime;
29/// Storage backends and backend traits for adaptive state persistence.
30pub mod storage;
31pub mod subscriber;
32/// Learner that derives tool fan-out plans from observed runs.
33pub mod tool_parallelism_learner;
34pub mod trie;
35/// Serializable adaptive data models shared across runtime components.
36pub mod types;
37
38pub use config::{
39    AcgComponentConfig, AdaptiveConfig, AdaptiveHintsComponentConfig, BackendSpec, StateConfig,
40    TelemetryComponentConfig, ToolParallelismComponentConfig,
41};
42pub use context_helpers::{
43    LATENCY_SENSITIVITY_POINTER, extract_scope_path, read_manual_latency_sensitivity,
44    resolve_agent_id, resolve_shared_parent_scope_identity, set_latency_sensitivity,
45};
46pub use error::{AdaptiveError, Result};
47#[cfg(feature = "redis-backend")]
48pub use redis::RedisBackend;
49pub use runtime::features::AdaptiveRuntime;
50pub use storage::erased::AnyBackend;
51pub use storage::memory::InMemoryBackend;
52pub use storage::traits::{StorageBackend, StorageBackendDyn};