Skip to main content

entrenar/sovereign/distribution/
tier.rs

1//! Distribution tier levels
2
3use serde::{Deserialize, Serialize};
4
5/// Distribution tier levels
6#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize, Default)]
7pub enum DistributionTier {
8    /// ~50MB: entrenar-core, trueno, aprender
9    #[default]
10    Core,
11    /// ~200MB: + renacer, trueno-db, ruchy
12    Standard,
13    /// ~500MB: + GPU support, all tooling
14    Full,
15}
16
17impl DistributionTier {
18    /// Get the approximate size in megabytes
19    pub fn approximate_size_mb(&self) -> u64 {
20        match self {
21            Self::Core => 50,
22            Self::Standard => 200,
23            Self::Full => 500,
24        }
25    }
26
27    /// Get the core component names for this tier
28    pub fn component_names(&self) -> Vec<&'static str> {
29        match self {
30            Self::Core => vec!["entrenar-core", "trueno", "aprender"],
31            Self::Standard => {
32                vec!["entrenar-core", "trueno", "aprender", "renacer", "trueno-db", "ruchy"]
33            }
34            Self::Full => vec![
35                "entrenar-core",
36                "trueno",
37                "aprender",
38                "renacer",
39                "trueno-db",
40                "ruchy",
41                "entrenar-gpu",
42                "entrenar-bench",
43                "entrenar-inspect",
44                "entrenar-lora",
45                "entrenar-shell",
46            ],
47        }
48    }
49
50    /// Check if this tier includes a specific component
51    pub fn includes(&self, component: &str) -> bool {
52        self.component_names().contains(&component)
53    }
54}
55
56impl std::fmt::Display for DistributionTier {
57    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
58        match self {
59            Self::Core => write!(f, "core"),
60            Self::Standard => write!(f, "standard"),
61            Self::Full => write!(f, "full"),
62        }
63    }
64}