1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//! Model registry module
//!
//! Provides versioned model storage and retrieval with deployment features.
//!
//! # Architecture
//!
//! ```text
//! Training → Model → Registry → Shadow → Deployment
//! ↓ ↓ ↓
//! Storage Evaluation Rollback
//! ```
//!
//! # Concurrency
//!
//! [`ModelRegistry`] uses `ArcSwap` for lock-free reads during concurrent
//! updates. All read methods return owned snapshots; write methods are
//! serialized internally. See [`LiveModel`] for atomic model hot-swap.
//!
//! # Safe Deployment
//!
//! The registry includes two features for safe model deployment:
//!
//! - **Shadow Evaluation** ([`ShadowSession`]): Run candidate models in parallel
//! with production to compare outputs before promotion.
//! - **Rollback** ([`RollbackController`]): Quickly revert to a previous model
//! version when issues are detected, with full audit history.
//!
//! # Security
//!
//! When the `safetensors` feature is enabled, model weights can be serialized
//! using the safetensors format which prevents arbitrary code execution attacks.
//! This is **strongly recommended** for production deployments.
//!
//! # Example
//!
//! ```ignore
//! use lattice_tune::registry::{ModelRegistry, RegisteredModel, ModelMetadata};
//!
//! // Create a registry
//! let mut registry = ModelRegistry::new("/path/to/models");
//!
//! // Register a model
//! let model = RegisteredModel::new("intent_classifier", "1.0.0")
//! .with_metadata(metadata);
//! registry.register(model)?;
//!
//! // Load a model
//! let model = registry.get("intent_classifier", "1.0.0")?;
//! ```
pub use LiveModel;
pub use ;
pub use ;
pub use ;
pub use ;