entrenar_shell/
lib.rs

1//! Interactive REPL for HuggingFace model exploration and distillation.
2//!
3//! This crate provides an interactive shell for:
4//! - Exploring model architectures and memory requirements
5//! - Running distillation experiments interactively
6//! - Managing model downloads and exports
7//!
8//! # Toyota Way Principles
9//!
10//! - **Genchi Genbutsu**: Direct interaction with the "gemba" (model tensors)
11//! - **Kaizen**: Iterative experimentation for continuous improvement
12//! - **Visual Control**: Immediate feedback on operations
13
14pub mod commands;
15pub mod repl;
16pub mod state;
17
18pub use repl::Repl;
19pub use state::SessionState;
20
21use entrenar_common::Result;
22
23/// Start the interactive shell.
24pub fn start() -> Result<()> {
25    let mut repl = Repl::new()?;
26    repl.run()
27}
28
29/// Start the shell with a pre-configured state.
30pub fn start_with_state(state: SessionState) -> Result<()> {
31    let mut repl = Repl::with_state(state)?;
32    repl.run()
33}
34
35#[cfg(test)]
36mod tests {
37    use super::*;
38
39    #[test]
40    fn test_session_state_default() {
41        let state = SessionState::default();
42        assert!(state.loaded_models().is_empty());
43        assert!(state.history().is_empty());
44    }
45}