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.

release: v2.4.0 — polish sweep (6 internal + 2 community fixes)

PurpleDoubleD8578de114d46
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bf9b21ec..0e7437a5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,30 @@
All notable changes to Locally Uncensored are documented here.
+## [2.4.0] - 2026-04-23
+
+### Fixed
+- **Double-launch no longer spawns a second LU process** — clicking the shortcut twice (or "Run" in the NSIS installer after install) used to produce two `locally-uncensored.exe` PIDs. Both triads wrote to `%APPDATA%/Locally Uncensored/store_backup.json` racing each other, occasionally overwriting a just-flushed backup mid-write. Fixed with `tauri-plugin-single-instance`: the 2nd launch now focuses + un-minimizes the existing window instead of creating a new process. Found during the internal 2.3.9 Ultra E2E pass.
+- **Settings → Agent Permissions → "Reset tutorial" button actually resets the tutorial now** — the onClick called `setTutorialCompleted()` which unconditionally sets `tutorialCompleted: true`. Clicking it on a fresh install silently *skipped* the tour, and clicking it after seeing the tour did nothing at all. Added a new `resetTutorial()` action in `agentModeStore` that sets `tutorialCompleted: false`, wired the button to it, added a regression test in `stores.test.ts`.
+- **Discover tab no longer shows the HuggingFace download path twice** — both the section subtitle and a second `<p>` below the download grid rendered "Saves to: …" / "Downloads save to: …". Removed the duplicate.
+- **Linux window can be dragged again** — on Ubuntu 24.04 the title-bar drag threw `Unhandled Promise Rejection: window.start_dragging not allowed. Permissions associated with this command: core:window:allow-start-dragging` and left the window anchored in place (keyboard tiling still worked, so nobody noticed on tile-first setups). Reported on Discord by @diimmortalis. Added `core:window:allow-start-dragging` to `src-tauri/capabilities/default.json`.
+- **"Re-run onboarding" actually reruns onboarding now** — first cut of the button deleted the marker file + flipped `settings.onboardingDone` + reloaded, but `AppShell.tsx`'s mount-time "migration" block saw the missing marker and happily wrote it back, dropping the user straight into the main app instead of the wizard. The migration is now gated on `settings.onboardingDone === true` so it only fires for legitimate NSIS-update-after-onboarding scenarios, not for the intentionally-missing marker of a Re-run click. Caught during E2E of the 2.4.0 RC. Regression test in `AppShell-backup-triad.test.ts`.
+- **HuggingFace search filename heuristic no longer doubles quant suffixes** — typing "tinyllama Q4" into Model Manager → Discover → Text → (search) returned repos like `hieupt/TinyLlama-1.1B-Chat-v1.0-Q4_K_M-GGUF`, and the client then guessed the inner filename as `TinyLlama-1.1B-Chat-v1.0-Q4_K_M-Q4_K_M.gguf` — doubled tag, guaranteed 404 when you clicked download. Extracted the guess into `deriveQ4FilenameFromRepo()`, added a case-insensitive quant-suffix detector (`Q[0-9]+_K_[MSL]`, `Q[0-9]_[0-9]+`, `IQ[0-9]_[A-Z]+`, `UD-Q/-IQ`, `BF16/FP16/F16/F32`). If the suffix is already in the repo name, the `.gguf` is appended directly; otherwise `-Q4_K_M.gguf` stays as before. Full E2E with a curated model (Gemma 4 E4B @ 4.6 GB) confirmed the Model Storage override path is honored — bytes land in the picked folder, LM Studio's default folder is not touched. 9 new regression tests in `discover-hf-filename.test.ts`.
+
+### Added
+- **Settings → Privacy section** — explicit in-app statement of what the app does and doesn't do with your data. Until 2.3.9 this only existed in the README, which meant if you couldn't be bothered to open GitHub you were taking the claim on faith. Now Settings lists: 100% local by default, no telemetry/analytics, only network calls are the GitHub updater and cloud-provider APIs you configure yourself; + where your data lives on disk (`%APPDATA%/Locally Uncensored`).
+- **Settings → Onboarding → "Re-run onboarding" button** — once you'd clicked through the first-launch wizard it was gone forever unless you hit "Reset to Defaults" (which wipes every other preference). Now Settings has a dedicated "Onboarding" section with a button that clears the `onboarding_done` marker on disk + resets the in-app flag + reloads. Useful when you want to redo the hardware scan, show the app to a friend, or just re-read the agent-mode tour. The `set_onboarding_done` Rust command now accepts `Option<bool>` so callers can also clear the marker, not only set it.
+- **Settings → Model Storage: configurable HuggingFace GGUF download path** — requested in Discord by @diimmortalis (dual-boot Ubuntu user wanting the HF downloads on a shared partition instead of `/home/$USER/locally-uncensored/models`). New `hfDownloadPathOverride` in settings — leave empty to keep the previous auto-detect-from-provider behaviour, or pick a folder via the native picker. `DiscoverModels.tsx` now prefers the override over the auto-detected LM-Studio path. Takes effect immediately without restart.
+- **CONTRIBUTING.md — ComfyUI CORS note for contributors bringing their own instance** — LU's auto-started ComfyUI already passes `--enable-cors-header "*"`, but contributors who point `npm run tauri:dev` at their own long-running ComfyUI see a `403` + `request with non matching host and origin localhost:8188 != localhost:5173` warning. Flagged on Discord by @diimmortalis after they self-diagnosed + self-fixed. Docs now spell out the workaround.
+
+### Changed
+- Test suite 2205 → 2216 (+11 regression tests: `resetTutorial` flips `tutorialCompleted` back to `false`, AppShell onboarding-marker migration is gated on `onboardingDone`, 9 cases for `deriveQ4FilenameFromRepo` covering Q-tag / IQ-tag / UD- / BF16 / lowercase / mid-string / no-GGUF variants).
+- Bumped `package.json` / `src-tauri/Cargo.toml` / `src-tauri/tauri.conf.json` 2.3.9 → 2.4.0 in lockstep.
+
+### Notes
+- Drop-in upgrade from v2.3.9. No breaking changes. No localStorage migration. `hfDownloadPathOverride` defaults to empty, which preserves pre-2.4.0 behaviour (auto-detect from the active openai-compat provider).
+- Version train: 2.4.0 is a polish release consolidating the 6 non-blocker findings from the internal Ultra E2E sweep + the 2 bug + 1 feature request from Discord community feedback over the 2.3.x cycle. No new headline features — the next headline bump is planned for 2.5.0 (see project roadmap).
+
## [2.3.9] - 2026-04-23
### Fixed
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index fbfd108e..920bf849 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -37,6 +37,22 @@ npm run tauri:build
Most pull requests only need `npm run tauri:dev`. Thanks to @k-wilkinson for
flagging that these commands weren't spelled out here.
+#### ComfyUI CORS when you run your own instance
+
+If you already have a ComfyUI running **outside** LU (e.g. a long-lived homelab
+instance) and you point `npm run tauri:dev` at it, Vite on `:5173` won't match
+ComfyUI's origin check and you'll see `403` on `/prompt` + a console warning:
+`request with non matching host and origin localhost:8188 != localhost:5173`.
+
+Start your ComfyUI with:
+
+```bash
+python main.py --listen 127.0.0.1 --port 8188 --enable-cors-header "*"
+```
+
+LU's own auto-started ComfyUI already passes this flag — you only need it when
+you're bringing your own. Thanks to @diimmortalis for flagging this in Discord.
+
### Project Structure
```
diff --git a/package.json b/package.json
index 5a80ac9b..b1bb16e8 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "locally-uncensored",
- "version": "2.3.9",
+ "version": "2.4.0",
"private": false,
"description": "Generate anything — text, images, video. Locally. Uncensored.",
"license": "AGPL-3.0",
diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock
index d5212f21..ab0cb8f5 100644
--- a/src-tauri/Cargo.lock
+++ b/src-tauri/Cargo.lock
@@ -2508,7 +2508,7 @@ dependencies = [
[[package]]
name = "locally-uncensored"
-version = "2.3.9"
+version = "2.4.0"
dependencies = [
"axum",
"base64 0.22.1",
@@ -2533,6 +2533,7 @@ dependencies = [
"tauri",
"tauri-build",
"tauri-plugin-shell",
+ "tauri-plugin-single-instance",
"tauri-plugin-updater",
"tempfile",
"tokio",
@@ -5034,6 +5035,21 @@ dependencies = [
"tokio",
]
+[[package]]
+name = "tauri-plugin-single-instance"
+version = "2.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a33a5b7d78f0dec4406b003ea87c40bf928d801b6fd9323a556172c91d8712c1"
+dependencies = [
+ "serde",
+ "serde_json",
+ "tauri",
+ "thiserror 2.0.18",
+ "tracing",
+ "windows-sys 0.60.2",
+ "zbus",
+]
+
[[package]]
name = "tauri-plugin-updater"
version = "2.10.1"
diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml
index ae1a13cd..9597a2ef 100644
--- a/src-tauri/Cargo.toml
+++ b/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "locally-uncensored"
-version = "2.3.9"
+version = "2.4.0"
description = "Private, local AI chat & image/video generation"
authors = ["purpledoubled"]
edition = "2021"
@@ -12,6 +12,7 @@ tauri-build = { version = "2", features = [] }
tauri = { version = "2", features = ["devtools", "tray-icon", "image-png"] }
tauri-plugin-shell = "2"
tauri-plugin-updater = "2"
+tauri-plugin-single-instance = "2"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
tokio = { version = "1", features = ["full"] }
diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json
index 0e94b8c3..7b75392c 100644
--- a/src-tauri/capabilities/default.json
+++ b/src-tauri/capabilities/default.json
@@ -12,6 +12,7 @@
"core:window:allow-close",
"core:window:allow-is-maximized",
"core:window:allow-toggle-maximize",
+ "core:window:allow-start-dragging",
"core:webview:default",
"shell:allow-spawn",
"shell:allow-stdin-write",
diff --git a/src-tauri/gen/schemas/capabilities.json b/src-tauri/gen/schemas/capabilities.json
index 84137d26..4fb8291f 100644
--- a/src-tauri/gen/schemas/capabilities.json
+++ b/src-tauri/gen/schemas/capabilities.json
@@ -1 +1 @@
-{"default":{"identifier":"default","description":"Capability for the main window","local":true,"windows":["main"],"permissions":["core:default","core:window:default","core:window:allow-minimize","core:window:allow-maximize","core:window:allow-unmaximize","core:window:allow-close","core:window:allow-is-maximized","core:window:allow-toggle-maximize","core:webview:default","shell:allow-spawn","shell:allow-stdin-write","shell:allow-kill","shell:allow-open","updater:default"]}}
\ No newline at end of file
+{"default":{"identifier":"default","description":"Capability for the main window","local":true,"windows":["main"],"permissions":["core:default","core:window:default","core:window:allow-minimize","core:window:allow-maximize","core:window:allow-unmaximize","core:window:allow-close","core:window:allow-is-maximized","core:window:allow-toggle-maximize","core:window:allow-start-dragging","core:webview:default","shell:allow-spawn","shell:allow-stdin-write","shell:allow-kill","shell:allow-open","updater:default"]}}
\ No newline at end of file
diff --git a/src-tauri/src/commands/system.rs b/src-tauri/src/commands/system.rs
index 4cb43893..2bfebb5d 100644
--- a/src-tauri/src/commands/system.rs
+++ b/src-tauri/src/commands/system.rs
@@ -151,12 +151,18 @@ pub fn is_onboarding_done() -> bool {
.unwrap_or(false)
}
-/// Persist onboarding completion to %APPDATA% (outside NSIS install dir)
+/// Persist onboarding completion to %APPDATA% (outside NSIS install dir).
+/// Pass `done: false` to clear the marker so the first-launch wizard runs again.
#[tauri::command]
-pub fn set_onboarding_done() -> Result<(), String> {
+pub fn set_onboarding_done(done: Option<bool>) -> Result<(), String> {
let dir = persistent_dir()?;
std::fs::create_dir_all(&dir).map_err(|e| e.to_string())?;
- std::fs::write(dir.join("onboarding_done"), "1").map_err(|e| e.to_string())?;
+ let path = dir.join("onboarding_done");
+ if done.unwrap_or(true) {
+ std::fs::write(&path, "1").map_err(|e| e.to_string())?;
+ } else if path.exists() {
+ std::fs::remove_file(&path).map_err(|e| e.to_string())?;
+ }
Ok(())
}
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index 0994daaf..b201faf3 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -17,6 +17,14 @@ fn main() {
let app_state = AppState::new();
tauri::Builder::default()
+ .plugin(tauri_plugin_single_instance::init(|app, _argv, _cwd| {
+ // 2nd launch → focus existing window instead of spawning another process.
+ if let Some(window) = app.get_webview_window("main") {
+ let _ = window.show();
+ let _ = window.unminimize();
+ let _ = window.set_focus();
+ }
+ }))
.plugin(tauri_plugin_shell::init())
.plugin(tauri_plugin_updater::Builder::new().build())
.manage(app_state)
diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json
index b805e06b..f4def254 100644
--- a/src-tauri/tauri.conf.json
+++ b/src-tauri/tauri.conf.json
@@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/tauri-apps/tauri/dev/crates/tauri-cli/schema.json",
"productName": "Locally Uncensored",
- "version": "2.3.9",
+ "version": "2.4.0",
"identifier": "com.purpledoubled.locally-uncensored",
"build": {
"beforeBuildCommand": "npm run build",
diff --git a/src/api/__tests__/discover-hf-filename.test.ts b/src/api/__tests__/discover-hf-filename.test.ts
new file mode 100644
index 00000000..27daea2c
--- /dev/null
+++ b/src/api/__tests__/discover-hf-filename.test.ts
@@ -0,0 +1,71 @@
+/**
+ * Regression test for `deriveQ4FilenameFromRepo` — the heuristic that turns a
+ * HuggingFace repo name into the guessed GGUF filename for the download URL.
+ *
+ * Pre-v2.4.0 the heuristic unconditionally appended "-Q4_K_M.gguf" to the
+ * base name, which produced doubled tags like
+ * "TinyLlama-1.1B-Chat-v1.0-Q4_K_M-GGUF" → "TinyLlama-1.1B-Chat-v1.0-Q4_K_M-Q4_K_M.gguf"
+ * and every download from a HF-search result into a repo-name-with-quant-in-it
+ * failed with HTTP 404. Surfaced during v2.4.0 E2E of the new Model Storage
+ * override feature. Fix: detect the quant suffix and collapse to "{name}.gguf".
+ */
+import { describe, it, expect } from 'vitest'
+import { deriveQ4FilenameFromRepo } from '../discover'
+
+describe('deriveQ4FilenameFromRepo', () => {
+ it('TinyLlama-1.1B-Chat-v1.0-Q4_K_M-GGUF does not double the quant suffix', () => {
+ expect(deriveQ4FilenameFromRepo('TinyLlama-1.1B-Chat-v1.0-Q4_K_M-GGUF'))
+ .toBe('TinyLlama-1.1B-Chat-v1.0-Q4_K_M.gguf')
+ })
+
+ it('plain -GGUF repo without a quant in name appends -Q4_K_M.gguf', () => {
+ expect(deriveQ4FilenameFromRepo('Qwen3-4B-GGUF'))
+ .toBe('Qwen3-4B-Q4_K_M.gguf')
+ })
+
+ it('lowercase -gguf stripped, then Q4_K_M appended', () => {
+ expect(deriveQ4FilenameFromRepo('gemma-3-12b-it-gguf'))
+ .toBe('gemma-3-12b-it-Q4_K_M.gguf')
+ })
+
+ it('preserves Q3_K_M / Q5_K_M / Q8_0 suffixes without doubling', () => {
+ expect(deriveQ4FilenameFromRepo('Llama-3.1-8B-Instruct-Q3_K_M-GGUF'))
+ .toBe('Llama-3.1-8B-Instruct-Q3_K_M.gguf')
+ expect(deriveQ4FilenameFromRepo('Llama-3.1-8B-Instruct-Q5_K_M-GGUF'))
+ .toBe('Llama-3.1-8B-Instruct-Q5_K_M.gguf')
+ expect(deriveQ4FilenameFromRepo('Llama-3.1-8B-Instruct-Q8_0-GGUF'))
+ .toBe('Llama-3.1-8B-Instruct-Q8_0.gguf')
+ })
+
+ it('preserves IQ2_XXS / IQ3_M / UD-IQ / UD-Q suffixes', () => {
+ expect(deriveQ4FilenameFromRepo('Qwen3.6-27B-UD-IQ2_XXS-GGUF'))
+ .toBe('Qwen3.6-27B-UD-IQ2_XXS.gguf')
+ expect(deriveQ4FilenameFromRepo('Qwen3.6-27B-UD-Q4_K_XL-GGUF'))
+ .toBe('Qwen3.6-27B-UD-Q4_K_XL.gguf')
+ expect(deriveQ4FilenameFromRepo('Some-Model-IQ3_M-GGUF'))
+ .toBe('Some-Model-IQ3_M.gguf')
+ })
+
+ it('preserves BF16 / FP16 / F16 / F32 suffixes', () => {
+ expect(deriveQ4FilenameFromRepo('Model-BF16-GGUF')).toBe('Model-BF16.gguf')
+ expect(deriveQ4FilenameFromRepo('Model-FP16-GGUF')).toBe('Model-FP16.gguf')
+ expect(deriveQ4FilenameFromRepo('Model-F16-gguf')).toBe('Model-F16.gguf')
+ expect(deriveQ4FilenameFromRepo('Model-F32-GGUF')).toBe('Model-F32.gguf')
+ })
+
+ it('lowercase quant tag still counts as a match (case-insensitive)', () => {
+ expect(deriveQ4FilenameFromRepo('TinyLlama-1.1B-Chat-v1.0-q4_k_m-GGUF'))
+ .toBe('TinyLlama-1.1B-Chat-v1.0-q4_k_m.gguf')
+ })
+
+ it('does NOT strip quant-like substrings in the middle of the name', () => {
+ // Only the trailing position triggers the "don't double" path.
+ expect(deriveQ4FilenameFromRepo('Q4-Study-Model-GGUF'))
+ .toBe('Q4-Study-Model-Q4_K_M.gguf')
+ })
+
+ it('repo name without -GGUF still gets .gguf appended correctly', () => {
+ expect(deriveQ4FilenameFromRepo('TinyLlama-1.1B-Chat'))
+ .toBe('TinyLlama-1.1B-Chat-Q4_K_M.gguf')
+ })
+})
diff --git a/src/api/discover.ts b/src/api/discover.ts
index 83c50908..1066c752 100644
--- a/src/api/discover.ts
+++ b/src/api/discover.ts
@@ -544,6 +544,26 @@ export async function getAnthropicModels(): Promise<DiscoverModel[]> {
}
/** Search HuggingFace for GGUF models */
+/**
+ * Derive the guessed Q4_K_M filename for a HuggingFace repo name like
+ * "TinyLlama-1.1B-Chat-v1.0-Q4_K_M-GGUF" → "TinyLlama-1.1B-Chat-v1.0-Q4_K_M.gguf".
+ *
+ * Heuristic:
+ * - strip a trailing "-GGUF" / "-gguf"
+ * - if the base already ends with a quant suffix (Q4_K_M, UD-IQ2_XXS, …),
+ * keep it and just append ".gguf" — otherwise HF returns 404 because the
+ * actual file is "basename.gguf", not "basename-Q4_K_M.gguf"
+ * - else default to "{basename}-Q4_K_M.gguf"
+ *
+ * Exported so the E2E regression test can exercise the edge cases without
+ * hitting the live HF API.
+ */
+export function deriveQ4FilenameFromRepo(repoName: string): string {
+ const baseName = repoName.replace(/-GGUF$/i, '').replace(/-gguf$/i, '')
+ const QUANT_SUFFIX = /-(Q[0-9]+_K_[MSL]|Q[0-9]_[0-9]+|IQ[0-9]_[A-Z]+(?:_[A-Z]+)?|UD-Q[0-9A-Z_]+|UD-IQ[0-9A-Z_]+|BF16|FP16|F16|F32)$/i
+ return QUANT_SUFFIX.test(baseName) ? `${baseName}.gguf` : `${baseName}-Q4_K_M.gguf`
+}
+
export async function searchHuggingFaceModels(query: string): Promise<DiscoverModel[]> {
try {
const searchQuery = query.includes('gguf') ? query : `${query} gguf`
@@ -562,10 +582,8 @@ export async function searchHuggingFaceModels(query: string): Promise<DiscoverMo
const models: DiscoverModel[] = []
for (const repo of repos) {
- // Derive Q4_K_M filename from repo name: "user/Model-Name-GGUF" → "Model-Name-Q4_K_M.gguf"
const repoName = repo.id.split('/').pop() || ''
- const baseName = repoName.replace(/-GGUF$/i, '').replace(/-gguf$/i, '')
- const q4File = `${baseName}-Q4_K_M.gguf`
+ const q4File = deriveQ4FilenameFromRepo(repoName)
const downloadUrl = `https://huggingface.co/${repo.id}/resolve/main/${q4File}`
const downloads = repo.downloads || 0
diff --git a/src/components/layout/AppShell.tsx b/src/components/layout/AppShell.tsx
index c3d761ec..dc4fb6ec 100644
--- a/src/components/layout/AppShell.tsx
+++ b/src/components/layout/AppShell.tsx
@@ -119,9 +119,14 @@ export function AppShell() {
backendCall('backup_stores', { data: JSON.stringify(snapshot) }).catch(() => {})
}
- // Migration: write onboarding marker if missing (keeps NSIS-update recovery working)
+ // Migration: write onboarding marker if missing AND user has already
+ // onboarded (keeps NSIS-update recovery working). Do NOT rewrite the
+ // marker for users who just hit Settings → "Re-run onboarding" — for
+ // them onboardingDone is false, and the missing marker is intentional.
backendCall<boolean>('is_onboarding_done').catch(() => false).then((markerExists) => {
- if (!markerExists) backendCall('set_onboarding_done').catch(() => {})
+ if (!markerExists && useSettingsStore.getState().settings.onboardingDone) {
+ backendCall('set_onboarding_done').catch(() => {})
+ }
})
doBackup() // first immediate backup
diff --git a/src/components/layout/__tests__/AppShell-backup-triad.test.ts b/src/components/layout/__tests__/AppShell-backup-triad.test.ts
index e5f6d90e..48175f66 100644
--- a/src/components/layout/__tests__/AppShell-backup-triad.test.ts
+++ b/src/components/layout/__tests__/AppShell-backup-triad.test.ts
@@ -58,4 +58,16 @@ describe('AppShell backup triad (Bug #7)', () => {
expect(src).toContain('__ts')
expect(src).toContain('new Date().toISOString()')
})
+
+ it('onboarding-marker migration does NOT re-write the marker when user clicked Settings -> Re-run onboarding', () => {
+ // Regression for v2.4.0 E2E: the Re-run onboarding button deletes the
+ // marker + sets settings.onboardingDone=false + reloads. AppShell mount
+ // must NOT re-create the marker just because it is missing — otherwise
+ // the user is sent straight back into the main app instead of the wizard.
+ // The migration is gated on settings.onboardingDone === true so it only
+ // fires for legitimate NSIS-update-after-onboarding scenarios.
+ expect(src).toMatch(/useSettingsStore\.getState\(\)\.settings\.onboardingDone/)
+ // The gated form must appear somewhere inside the is_onboarding_done.then block
+ expect(src).toMatch(/if \(!markerExists && useSettingsStore\.getState\(\)\.settings\.onboardingDone\)/)
+ })
})
diff --git a/src/components/models/DiscoverModels.tsx b/src/components/models/DiscoverModels.tsx
index cb912872..76d57c42 100644
--- a/src/components/models/DiscoverModels.tsx
+++ b/src/components/models/DiscoverModels.tsx
@@ -16,6 +16,7 @@ import { openExternal } from '../../api/backend'
import { useModels } from '../../hooks/useModels'
import { useDownloadStore } from '../../stores/downloadStore'
import { useProviderStore } from '../../stores/providerStore'
+import { useSettingsStore } from '../../stores/settingsStore'
import { GlassCard } from '../ui/GlassCard'
import { GlowButton } from '../ui/GlowButton'
import { ProgressBar } from '../ui/ProgressBar'
@@ -143,15 +144,18 @@ export function DiscoverModels({ category }: Props) {
// Provider state for model path detection
const providers = useProviderStore(s => s.providers)
+ const hfOverride = useSettingsStore(s => s.settings.hfDownloadPathOverride)
const [hfModelPath, setHfModelPath] = useState<string | null>(null)
const { pullModel } = useModels()
- // Auto-detect provider model path for GGUF downloads
+ // Auto-detect provider model path for GGUF downloads (user override wins).
useEffect(() => {
if (category !== 'text') return
+ const override = hfOverride?.trim()
+ if (override) { setHfModelPath(override); return }
const providerName = providers.openai?.name || 'LM Studio'
detectProviderModelPath(providerName).then(path => setHfModelPath(path))
- }, [category])
+ }, [category, hfOverride, providers.openai?.name])
// Detect system VRAM
useEffect(() => {
@@ -678,13 +682,6 @@ export function DiscoverModels({ category }: Props) {
</GlassCard>
)}
- {/* GGUF model path info */}
- {isText && hfModelPath && (
- <p className="text-[0.65rem] text-gray-500 truncate">
- Downloads save to: {hfModelPath}
- </p>
- )}
-
{loading ? (
<div className="text-center py-8 text-gray-500">Loading models...</div>
) : isText ? (
diff --git a/src/components/settings/SettingsPage.tsx b/src/components/settings/SettingsPage.tsx
index fbe9b546..ca7239bc 100644
--- a/src/components/settings/SettingsPage.tsx
+++ b/src/components/settings/SettingsPage.tsx
@@ -1,5 +1,5 @@
import { useState, useEffect, type ReactNode } from 'react'
-import { ArrowLeft, RotateCcw, Sun, Moon, Mic, Volume2, Check, X, Loader2, Shield, ChevronRight } from 'lucide-react'
+import { ArrowLeft, RotateCcw, Sun, Moon, Mic, Volume2, Check, X, Loader2, Shield, ChevronRight, GraduationCap, Lock } from 'lucide-react'
import { motion, AnimatePresence } from 'framer-motion'
import { useSettingsStore } from '../../stores/settingsStore'
import { useUIStore } from '../../stores/uiStore'
@@ -102,6 +102,54 @@ function WorkflowSection() {
)
}
+// ── Model Storage (HF GGUF download path override) ─────────────
+
+function HfDownloadPathSetting() {
+ const override = useSettingsStore(s => s.settings.hfDownloadPathOverride)
+ const updateSettings = useSettingsStore(s => s.updateSettings)
+ const [draft, setDraft] = useState(override)
+ useEffect(() => { setDraft(override) }, [override])
+
+ async function pickFolder() {
+ try {
+ const chosen = await backendCall<string | null>('pick_folder')
+ if (chosen) { setDraft(chosen); updateSettings({ hfDownloadPathOverride: chosen }) }
+ } catch {}
+ }
+
+ return (
+ <div className="space-y-2 py-1">
+ <div className="text-[0.6rem] text-gray-500 leading-relaxed">
+ HuggingFace GGUF downloads save here. Leave empty to auto-detect from your active openai-compat provider (e.g. LM Studio's models folder).
+ </div>
+ <div className="flex items-center gap-2">
+ <input
+ type="text"
+ value={draft}
+ onChange={(e) => setDraft(e.target.value)}
+ onBlur={() => updateSettings({ hfDownloadPathOverride: draft.trim() })}
+ placeholder="(auto-detect)"
+ className="flex-1 px-2 py-1 rounded bg-transparent border border-white/8 text-[0.65rem] text-gray-700 dark:text-gray-300 font-mono focus:outline-none focus:border-white/20"
+ />
+ <button
+ onClick={pickFolder}
+ className="px-2.5 py-1 rounded-md text-[0.6rem] font-medium bg-white dark:bg-white/10 text-gray-800 dark:text-white hover:bg-gray-100 dark:hover:bg-white/15 border border-gray-200 dark:border-white/15 transition-colors"
+ >
+ Browse…
+ </button>
+ {override && (
+ <button
+ onClick={() => { setDraft(''); updateSettings({ hfDownloadPathOverride: '' }) }}
+ className="px-2.5 py-1 rounded-md text-[0.6rem] text-gray-500 hover:text-red-400 transition-colors"
+ >
+ Reset
+ </button>
+ )}
+ </div>
+ </div>
+ )
+}
+
// ── ComfyUI Settings ────────────────────────────────────────────
function ComfyUISettings() {
@@ -482,6 +530,10 @@ export function SettingsPage() {
<ProviderSettings />
</Section>
+ <Section title="Model Storage">
+ <HfDownloadPathSetting />
+ </Section>
+
<Section title="ComfyUI (Image & Video)">
<ComfyUISettings />
</Section>
@@ -494,7 +546,7 @@ export function SettingsPage() {
<Section title="Agent Permissions">
<PermissionSettings />
<button
- onClick={() => useAgentModeStore.getState().setTutorialCompleted()}
+ onClick={() => useAgentModeStore.getState().resetTutorial()}
className="text-[0.6rem] text-gray-500 hover:text-gray-300 transition-colors"
>
Reset tutorial
@@ -595,6 +647,46 @@ export function SettingsPage() {
<UpdateSection />
+ <Section title="Privacy">
+ <div className="space-y-2 py-1 text-[0.65rem] text-gray-500 dark:text-gray-400 leading-relaxed">
+ <div className="flex items-start gap-2">
+ <Lock size={12} className="mt-0.5 shrink-0 text-emerald-500" />
+ <div>
+ <p className="text-gray-700 dark:text-gray-300 font-medium mb-0.5">100% local by default.</p>
+ <p>Chat, agent runs, image &amp; video generation all execute on your machine. No telemetry, no analytics, no model pings home. The only network calls LU makes unless you explicitly opt in are: update checks against GitHub Releases, and cloud provider APIs (OpenAI, Anthropic, etc.) that you configure yourself with your own API keys.</p>
+ </div>
+ </div>
+ <div className="flex items-start gap-2 pt-1.5">
+ <Shield size={12} className="mt-0.5 shrink-0 text-emerald-500" />
+ <div>
+ <p className="text-gray-700 dark:text-gray-300 font-medium mb-0.5">You own your data.</p>
+ <p>Conversations, memories, and generated media live in <code className="px-1 py-0.5 rounded bg-black/5 dark:bg-white/5 font-mono text-[0.6rem]">%APPDATA%/Locally Uncensored</code> on Windows (or the equivalent on Linux/macOS). Back up the folder, move it between machines, or delete it — LU writes nothing else.</p>
+ </div>
+ </div>
+ </div>
+ </Section>
+
+ <Section title="Onboarding">
+ <div className="flex items-center justify-between py-1">
+ <div className="flex items-start gap-2">
+ <GraduationCap size={12} className="mt-0.5 shrink-0 text-gray-500" />
+ <div className="text-[0.65rem] text-gray-600 dark:text-gray-400 leading-relaxed">
+ Run the first-launch setup wizard again (hardware scan, recommended models, tool-calling tour).
+ </div>
+ </div>
+ <button
+ onClick={async () => {
+ useSettingsStore.getState().updateSettings({ onboardingDone: false })
+ try { await backendCall('set_onboarding_done', { done: false }) } catch {}
+ window.location.reload()
+ }}
+ className="ml-3 shrink-0 px-2.5 py-1 rounded-md text-[0.6rem] font-medium bg-white dark:bg-white/10 text-gray-800 dark:text-white hover:bg-gray-100 dark:hover:bg-white/15 border border-gray-200 dark:border-white/15 transition-colors"
+ >
+ Re-run onboarding
+ </button>
+ </div>
+ </Section>
+
{/* ── Reset ──────────────────────────────────── */}
<div className="pt-3 pb-6">
<button
diff --git a/src/lib/constants.ts b/src/lib/constants.ts
index 121ec7fa..ee2fea65 100644
--- a/src/lib/constants.ts
+++ b/src/lib/constants.ts
@@ -26,6 +26,7 @@ export const DEFAULT_SETTINGS: Settings = {
// Agent budget (Phase 10 v2.4.0)
agentMaxToolCalls: 50,
agentMaxIterations: 25,
+ hfDownloadPathOverride: '',
}
/** Caveman mode system prompt prefixes — credit: github.com/JuliusBrussee/caveman (MIT) */
diff --git a/src/stores/__tests__/stores.test.ts b/src/stores/__tests__/stores.test.ts
index 3235060b..4f143a80 100644
--- a/src/stores/__tests__/stores.test.ts
+++ b/src/stores/__tests__/stores.test.ts
@@ -328,6 +328,18 @@ describe('agentModeStore', () => {
expect(useAgentModeStore.getState().tutorialCompleted).toBe(true)
})
})
+
+ describe('resetTutorial', () => {
+ it('flips tutorialCompleted back to false so Settings -> "Reset tutorial" actually re-shows the tour', () => {
+ // Arrange: tutorial marked as already seen
+ useAgentModeStore.getState().setTutorialCompleted()
+ expect(useAgentModeStore.getState().tutorialCompleted).toBe(true)
+ // Act: user clicks Reset tutorial in Settings
+ useAgentModeStore.getState().resetTutorial()
+ // Assert: tutorial will render again
+ expect(useAgentModeStore.getState().tutorialCompleted).toBe(false)
+ })
+ })
})
// ═══════════════════════════════════════════════════════════════
diff --git a/src/stores/agentModeStore.ts b/src/stores/agentModeStore.ts
index 1813e488..b1856d5a 100644
--- a/src/stores/agentModeStore.ts
+++ b/src/stores/agentModeStore.ts
@@ -16,6 +16,7 @@ interface AgentModeState {
setAgentModeActive: (conversationId: string, active: boolean) => void
setSandboxLevel: (level: SandboxLevel) => void
setTutorialCompleted: () => void
+ resetTutorial: () => void
setNewChatHintDismissed: (dismissed: boolean) => void
isActive: (conversationId: string) => boolean
}
@@ -48,6 +49,8 @@ export const useAgentModeStore = create<AgentModeState>()(
setTutorialCompleted: () => set({ tutorialCompleted: true }),
+ resetTutorial: () => set({ tutorialCompleted: false }),
+
setNewChatHintDismissed: (dismissed) => set({ newChatHintDismissed: dismissed }),
isActive: (conversationId) => {
diff --git a/src/types/settings.ts b/src/types/settings.ts
index 3ee1bf6d..48a31512 100644
--- a/src/types/settings.ts
+++ b/src/types/settings.ts
@@ -24,6 +24,8 @@ export interface Settings {
agentMaxToolCalls: number
/** Hard cap on ReAct loop iterations per user turn. 0 = unlimited. */
agentMaxIterations: number
+ /** Override for the HuggingFace GGUF download directory. Empty = auto-detect from active openai-compat provider (e.g. LM Studio models folder). */
+ hfDownloadPathOverride: string
}
export interface Persona {