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
fix(trainer): das Training raeumt die Karte wie ein Render und gibt sie zurueck
Davidef6127f7f8aa
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex daa15775..fe1190b5 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -254,8 +254,10 @@ and the built-in engine has a name of its own, the LU Engine.PyTorch whose Windows runtime library is missing gets the Visual C++ runtimeinstalled by LU instead of a link; the setup proves that PyTorch loadsbefore it calls the environment ready; a card below 12 GB is told so before- ten minutes of caching; and a run that runs out of memory on the card says- what to close. Lines from winget stay out of the note under the button.+ ten minutes of caching; the local chat model is paused for the run and+ comes back afterwards, so it no longer squats the memory the recipe needs;+ and a run that still runs out of memory on the card says what to close.+ Lines from winget stay out of the note under the button.- **AMD on Windows is read from the HIP SDK itself.** The only ROCm probe ranrocm-smi, which the Windows SDK does not ship, so an installed ROCm wentunseen. LU reads HIP_PATH and hipinfo now and names the card architecture,diff --git a/README.md b/README.mdindex 96b99670..d8905d1e 100644--- a/README.md+++ b/README.md@@ -64,7 +64,7 @@ Grab the latest release from [**Releases**](https://github.com/PurpleDoubleD/loc### What's new in 2.6.8-The compact release. Type /compact and the older turns of a long conversation are folded into a summary the chat model writes itself, so the chat keeps going instead of running out of room; auto-compact is opt-in under Settings and announces itself every time it fires. In Agent and Code mode the agent hands a self-contained task to a background agent that works while you carry on, a panel on the right shows what is running, and the main agent picks the result up on its own, on cloud and local models alike, without a single extra approval dialog. A reasoning model has an effort control beside its Think button, Low, Medium and High with Max on GLM 5.3, and GLM 5.3 (Pro) and GLM 5.3 Flash (Hosted) joined the cloud catalogue. A Local API under Settings gives every local model, LU Engine, Ollama and LM Studio, one OpenAI-compatible address on your machine, behind a token and off until you start it. Ctrl+K opens a command palette, first-run setup has a small window of its own, the collapsed side panel is an icon rail with the chat column draggable, and Chat works without a mouse. The built-in engine goes by LU Engine now: it moves to a free port when 8127 is taken, retries once after a start that fails, and a chat model you downloaded stays visible as Installed with a Use button that starts the engine for it. A running LM Studio keeps its own heading in the picker, and one click hands the local slot back to it. Model Storage is read now, not only written to, so every GGUF up to four levels down shows up under Installed, and the three backends got three named rows instead of one field labelled auto-detect. The CivitAI API key has a field again. Three uncensored models joined the catalogue, Qwen 3.8 27B Heretic, Gemma 4 12B Heretic and Qwen3-VL 8B Abliterated, GLM 5.3 is in it in the one variant the LU Engine can open, and the uncensored Qwen 3.8 27B rows come from OrcaRouter's abliteration with a Hugging Face token field on every platform. Document Chat works in Cloud mode, with your files indexed on your own machine. AMD on Windows is read from the HIP SDK, because the only ROCm probe ran rocm-smi and the Windows SDK does not ship it (#123); that one is researched rather than proven, since there is no RDNA4 card here. AMD cards on Linux report their memory size without ROCm installed, and on a rented AMD Instinct MI325X LU lists the card with its name and gfx target, installs PyTorch from the ROCm channel it picks, and rendered an image, a video, a song, a 4x upscale and a cutout in Create. Also fixed: the deb and the rpm ask for libvulkan1 and libgomp1, the ComfyUI installer proves that the environment it just built can import ComfyUI and Repair can be cancelled, a ComfyUI that will not start names the cause instead of sending you into a repair that cannot fix it, every Python step runs with UTF-8 output, German phrasing reaches the chat tools, Windows error messages arrive in English, the Mac stopped scanning your whole home folder for a ComfyUI it never runs there, LU starts MCP servers through npx and uvx only and says so by name, the Memory section reads its own export again, updates no longer leave the previous frontend behind, character training on a Windows machine with more than one GPU no longer dies at the first step over libuv (#121), and the Character Studio setup picks a Python 3.10 to 3.12 on its own instead of failing at the last step on a machine whose newest Python is 3.14, needs no git any more, checks the drive before the first byte, retries a dropped download, installs a missing Windows runtime library itself and tells a card below 12 GB so before it starts.+The compact release. Type /compact and the older turns of a long conversation are folded into a summary the chat model writes itself, so the chat keeps going instead of running out of room; auto-compact is opt-in under Settings and announces itself every time it fires. In Agent and Code mode the agent hands a self-contained task to a background agent that works while you carry on, a panel on the right shows what is running, and the main agent picks the result up on its own, on cloud and local models alike, without a single extra approval dialog. A reasoning model has an effort control beside its Think button, Low, Medium and High with Max on GLM 5.3, and GLM 5.3 (Pro) and GLM 5.3 Flash (Hosted) joined the cloud catalogue. A Local API under Settings gives every local model, LU Engine, Ollama and LM Studio, one OpenAI-compatible address on your machine, behind a token and off until you start it. Ctrl+K opens a command palette, first-run setup has a small window of its own, the collapsed side panel is an icon rail with the chat column draggable, and Chat works without a mouse. The built-in engine goes by LU Engine now: it moves to a free port when 8127 is taken, retries once after a start that fails, and a chat model you downloaded stays visible as Installed with a Use button that starts the engine for it. A running LM Studio keeps its own heading in the picker, and one click hands the local slot back to it. Model Storage is read now, not only written to, so every GGUF up to four levels down shows up under Installed, and the three backends got three named rows instead of one field labelled auto-detect. The CivitAI API key has a field again. Three uncensored models joined the catalogue, Qwen 3.8 27B Heretic, Gemma 4 12B Heretic and Qwen3-VL 8B Abliterated, GLM 5.3 is in it in the one variant the LU Engine can open, and the uncensored Qwen 3.8 27B rows come from OrcaRouter's abliteration with a Hugging Face token field on every platform. Document Chat works in Cloud mode, with your files indexed on your own machine. AMD on Windows is read from the HIP SDK, because the only ROCm probe ran rocm-smi and the Windows SDK does not ship it (#123); that one is researched rather than proven, since there is no RDNA4 card here. AMD cards on Linux report their memory size without ROCm installed, and on a rented AMD Instinct MI325X LU lists the card with its name and gfx target, installs PyTorch from the ROCm channel it picks, and rendered an image, a video, a song, a 4x upscale and a cutout in Create. Also fixed: the deb and the rpm ask for libvulkan1 and libgomp1, the ComfyUI installer proves that the environment it just built can import ComfyUI and Repair can be cancelled, a ComfyUI that will not start names the cause instead of sending you into a repair that cannot fix it, every Python step runs with UTF-8 output, German phrasing reaches the chat tools, Windows error messages arrive in English, the Mac stopped scanning your whole home folder for a ComfyUI it never runs there, LU starts MCP servers through npx and uvx only and says so by name, the Memory section reads its own export again, updates no longer leave the previous frontend behind, character training on a Windows machine with more than one GPU no longer dies at the first step over libuv (#121), and the Character Studio setup picks a Python 3.10 to 3.12 on its own instead of failing at the last step on a machine whose newest Python is 3.14, needs no git any more, checks the drive before the first byte, retries a dropped download, installs a missing Windows runtime library itself, pauses the local chat model for the run and tells a card below 12 GB so before it starts.### What's new in 2.6.7diff --git a/src/components/create/experimental/SpecialIntentControls.tsx b/src/components/create/experimental/SpecialIntentControls.tsxindex 43b07aea..a981bbd4 100644--- a/src/components/create/experimental/SpecialIntentControls.tsx+++ b/src/components/create/experimental/SpecialIntentControls.tsx@@ -395,7 +395,7 @@ function LocalTrainControls() {</div>{!isGenerating && (<div className="t-label text-gray-600 flex items-center gap-1.5">- <span>Runs on your GPU and takes a while ({trainSteps} steps). The character lands in your local LoRAs.</span>+ <span>Runs on your GPU and takes a while ({trainSteps} steps). The local chat model pauses for the run. The character lands in your local LoRAs.</span>{/* The run repairs its own environment now (A2), so this is nolonger the only way out of a broken install. It stays becausethe button used to render ONLY while the environment counted asdiff --git a/src/hooks/__tests__/das-training-raeumt-die-karte.test.ts b/src/hooks/__tests__/das-training-raeumt-die-karte.test.tsnew file mode 100644index 00000000..a434b492--- /dev/null+++ b/src/hooks/__tests__/das-training-raeumt-die-karte.test.ts@@ -0,0 +1,52 @@+/**+ * The local character trainer is a 12 GB recipe on a 12 GB card. A resident+ * chat model (built-in engine, Ollama, LM Studio) squats 2 to 9 GB of that,+ * and the run used to die in the text-encoder cache or the first training+ * step with CUDA out of memory. Measured on the Windows box on 06.09.2026:+ * 3.6 GB in use before a single training byte, all of it LU's own engines.+ *+ * runCharacterTraining now goes through the same hand-off as a render (Z36):+ * evict before the run starts, restore in the finally. This pins the order+ * and the restore, the way the render path's own tests do.+ *+ * Run: npx vitest run src/hooks/__tests__/das-training-raeumt-die-karte.test.ts+ */+import { describe, it, expect } from 'vitest'+import fs from 'node:fs'+import path from 'node:path'++const src = fs.readFileSync(path.join(__dirname, '..', 'useCreate.ts'), 'utf8')+const start = src.indexOf('const runCharacterTraining = useCallback(')+const end = src.indexOf('const generateInner = useCallback(')+const training = src.slice(start, end)++describe('the training run frees the card and gives it back', () => {+ it('slices the training function, not the render', () => {+ expect(start).toBeGreaterThan(0)+ expect(end).toBeGreaterThan(start)+ })++ it('evicts the chat backends before the run starts', () => {+ const evict = training.indexOf('await evictChatBackendsForRender()')+ const begin = training.indexOf('await startCharacterTraining(')+ expect(evict).toBeGreaterThan(0)+ expect(begin).toBeGreaterThan(evict)+ })++ it('stages the photos first, so a failed staging never evicts anything', () => {+ const stage = training.indexOf('await stageTrainingImage(')+ const evict = training.indexOf('await evictChatBackendsForRender()')+ expect(stage).toBeGreaterThan(0)+ expect(evict).toBeGreaterThan(stage)+ })++ it('brings the chat backends back in the finally, whatever the run did', () => {+ const fin = training.lastIndexOf('} finally {')+ expect(fin).toBeGreaterThan(0)+ expect(training.slice(fin)).toContain('restoreChatBackendsAfterRender(trainingEviction)')+ })++ it('tells the user what happens to the chat model', () => {+ expect(training).toContain('the local chat model pauses until the run ends')+ })+})diff --git a/src/hooks/useCreate.ts b/src/hooks/useCreate.tsindex 2da12ae6..0c422ac0 100644--- a/src/hooks/useCreate.ts+++ b/src/hooks/useCreate.ts@@ -388,6 +388,13 @@ export function useCreate() {setError(null)setIsGenerating(true)trainingActive.current = true+ // The trainer is a 12 GB recipe on a 12 GB card. A resident chat model+ // (the built-in engine, Ollama, LM Studio) squats 2 to 9 GB of that and+ // the run dies in the text-encoder cache or the first training step with+ // CUDA out of memory. Same hand-off as a render (Z36): capture what is+ // resident, save the built-in engine's KV slot, evict, and bring it all+ // back in the finally below. exclusiveVramMode 'never' skips it.+ let trainingEviction: RenderEviction | null = nulltry {const setId = triggerawait clearTrainingSet(setId)@@ -399,6 +406,10 @@ export function useCreate() {n += 1setProgress(2 + Math.round((n / staged.length) * 5), `Staging photos (${n}/${staged.length})...`)}+ setProgress(7, 'Freeing the card for training (the local chat model pauses until the run ends)...')+ try {+ trainingEviction = await evictChatBackendsForRender()+ } catch { /* VRAM housekeeping is best-effort */ }setProgress(8, 'Starting the training run...')await startCharacterTraining(setId, trigger, trigger, state.trainSteps)for (;;) {@@ -440,6 +451,9 @@ export function useCreate() {trainingActive.current = falseuseCreateStore.getState().setIsGenerating(false)useCreateStore.getState().setProgress(0)+ // The chat model comes back the way it does after a render: fire and+ // forget, the reload must not hold the Create UI.+ if (trainingEviction) void restoreChatBackendsAfterRender(trainingEviction)}}, [])diff --git a/src/lib/release-notes.ts b/src/lib/release-notes.tsindex 202d98ae..4665c549 100644--- a/src/lib/release-notes.ts+++ b/src/lib/release-notes.ts@@ -86,7 +86,7 @@ export const RELEASE_NOTES: ReleaseNote[] = ['The ComfyUI installer checks that the environment it just built can import ComfyUI, installs what is missing, and names a missing Visual C++ runtime instead of ending in a silent crash.','Repair environment runs the same check with a time limit and a Cancel button that stops it, and the trainer setup stopped blaming the network for failures that had nothing to do with the network.','Character Studio sets itself up on a machine whose Python is too new. The trainer needs Python 3.10 to 3.12, and LU built its environment from whatever Python was newest, so a machine with 3.14 failed at the last step on every update since August. The setup now picks a Python from that range by itself, installs 3.12 on Windows if there is none, and rebuilds an environment that came from the wrong one. The failure text under the button also stopped being cut after one line. Reported in Discord ticket 0004.',- 'The local trainer no longer hands out instructions. On the way from Set up trainer to a finished character every dead end fixes itself or names its cause: the trainer source comes as an archive and needs no git on the machine, the drive is checked for room before the first byte, a download that breaks off is retried twice, a missing Windows runtime library for PyTorch is installed by LU through winget instead of a link to microsoft.com, the setup proves that PyTorch loads before it calls the environment ready, a card with less than 12 GB hears that before ten minutes of caching, and a run that runs out of memory on the card says what to close. winget output stays out of the note under the button.',+ 'The local trainer no longer hands out instructions. On the way from Set up trainer to a finished character every dead end fixes itself or names its cause: the trainer source comes as an archive and needs no git on the machine, the drive is checked for room before the first byte, a download that breaks off is retried twice, a missing Windows runtime library for PyTorch is installed by LU through winget instead of a link to microsoft.com, the setup proves that PyTorch loads before it calls the environment ready, a card with less than 12 GB hears that before ten minutes of caching, the local chat model is paused for the run and comes back afterwards instead of squatting the memory the recipe needs, and a run that still runs out of memory on the card says what to close. winget output stays out of the note under the button.','A ComfyUI that will not start names the cause. A missing Visual C++ runtime, or a graphics driver older than the PyTorch that was installed, used to arrive as "the Python environment looks broken" next to a Repair button, and neither of those lives in the folder Repair rebuilds. The message now says which of the two it is, and LU no longer starts a repair that cannot fix it.','AMD on Windows is read from the HIP SDK itself. The only ROCm probe ran rocm-smi, which the Windows SDK does not ship, so an installed ROCm went unseen. LU reads HIP_PATH and hipinfo now and names the card architecture, and an image run that fails names that architecture and get_arch_list instead of a HIP traceback. This is marked as researched rather than proven, because there is no RDNA4 card here.','The Model Manager stopped putting system RAM in the GPU field. ComfyUI reports system memory on a CPU device in a field called vram_total, so a machine with 64 GB of RAM read as if it had 62 GB of video memory.',