Remote start stop control
This commit is contained in:
@@ -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 })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user