Remote start stop control

This commit is contained in:
Jaakko Vanhala
2026-04-11 19:14:20 +03:00
parent 660e80c2bc
commit 80806498e0
7 changed files with 279 additions and 78 deletions

View File

@@ -9,8 +9,6 @@ pub struct LlmEngine {
impl LlmEngine {
pub async fn load() -> Result<Self, String> {
let model = std::env::var("OLLAMA_MODEL").unwrap_or_else(|_| "qwen2.5-coder:3b".to_string());
let client = reqwest::Client::builder()
.timeout(std::time::Duration::from_secs(600))
.connect_timeout(std::time::Duration::from_secs(3))
@@ -48,6 +46,13 @@ impl LlmEngine {
})
};
// Kysytään malli TUI:lla jos ei pakotettu ympäristöstä
let model = if let Ok(m) = std::env::var("OLLAMA_MODEL") {
m
} else {
crate::tui::select_model(&ollama_url, &client).await?
};
tracing::info!("Ollama backend: {} | malli: {}", ollama_url, model);
Ok(LlmEngine { ollama_url, model: RefCell::new(model), client })
}