entrenar/sovereign/distribution/
tier.rs1use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize, Default)]
7pub enum DistributionTier {
8 #[default]
10 Core,
11 Standard,
13 Full,
15}
16
17impl DistributionTier {
18 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 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 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}