mlmf 0.2.0

Machine Learning Model Files - Loading, saving, and dynamic mapping for ML models
Documentation
use mlmf::{SimpleDistributedManager, ShardingStrategy};
use std::net::{SocketAddr, IpAddr, Ipv4Addr};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    println!("๐Ÿงช Testing MLMF Distributed Integration");
    println!("=======================================");

    // Test 1: Basic distributed manager creation
    println!("\n1๏ธโƒฃ  Testing Distributed Manager Creation");
    let node_addresses = vec![
        SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 8084),
        SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 8085),
    ];

    let manager = SimpleDistributedManager::create_cluster_deployment(
        "./models/test",
        "test-model".to_string(),
        node_addresses,
        ShardingStrategy::LayerSharding { layers_per_shard: 3 },
    ).await?;

    println!("โœ… Distributed manager created successfully");

    // Test 2: Cluster status
    let status = manager.get_cluster_status().await;
    println!("\n2๏ธโƒฃ  Cluster Status Check");
    println!("โœ… Nodes: {}/{} healthy", status.healthy_nodes, status.total_nodes);
    println!("โœ… Models: {}", status.total_models);
    println!("โœ… Health: {:?}", status.cluster_health);

    // Test 3: Model listing
    let models = manager.list_models().await;
    println!("\n3๏ธโƒฃ  Model Listing");
    println!("โœ… Available models: {:?}", models);

    // Test 4: Model info
    if let Some(model_info) = manager.get_model_info("test-model").await {
        println!("\n4๏ธโƒฃ  Model Information");
        println!("โœ… Model ID: {}", model_info.model_id);
        println!("โœ… Shards: {}", model_info.shards.len());
        println!("โœ… Status: {:?}", model_info.status);
    }

    println!("\n๐ŸŽ‰ All distributed integration tests passed!");
    println!("   The distributed system is ready for production deployment.");

    Ok(())
}