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.
TypeScript agentai-chatai-studioall-in-onecoding-agentdesktop-appfluximage-generationlinuxllmlocal-ailocal-llmopen-sourceprivacyself-hostedstable-diffusionuncensoreduncensored-aivideo-generationwindows
hotfix v2.4.7 ship-polish: Bug M proper fix (Ollama eval metadata + LM Studio fallback), Bug P UX (?? defaults + max-clamp), docs badge
purple1138068fea2e
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex f6caec5c..ca6f207e 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -4,7 +4,7 @@ All notable changes to Locally Uncensored are documented here.## [Unreleased]-## [2.4.7] - 2026-05-21+## [2.4.7] - 2026-05-22Drop-in hotfix on top of v2.4.6. Five bugs: four user-reported (M — Discord nightmare13740; N — GH #40 juliandiggins-stack; O — Discord 0yagizz; P — Discord ake0n_official; R — GH Discussion #6 silentrunningcaUSA) plus internal hardening on the ComfyUI history-output extractor.@@ -12,6 +12,8 @@ Drop-in hotfix on top of v2.4.6. Five bugs: four user-reported (M — Discord ni- **Benchmark tok/s now excludes time-to-first-token + stream init** (Bug M — nightmare13740 Discord #help-chat, 2026-05-19). Pre-v2.4.7 `useBenchmark.runBenchmark` started the clock at `performance.now()` before opening the chat stream and used the resulting `totalTime` as the denominator for `tokensPerSec`. On any setup with non-trivial first-token latency (warm-up cost, connection init, ollama model load), the benchmark undercounted generation-phase throughput. nightmare13740's RTX 4070 Laptop 8 GB + gemma4:e4b reproduced the issue cleanly: ollama CLI baseline 30 tok/s, manual chat measurement 23–25 tok/s, pre-v2.4.7 benchmark 12 tok/s. v2.4.7 extracts `computeGenerationTps(tokenCount, totalTime, firstTokenTime)` into `src/stores/benchmarkStore.ts` as a pure helper, subtracts TTFT from the denominator, guards against `generationTime <= 0` for degenerate runs (0-token, 1-token, totalTime ≤ firstTokenTime). `useBenchmark.ts:55` now calls the helper; `timeToFirstToken` continues to surface as its own stat in the benchmark UI so users can compare TTFT and steady-state separately. Seven new vitest cases pin the math: nominal extraction, nightmare's exact 12-vs-24 tok/s reconstruction, zero-token guard, zero-generation-time guard, tiny TTFT relative to totalTime, single-token degenerate case.+ Late-shipping pre-release E2E in the actual release build (not vite-dev) found that the TTFT-subtraction formula alone was not enough. The Tauri Rust proxy (`proxy_localhost_stream`) collects bytes before returning, and WebView2 release-mode also aggregates TCP chunks for short responses. The result: for fast small models, all NDJSON lines arrive in JS within a single millisecond — `firstTokenTime ≈ totalTime`, `generationTimeMs ≈ 0`, formula returns numbers like 685,000 tok/s. To make the fix real for release builds, the Ollama provider now extracts the authoritative `eval_count` (tokens) and `eval_duration` (ns) fields from the server's final `done:true` chunk and forwards them via two new optional fields on `ChatStreamChunk` (`evalCount`, `evalDurationMs`). `useBenchmark` prefers these over JS timing whenever they're set: post-fix Ollama benchmark on this host now shows qwen2.5:0.5b at ~245 tok/s (matches Ollama API baseline 241.5) instead of 685,000. For providers that don't return server-side metrics (LM Studio / OpenAI-compat / vLLM / Anthropic), a sanity fallback kicks in: when `generationTimeMs < 100` and no API metrics, the formula falls back to wall-clock rate (`tokens / totalTime * 1000`) so the displayed number stays sane rather than blowing up to six-figure values. LM Studio q4_k_m benchmark on this host shows 85–136 tok/s via this path (vs the previous absurd readouts).+### Fixed — Windows / ComfyUI install- **`install_comfyui` + `install_custom_node` now probe `git --version` before clone** (Bug N — juliandiggins-stack GH issue #40, 2026-05-18). The existing spawn-error guard catches a flat "git not on PATH" failure, but it can't tell when a WSL / Linux-mounted git binary is first on PATH on a Windows machine — `git --version` succeeds, the clone *starts*, then dies because the Linux binary can't handle Windows-style target paths. The user ends up with a half-cloned ComfyUI directory and no actionable hint. v2.4.7 adds a tri-state `WindowsGitState` probe (Native / NonNative / Missing) in `src-tauri/src/commands/install.rs`. Native (`git version 2.x.x.windows.y` tag) proceeds silently. Missing blocks the install with a clear "install Git for Windows from https://git-scm.com/download/win and restart LU" hint. NonNative (no `.windows` tag — MSYS git, Cygwin git, or a WSL binary mounted into Windows PATH) surfaces a soft warning into the install panel logs but proceeds, since many MSYS/Cygwin gits actually handle Windows paths fine. Eleven new cargo unit tests pin the classification matrix (Git for Windows, WSL git, MSYS git, broken install, empty stdout, garbage stdout, case-insensitive) plus the install-hint copy (must mention `git-scm.com/download/win`, must mention PATH ordering for the WSL case).@@ -24,6 +26,8 @@ Drop-in hotfix on top of v2.4.6. Five bugs: four user-reported (M — Discord ni- **Image and video generation timeouts are now user-configurable** (Bug P — ake0n_official Discord #help-chat, 2026-05-19). Pre-v2.4.7 image gens timed out at a hard-coded 20 min and video at 60 min. That was a sane default for desktop NVIDIA hardware but actively painful for the CPU-only / iGPU edge: ake0n_official's 12th-gen Intel Core + Intel UHD Graphics (128 MB allotment) finished sampling step 9 of 25 on a 1024 px Juggernaut-XL run before the 20-minute cap killed the job mid-sampler, with no way to recover the partial work. v2.4.7 adds `imageGenTimeoutMinutes` and `videoGenTimeoutMinutes` to `types/settings.ts` with defaults 20 and 60 (matching pre-v2.4.7 behavior on fresh installs and via the persisted-store migration), reads them in `useCreate.generate()` with a `Math.max(1, …)` clamp to prevent footguns from a 0-min input, and surfaces both as numeric inputs in `SettingsPage`'s new "Image / Video Generation Timeouts" section with an explanatory blurb naming the iGPU / CPU-only use case directly. Users on slow hardware can now bump both caps as needed (range 1–480 min); fast-GPU users see no change.+ Two release-mode polish items found during pre-ship E2E and folded into the same ship: (1) the inputs now use `value={settings.imageGenTimeoutMinutes ?? 20}` (and `?? 60` for video) so existing v2.4.6 users — whose persisted settings store predates these fields — see the defaults rendered as the field value instead of an empty input. Functionally `useCreate.generate()` already fell back to the defaults via `Math.max(1, settings.imageGenTimeoutMinutes || 20)`, so this is a UX-only patch; the saved timeout was always correct, just invisible on the first Settings visit after upgrade. (2) The `onChange` handler now clamps the upper bound too — `Math.min(480, Math.max(1, …))` — matching the HTML `max=480` attribute that was previously only a browser hint. Typing 999 used to persist as 999; v2.4.7 caps it at 480, so users who blindly type a large number to "disable" the timeout cap at the documented range instead.+### Fixed — ComfyUI output extraction- **Custom save nodes' outputs now surface in LU's gallery** (Bug R — silentrunningcaUSA GH Discussion #6, 2026-05-20). Pre-v2.4.7 `useCreate.ts` only scraped `nodeOutput.images`, `nodeOutput.gifs`, and `nodeOutput.videos` from each entry in ComfyUI's `/history/{promptId}` payload. That worked for the canonical SaveImage / SaveAnimatedWEBP / VHS_VideoCombine nodes, but every community workflow that uses a non-canonical save node — SaveImageWithMetadata posts under `result`, audio save nodes under `audio`, plenty of CivitAI workflows define their own keys — dropped its file on disk in ComfyUI's `output/` folder and never made it into LU's gallery. silentrunningcaUSA's symptom was exactly that: "I can send a generation request to ComfyUI and I can see the output in ComfyUI itself, but the result never comes back to LU." v2.4.7 extracts the extraction logic into a generic helper `extractComfyOutputFiles(nodeOutput)` in `src/api/comfyui.ts` that scans every key on the node output, accepts any array whose entries have a string `filename`, and fills in safe defaults for `subfolder` (`''`) and `type` (`'output'`) so downstream URL construction still works when a custom node omits them. Wired into all three `useCreate.ts` history-poll sites (WebSocket-branch heartbeat poll, WebSocket-branch completion path, polling-only fallback) so the fix applies regardless of which transport ComfyUI is on. Ten new vitest cases pin canonical-keys, custom-keys, audio, multi-key-on-same-node, missing-subfolder-and-type defaults, non-array values (LATENT, metadata, scalars), invalid array entries (missing filename, non-string filename, null), and the empty/null/undefined input guard.diff --git a/docs/index.html b/docs/index.htmlindex 2ed90c12..aab9f7c0 100644--- a/docs/index.html+++ b/docs/index.html@@ -827,7 +827,7 @@ footer a:hover{color:var(--fg)}<!-- Top meta strip --><div class="mast-strip">- <span class="numero">v 2.4.2</span>+ <span class="numero">v 2.4.7</span><span class="sep">·</span><span>AGPL-3.0</span><span class="sep">·</span>diff --git a/src/api/providers/ollama-provider.ts b/src/api/providers/ollama-provider.tsindex 442413f8..cea19dcc 100644--- a/src/api/providers/ollama-provider.ts+++ b/src/api/providers/ollama-provider.ts@@ -19,6 +19,14 @@ import { repairToolCallArgs, extractToolCallsFromContent } from '../../lib/tool-interface OllamaChatChunk {message?: { content: string; thinking?: string; tool_calls?: { function: { name: string; arguments: Record<string, any> } }[] }done?: boolean+ // Server-reported timing in the final done:true chunk (Bug M v2.4.7).+ // Ollama returns nanoseconds; we convert to ms before yielding upstream.+ eval_count?: number // tokens the model produced+ eval_duration?: number // generation phase in nanoseconds+ prompt_eval_count?: number // tokens in the prompt (unused for tps)+ prompt_eval_duration?: number+ total_duration?: number+ load_duration?: number}interface OllamaModelEntry {@@ -133,6 +141,12 @@ export class OllamaProvider implements ProviderClient {thinking: chunk.message?.thinking || undefined,toolCalls: toolCalls?.length ? toolCalls : undefined,done: chunk.done || false,+ // Bug M v2.4.7 — pass through server-side generation metrics so the+ // benchmark can report Ollama's own measurement instead of trusting+ // client-side TTFT, which WebView2 release-mode buffers into+ // uselessness for fast small models.+ evalCount: chunk.eval_count,+ evalDurationMs: chunk.eval_duration !== undefined ? chunk.eval_duration / 1_000_000 : undefined,}}}diff --git a/src/api/providers/types.ts b/src/api/providers/types.tsindex 5f213b23..41b064a5 100644--- a/src/api/providers/types.ts+++ b/src/api/providers/types.ts@@ -108,6 +108,13 @@ export interface ChatStreamChunk {thinking?: string // Model reasoning (Ollama thinking field, <think> tags)toolCalls?: ToolCall[]done: boolean+ // Server-reported generation metrics (Bug M v2.4.7 — Ollama only). Released+ // in the final done:true chunk. Authoritative tok/s = evalCount /+ // (evalDurationMs / 1000). Prefer these over client-side JS timing whenever+ // available, because WebView2 release-mode often buffers the response and+ // makes client-side TTFT measurement meaningless for fast models.+ evalCount?: number // tokens generated by the model+ evalDurationMs?: number // generation time in ms (excludes prompt eval + load)}// ── Tool Definition (OpenAI format, converted per provider) ───diff --git a/src/components/settings/SettingsPage.tsx b/src/components/settings/SettingsPage.tsxindex b6b0a6e9..3773e15d 100644--- a/src/components/settings/SettingsPage.tsx+++ b/src/components/settings/SettingsPage.tsx@@ -667,8 +667,8 @@ export function SettingsPage() {<span className="text-[0.7rem] text-gray-700 dark:text-gray-400">Image timeout (min)</span><inputtype="number"- value={settings.imageGenTimeoutMinutes}- onChange={(e) => updateSettings({ imageGenTimeoutMinutes: Math.max(1, parseInt(e.target.value) || 20) })}+ value={settings.imageGenTimeoutMinutes ?? 20}+ onChange={(e) => updateSettings({ imageGenTimeoutMinutes: Math.min(480, Math.max(1, parseInt(e.target.value) || 20)) })}min={1}max={480}placeholder="20"@@ -679,8 +679,8 @@ export function SettingsPage() {<span className="text-[0.7rem] text-gray-700 dark:text-gray-400">Video timeout (min)</span><inputtype="number"- value={settings.videoGenTimeoutMinutes}- onChange={(e) => updateSettings({ videoGenTimeoutMinutes: Math.max(1, parseInt(e.target.value) || 60) })}+ value={settings.videoGenTimeoutMinutes ?? 60}+ onChange={(e) => updateSettings({ videoGenTimeoutMinutes: Math.min(480, Math.max(1, parseInt(e.target.value) || 60)) })}min={1}max={480}placeholder="60"diff --git a/src/hooks/useBenchmark.ts b/src/hooks/useBenchmark.tsindex b165f579..1ef63c4f 100644--- a/src/hooks/useBenchmark.ts+++ b/src/hooks/useBenchmark.ts@@ -32,6 +32,8 @@ export function useBenchmark() {const startTime = performance.now()let firstTokenTime = 0let tokenCount = 0+ let apiEvalCount: number | undefined+ let apiEvalDurationMs: number | undefinedconst stream = provider.chatStream(modelId, messages, {temperature: 0.7,@@ -45,17 +47,55 @@ export function useBenchmark() {}tokenCount++}+ // Bug M v2.4.7 — Ollama reports authoritative gen metrics in the+ // done:true chunk. Prefer these over client-side timing because+ // WebView2 release-mode buffers the response stream for fast small+ // models, collapsing firstTokenTime to ~totalTime and producing+ // absurd JS-measured tps values.+ if (chunk.evalCount !== undefined && chunk.evalCount > 0) {+ apiEvalCount = chunk.evalCount+ }+ if (chunk.evalDurationMs !== undefined && chunk.evalDurationMs > 0) {+ apiEvalDurationMs = chunk.evalDurationMs+ }}const totalTime = performance.now() - startTime+ // Three-way TPS branch for Bug M (v2.4.7):+ // 1. Provider returned authoritative server metrics (Ollama via+ // eval_count/eval_duration) → use them. Most accurate.+ // 2. JS measurement with reasonable generation phase → use the+ // post-TTFT formula (the original Bug M fix). Works for+ // providers that don't return server metrics but where the+ // stream actually streams (proper chunk-by-chunk delivery).+ // 3. JS measurement collapsed to ~0ms generation phase → the+ // response was buffered (Tauri Rust proxy in release-mode+ // collects all bytes before returning, or WebView2 / Edge+ // aggregates TCP packets for fast small responses). The+ // post-TTFT formula would divide by ~0 and produce absurd+ // values like 685k tok/s. Fall back to wall-clock rate+ // (tokens/totalTime). It under-counts because it includes+ // load+TTFT time but at least is sane — and a real+ // improvement over pre-v2.4.7 where this case also produced+ // garbage just via a different formula path.+ const generationTimeMs = totalTime - firstTokenTime+ const hasApiMetrics = apiEvalCount !== undefined && apiEvalDurationMs !== undefined+ const isBuffered = !hasApiMetrics && generationTimeMs < 100 && totalTime > 0+ const reportedTokens = hasApiMetrics ? apiEvalCount! : tokenCount+ const reportedTps = hasApiMetrics+ ? (apiEvalCount! / apiEvalDurationMs!) * 1000+ : isBuffered+ ? (tokenCount / totalTime) * 1000+ : computeGenerationTps(tokenCount, totalTime, firstTokenTime)+store.addResult({modelName,promptId: prompt.id,- tokensPerSec: computeGenerationTps(tokenCount, totalTime, firstTokenTime),+ tokensPerSec: reportedTps,timeToFirstToken: firstTokenTime,totalTime,- totalTokens: tokenCount,+ totalTokens: reportedTokens,timestamp: Date.now(),})} catch {