Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

fix(downloads): a slow line no longer counts as a failed download

purplefc312c588fa3
diff --git a/src-tauri/src/commands/download.rs b/src-tauri/src/commands/download.rs
index f678ede8..0bc7f3fd 100644
--- a/src-tauri/src/commands/download.rs
+++ b/src-tauri/src/commands/download.rs
@@ -370,7 +370,17 @@ async fn do_download(
let client = reqwest::Client::builder()
.user_agent("LocallyUncensored/1.5")
.redirect(crate::commands::proxy::ssrf_safe_redirect_policy(10))
- .timeout(std::time::Duration::from_secs(7200))
+ // A deadline on the whole request punishes people for having a slow
+ // line rather than a broken one: the 2 hour cap this replaces killed
+ // any download that legitimately took longer, and the catalog offers
+ // single files of 40 GB and sets of 155 GB. bob80817-dev, Discord
+ // 2026-07-29, after giving up: "all of your downloads have a habit of
+ // timing out". What we actually want to catch is a stalled transfer,
+ // so the limits are per-connect and per-read. A dead socket now fails
+ // in two minutes and resumes from the partial on the next attempt;
+ // a slow one is left to finish.
+ .connect_timeout(std::time::Duration::from_secs(30))
+ .read_timeout(std::time::Duration::from_secs(120))
.build()
.map_err(|e| e.to_string())?;
diff --git a/src-tauri/src/commands/install.rs b/src-tauri/src/commands/install.rs
index 7b164b52..048207fc 100644
--- a/src-tauri/src/commands/install.rs
+++ b/src-tauri/src/commands/install.rs
@@ -1043,6 +1043,11 @@ fn download_file_blocking(
let client = reqwest::blocking::Client::builder()
.user_agent("LocallyUncensored/2.3")
.redirect(reqwest::redirect::Policy::limited(10))
+ // This path pulls installers and archives (hundreds of MB), so the
+ // whole-request deadline still fits. The blocking client has no
+ // read_timeout; the model downloader, which handles the 40 GB+ files,
+ // uses the async client and bounds the stall instead of the size.
+ .connect_timeout(std::time::Duration::from_secs(30))
.timeout(std::time::Duration::from_secs(7200))
.build()
.map_err(|e| format!("HTTP client error: {}", e))?;