haagenti_network/lib.rs
1//! CDN-Based Network Streaming for HoloTensor Fragments
2//!
3//! This module implements intelligent network streaming for loading
4//! model fragments from CDN/edge locations with:
5//!
6//! - **Range Requests**: Partial downloads for progressive loading
7//! - **Parallel Fetching**: Concurrent chunk downloads
8//! - **Smart Caching**: ETag/Last-Modified validation
9//! - **Retry with Backoff**: Resilient to transient failures
10//! - **Priority Queue**: Critical fragments first
11//! - **Bandwidth Adaptation**: Adjusts to network conditions
12//!
13//! # Architecture
14//!
15//! ```text
16//! ┌─────────────────────────────────────────────────────────────────┐
17//! │ NetworkLoader │
18//! ├─────────────────────────────────────────────────────────────────┤
19//! │ │
20//! │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
21//! │ │ Priority │ -> │ Scheduler │ -> │ Fetcher │ │
22//! │ │ Queue │ │ (rate limit)│ │ (parallel) │ │
23//! │ └──────────────┘ └──────────────┘ └──────────────┘ │
24//! │ ↑ ↑ ↓ │
25//! │ │ │ ┌──────────────┐ │
26//! │ Importance Bandwidth │ Cache │ │
27//! │ Weights Monitor │ (disk+mem) │ │
28//! │ └──────────────┘ │
29//! │ ↓ │
30//! │ ┌──────────────┐ │
31//! │ │ Fragment │ │
32//! │ │ Library │ │
33//! │ └──────────────┘ │
34//! └─────────────────────────────────────────────────────────────────┘
35//! ```
36
37mod cache;
38mod client;
39mod config;
40mod error;
41mod loader;
42mod priority;
43mod scheduler;
44
45pub use cache::{CacheConfig, CacheEntry, CacheStats, FragmentCache};
46pub use client::{ClientConfig, HttpClient, RangeRequest};
47pub use config::{CdnEndpoint, NetworkConfig, RetryConfig};
48pub use error::{NetworkError, Result};
49pub use loader::{LoadRequest, LoadResult, NetworkLoader, StreamingLoader};
50pub use priority::{PrioritizedFragment, Priority, PriorityQueue};
51pub use scheduler::{BandwidthMonitor, Scheduler, SchedulerConfig};
52
53/// Prelude for common imports
54pub mod prelude {
55 pub use super::{
56 CdnEndpoint, FragmentCache, LoadRequest, LoadResult, NetworkConfig, NetworkLoader,
57 Priority, Result,
58 };
59}