| Crates.io | llm-sentinel-detection |
| lib.rs | llm-sentinel-detection |
| version | 0.1.0 |
| created_at | 2025-11-06 07:49:02.466845+00 |
| updated_at | 2025-11-06 07:49:02.466845+00 |
| description | Multi-algorithm anomaly detection engine (Z-Score, IQR, MAD, CUSUM) for LLM telemetry |
| homepage | https://github.com/globalbusinessadvisors/llm-sentinel |
| repository | https://github.com/globalbusinessadvisors/llm-sentinel |
| max_upload_size | |
| id | 1919236 |
| size | 122,614 |
Multi-algorithm anomaly detection engine for LLM telemetry data.
This crate implements four complementary statistical anomaly detection algorithms:
Add this to your Cargo.toml:
[dependencies]
llm-llm-sentinel-detection = "0.1.0"
use llm_sentinel_detection::{DetectionEngine, DetectionConfig, ZScoreDetector};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = DetectionConfig {
enabled_detectors: vec!["zscore".to_string(), "iqr".to_string()],
baseline_window_size: 1000,
..Default::default()
};
let engine = DetectionEngine::new(config);
// Detect anomalies in telemetry
if let Some(anomaly) = engine.detect(&event).await? {
println!("Anomaly detected: {:?}", anomaly);
}
Ok(())
}
Detects values that deviate significantly from the mean (default: 3σ threshold).
Identifies outliers beyond Q1 - 1.5×IQR and Q3 + 1.5×IQR.
Ultra-robust detection using median and median absolute deviation.
Detects sustained shifts and gradual drift in metrics.
Apache-2.0