@hej / sigit / commits / cfc52c7

Refactor model

paydii committed Apr 25, 2026 at 21:51 UTC cfc52c77cd7984f4dcde408a01db425eb7592b47
2 files changed +9 -4
src/chat.rs
+6 -1
@@ -459,7 +459,12 @@ fn render_model_picker(frame: &mut Frame, app: &App, area: ratatui::layout::Rect
459 ModelCacheHealth::Complete => "",
460 ModelCacheHealth::Incomplete => " (unselectable)",
461 };
462 - let source = format!(" [{} {}]", item.brand_mark, item.source_label);
462 + let brand_mark = match item.source {
463 + ModelSource::Onde => "◉",
464 + ModelSource::HuggingFace => "○",
465 + ModelSource::Fallback => "◎",
466 + };
467 + let source = format!(" [{} {}]", brand_mark, item.source_label);
468
469 let base_style = if selected {
470 Style::default().fg(Color::Black).bg(Color::Green)
src/models.rs
+3 -3
@@ -27,7 +27,7 @@ pub(crate) struct ModelPickerItem {
27 pub(crate) max_tokens: u64,
28 pub(crate) config: GgufModelConfig,
29 pub(crate) source_label: String,
30 - pub(crate) brand_mark: &'static str,
30 +
31 pub(crate) source: ModelSource,
32 pub(crate) cache_health: ModelCacheHealth,
33 }
@@ -66,7 +66,7 @@ pub(crate) fn build_model_picker_items() -> Vec<ModelPickerItem> {
66 max_tokens,
67 config,
68 source_label: "Platform default".to_string(),
69 - brand_mark: "◎",
69 +
70 source: ModelSource::Fallback,
71 cache_health: ModelCacheHealth::Complete,
72 });
@@ -111,7 +111,7 @@ fn discovered_model_to_picker_item(model: DiscoveredModel) -> Option<ModelPicker
111 max_tokens,
112 config,
113 source_label,
114 - brand_mark: if model.from_app_group { "◉" } else { "○" },
114 +
115 source: if model.from_app_group {
116 ModelSource::Onde
117 } else {