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(neuron): centred empty state with ways to an LU Engine model; Get names its target

purple301df8d56f22
diff --git a/src/components/models/DiscoverModels.tsx b/src/components/models/DiscoverModels.tsx
index 8aaa295c..d03495d8 100644
--- a/src/components/models/DiscoverModels.tsx
+++ b/src/components/models/DiscoverModels.tsx
@@ -39,7 +39,8 @@ import { findInstalledForDiscoverModel } from '../../lib/discover-installed'
import { isBuiltinEngineEntry } from '../../lib/lmstudio-match'
import { ensureLuEngineIsChatProvider, announceLuEngineSwitch } from '../../api/lu-engine-switch'
import { LuEngineSwitchBar } from '../chat/LuEngineSwitchBar'
-import { ollamaOnlyDownloadBlock, resolveTextDownloadTarget } from '../../lib/text-download-target'
+import { chosenTextDownloadTarget, ollamaOnlyDownloadBlock, resolveTextDownloadTarget, textDownloadTargetLabel } from '../../lib/text-download-target'
+import { useUIStore } from '../../stores/uiStore'
import { mayBeStartHerePick } from '../../lib/start-here-picks'
import { modelInfoTitle } from '../../lib/model-info-title'
import { hfUrlToOllamaRef, hfUrlToLmStudioSubdir, parseHfUrl, isShardedOrIncompatibleGguf } from '../../lib/hf-to-provider'
@@ -480,6 +481,12 @@ export function DiscoverModels({ category, search = '', searchSubmitToken = 0 }:
// heisst in dieser App „kaputt oder wird geloescht" (siehe die Begruendung
// am `.lu-control`-Rezept in index.css).
const [installNotice, setInstallNotice] = useState<string | null>(null)
+ // Where Get sends a chat model on this visit (P11, David 2026-10-30). Null
+ // follows the chat model (resolveTextDownloadTarget); 'builtin' is the
+ // user's choice of the LU Engine for these downloads, without switching the
+ // chat model first. A button elsewhere (the Neuron tweaker) can hand it in.
+ const [targetChoice, setTargetChoice] = useState<'builtin' | null>(() => useUIStore.getState().discoverTarget)
+ useEffect(() => { useUIStore.getState().clearDiscoverTarget() }, [])
// T-69: ein Controller pro Installationsversuch. Er bricht ab, wenn die
// Ansicht verschwindet — AppShell haengt Models an `currentView === 'models'`
// (`AppShell.tsx:955`), ein Wechsel haengt sie also wirklich ab — und wenn
@@ -682,6 +689,18 @@ export function DiscoverModels({ category, search = '', searchSubmitToken = 0 }:
return `Download failed: ${msg}`
}
+ const targetInput = {
+ activeChatModel,
+ openai: providers.openai,
+ ollamaEnabled: !!providers.ollama?.enabled,
+ }
+ const followTarget = resolveTextDownloadTarget(targetInput)
+ const shownTarget = chosenTextDownloadTarget(targetInput, targetChoice)
+ const targetName = (t: typeof shownTarget) => textDownloadTargetLabel(t, providers.openai?.name)
+ /** What a tile's Get says it fills. An entry only Ollama can pull goes
+ * there whatever was chosen (handleTextDownload). */
+ const getTargetOf = (m: DiscoverModel) => (m.ollamaModel ? 'Ollama' : targetName(shownTarget))
+
const handleTextDownload = async (model: DiscoverModel) => {
// Bug Y/a v2.5.0 — a user Discord. Pre-v2.5.0 we picked the
// download backend by "whichever is enabled" with LM Studio winning when
@@ -700,11 +719,10 @@ export function DiscoverModels({ category, search = '', searchSubmitToken = 0 }:
// them and the file went down the LM Studio branch into a nested folder
// the built-in engine never scans. resolveTextDownloadTarget keeps the
// active-model rule and adds the missing fallback.
- const downloadTarget = resolveTextDownloadTarget({
- activeChatModel,
- openai: providers.openai,
- ollamaEnabled: !!providers.ollama?.enabled,
- })
+ const downloadTarget = chosenTextDownloadTarget(targetInput, targetChoice)
+ // Chosen against the chat model: the file goes to the LU Engine, and the
+ // chat stays on the model the user is talking to.
+ const keepChatModel = downloadTarget === 'builtin' && resolveTextDownloadTarget(targetInput) !== 'builtin'
const isActiveBuiltin = downloadTarget === 'builtin'
const isActiveLmStudio = downloadTarget === 'lmstudio'
const isActiveOllama = downloadTarget === 'ollama'
@@ -847,7 +865,9 @@ export function DiscoverModels({ category, search = '', searchSubmitToken = 0 }:
}
const plan = planModelDownload(model, realUrl, realName, realBytes, single?.sha256, { part, withImagePart: withPart })
await startPlannedDownload(plan, targetDir, model.group || model.name)
- if (isActiveBuiltin) {
+ if (isActiveBuiltin && keepChatModel) {
+ setInstallNotice(`${model.name} is downloading to the LU Engine. Your chat stays on its model; the Neuron tweaker and the model list show it once it is done.`)
+ } else if (isActiveBuiltin) {
// Built-in engine: await the flat GGUF, then make it the active chat
// model so the freshly-added model is chat-ready without a manual switch.
// The projector is awaited too: booting before it lands would bring the
@@ -978,6 +998,7 @@ export function DiscoverModels({ category, search = '', searchSubmitToken = 0 }:
isInstalled={isModelFullyInstalled}
dlState={getModelDownloadState}
onDownload={handleTextDownload}
+ getTarget={getTargetOf}
onUse={handleUseInstalled}
canUse={canUseInstalled}
isUsing={(m) => installedEntryFor(m)?.name === usingModel && usingModel !== null}
@@ -1058,6 +1079,24 @@ export function DiscoverModels({ category, search = '', searchSubmitToken = 0 }:
legend={isText && (uncensoredModels.length > 0 || mainstreamModels.length > 0)}
/>
+ {/* Where Get puts a chat model, and the way to choose the LU Engine
+ for it (P11). Only where it is a choice: when the chat model already
+ runs on the LU Engine there is nothing to pick. */}
+ {isText && (
+ <div className="flex flex-wrap items-center gap-x-2 gap-y-1 t-body text-gray-600 dark:text-gray-300" data-testid="discover-target">
+ <span>Get downloads to <span className="font-semibold text-gray-900 dark:text-white" data-testid="discover-target-name">{targetName(shownTarget)}</span>{targetChoice === 'builtin' && followTarget !== 'builtin' ? ' for now.' : '.'}</span>
+ {followTarget !== 'builtin' && (targetChoice === 'builtin' ? (
+ <button className="lu-control" onClick={() => setTargetChoice(null)} data-testid="discover-target-follow">
+ Back to {targetName(followTarget)}
+ </button>
+ ) : (
+ <button className="lu-control" onClick={() => setTargetChoice('builtin')} data-testid="discover-target-builtin" title="The Neuron tweaker and the LU Engine only use files in the LU Engine. Your chat model stays as it is.">
+ Send to LU Engine instead
+ </button>
+ ))}
+ </div>
+ )}
+
{/* Install error banner */}
{installError && (
<div className="flex items-center gap-2 p-3 rounded-lg bg-red-500/10 border border-red-500/20 text-red-400 text-sm">
@@ -1219,6 +1258,7 @@ export function DiscoverModels({ category, search = '', searchSubmitToken = 0 }:
isInstalled={isModelFullyInstalled}
dlState={getModelDownloadState}
onDownload={handleTextDownload}
+ getTarget={getTargetOf}
onUse={handleUseInstalled}
canUse={canUseInstalled}
isUsing={(m) => installedEntryFor(m)?.name === usingModel && usingModel !== null}
diff --git a/src/components/models/ModelTiles.tsx b/src/components/models/ModelTiles.tsx
index 40470f9c..86b2832d 100644
--- a/src/components/models/ModelTiles.tsx
+++ b/src/components/models/ModelTiles.tsx
@@ -389,6 +389,10 @@ export interface ModelTileProps {
isInstalled: (m: DiscoverModel) => boolean
dlState: (m: DiscoverModel) => DownloadProgress | null
onDownload: (m: DiscoverModel) => void
+ /** Where Get puts THIS row ("LU Engine", "Ollama", …). Shown on the
+ * button, so a download never lands somewhere the user did not see (P11).
+ * Absent: the plain Get. */
+ getTarget?: (m: DiscoverModel) => string
onInfo: (m: DiscoverModel) => void
onOpenUrl: (url: string) => void
/** Load an already installed model into the chat. GH #118: without this the
@@ -415,7 +419,7 @@ export interface ModelTileProps {
* open state with its two ways out. The two faces of the tile (this file for
* the Mac, skin/ClassicTiles.tsx for Windows and Linux) both stand on it, so
* the rules exist once. */
-export function useModelTile({ variants, vramGb, isInstalled, dlState, onUse, canUse, isUsing, withImagePart }: ModelTileProps) {
+export function useModelTile({ variants, vramGb, isInstalled, dlState, onUse, canUse, isUsing, withImagePart, getTarget }: ModelTileProps) {
const [pickerOpen, setPickerOpen] = useState(false)
const [chosen, setChosen] = useState<string | null>(null)
const pickerRef = useRef<HTMLDivElement>(null)
@@ -463,18 +467,20 @@ export function useModelTile({ variants, vramGb, isInstalled, dlState, onUse, ca
// What the Get button says it fetches. With an image part that comes along
// the two halves are named, so the sum on the tile is not a surprise.
- const downloadTitle = !selSize
+ const target = getTarget?.(sel) ?? null
+ const downloadWhat = !selSize
? 'Download'
: partComes
? `Download ${selSize} GB (model ${sel.sizeGB} GB, image input ${gbOf(sel.mmprojBytes)} GB)`
: `Download ${selSize} GB`
+ const downloadTitle = target ? `${downloadWhat} to ${target}` : downloadWhat
- return { pickerOpen, setPickerOpen, setChosen, pickerRef, variantListRef, variantList, sel, groupTitle, dl, downloading, fit, action, sizeOf, selSize, downloadTitle }
+ return { target, pickerOpen, setPickerOpen, setChosen, pickerRef, variantListRef, variantList, sel, groupTitle, dl, downloading, fit, action, sizeOf, selSize, downloadTitle }
}
export function ModelTile(props: ModelTileProps) {
const { variants, vramGb, sharedMemory = false, isInstalled, dlState, onDownload, onInfo, onOpenUrl, onUse, highlight } = props
- const { pickerOpen, setPickerOpen, setChosen, pickerRef, variantListRef, variantList, sel, groupTitle, dl, downloading, fit, action, sizeOf, selSize, downloadTitle } = useModelTile(props)
+ const { pickerOpen, setPickerOpen, setChosen, pickerRef, variantListRef, variantList, sel, groupTitle, dl, downloading, fit, action, sizeOf, selSize, downloadTitle, target } = useModelTile(props)
// A model past what this machine can give it keeps its Get, without the
// tint that recommends it, and its name steps back one tone.
@@ -633,7 +639,7 @@ export function ModelTile(props: ModelTileProps) {
className={fitsHere ? TILE_ACTION : TILE_ACTION_QUIET}
title={downloadTitle}
>
- <Download size={ICON_SM} /> Get
+ <Download size={ICON_SM} /> Get{target && <span className="opacity-70">→ {target}</span>}
</button>
)}
</div>
diff --git a/src/components/models/__tests__/get-sagt-wohin-der-download-geht.test.tsx b/src/components/models/__tests__/get-sagt-wohin-der-download-geht.test.tsx
new file mode 100644
index 00000000..c8e8a4c5
--- /dev/null
+++ b/src/components/models/__tests__/get-sagt-wohin-der-download-geht.test.tsx
@@ -0,0 +1,131 @@
+/**
+ * @vitest-environment jsdom
+ *
+ * P11, David aus dem Testbau (30.10.2026): wohin "Get" ein Chatmodell laedt,
+ * entschied resolveTextDownloadTarget nach dem aktiven Chatmodell, und der
+ * Nutzer sah es nirgends. Mit einem Ollama-Modell im Chat landete ein GGUF in
+ * Ollama, und der Neuron tweaker, der nur LU-Engine-Dateien liest, kannte es
+ * nie.
+ *
+ * Am gerenderten Discover: das Ziel steht ueber der Liste und am Get-Knopf,
+ * "Send to LU Engine instead" schickt den naechsten Download in die LU Engine,
+ * ohne das Chatmodell zu wechseln, und der Knopf des Neuron tweakers kommt
+ * mit diesem Ziel schon gesetzt an.
+ *
+ * Gegenprobe: ohne die Zeile, ohne `getTarget` an den Kacheln oder ohne
+ * `chosenTextDownloadTarget` in handleTextDownload ist jeder Fall rot.
+ *
+ * Lauf: npx vitest run src/components/models/__tests__/get-sagt-wohin-der-download-geht.test.tsx
+ */
+import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'
+import { render, screen, cleanup, waitFor, fireEvent } from '@testing-library/react'
+
+const started = vi.hoisted(() => [] as Array<{ dir: string }>)
+const pullModel = vi.hoisted(() => vi.fn(async () => {}))
+const setActiveModel = vi.hoisted(() => vi.fn(async () => {}))
+
+vi.mock('../../../api/backend', async (importOriginal) => ({
+ ...(await importOriginal<typeof import('../../../api/backend')>()),
+ backendCall: vi.fn(async () => []),
+ openExternal: vi.fn(),
+ isTauri: () => false,
+ isMacOS: () => false,
+}))
+vi.mock('../../../api/comfyui', async (importOriginal) => ({
+ ...(await importOriginal<typeof import('../../../api/comfyui')>()),
+ getSystemVRAM: vi.fn(async () => 24),
+ readComfyFolderLists: vi.fn(async () => ({})),
+ refreshComfyModels: vi.fn(async () => {}),
+}))
+vi.mock('../../../api/discover', async (importOriginal) => ({
+ ...(await importOriginal<typeof import('../../../api/discover')>()),
+ resolveHfGgufFiles: vi.fn(async () => null),
+ luEngineDownloadDir: vi.fn(async () => '/lu/models'),
+ detectProviderModelPath: vi.fn(async () => '/lmstudio/models'),
+ checkDownloadSpace: vi.fn(async () => null),
+}))
+vi.mock('../../../api/model-download', () => ({
+ startPlannedDownload: vi.fn(async (_plan: unknown, dir: string) => { started.push({ dir }) }),
+}))
+vi.mock('../../../hooks/useModels', () => ({
+ useModels: () => ({ pullModel, models: [], fetchModels: async () => {}, setActiveModel }),
+}))
+vi.mock('../../../lib/hardware', async (importOriginal) => ({
+ ...(await importOriginal<typeof import('../../../lib/hardware')>()),
+ getMaxVramGb: vi.fn(async () => 24),
+ getTotalRamGb: vi.fn(async () => 64),
+}))
+vi.mock('../CivitaiSearchPanel', () => ({ CivitaiSearchPanel: () => null }))
+vi.mock('../../chat/LuEngineSwitchBar', () => ({ LuEngineSwitchBar: () => null }))
+
+import { DiscoverModels } from '../DiscoverModels'
+import { useModelStore } from '../../../stores/modelStore'
+import { useProviderStore } from '../../../stores/providerStore'
+import { useUIStore } from '../../../stores/uiStore'
+
+const gets = () => screen.getAllByRole('button', { name: /^Get/ })
+const targetName = () => screen.getByTestId('discover-target-name').textContent
+
+function ollamaInChat() {
+ const p = useProviderStore.getState().providers
+ useProviderStore.setState({
+ providers: {
+ ...p,
+ ollama: { ...p.ollama, enabled: true },
+ openai: { ...p.openai, enabled: true, managed: true, name: 'LU Engine' },
+ },
+ })
+ useModelStore.setState({ activeModel: 'llama3:8b' })
+}
+
+beforeEach(() => {
+ started.length = 0
+ pullModel.mockClear()
+ setActiveModel.mockClear()
+ useUIStore.setState({ discoverTarget: null })
+ vi.stubGlobal('ResizeObserver', class { observe() {} unobserve() {} disconnect() {} })
+})
+afterEach(() => { cleanup(); vi.unstubAllGlobals() })
+
+describe('Get says where a chat model goes', () => {
+ it('names Ollama when an Ollama model is in the chat, above the list and on Get', async () => {
+ ollamaInChat()
+ render(<DiscoverModels category="text" />)
+ await waitFor(() => expect(targetName()).toBe('Ollama'))
+ expect(gets().length).toBeGreaterThan(0)
+ for (const b of gets()) expect(b.textContent).toMatch(/→ Ollama$/)
+ })
+
+ it('LU Engine for this download: the file lands in the LU Engine folder and the chat model stays', async () => {
+ ollamaInChat()
+ render(<DiscoverModels category="text" />)
+ fireEvent.click(await screen.findByTestId('discover-target-builtin'))
+ expect(targetName()).toBe('LU Engine')
+ const get = gets().find((b) => /→ LU Engine$/.test(b.textContent ?? ''))!
+ expect(get).toBeTruthy()
+ fireEvent.click(get)
+ await waitFor(() => expect(started).toEqual([{ dir: '/lu/models' }]))
+ expect(pullModel).not.toHaveBeenCalled()
+ expect(setActiveModel).not.toHaveBeenCalled()
+ expect(useModelStore.getState().activeModel).toBe('llama3:8b')
+ // And back: the next Get follows the chat model again.
+ fireEvent.click(screen.getByTestId('discover-target-follow'))
+ expect(targetName()).toBe('Ollama')
+ })
+
+ it('arrives with the LU Engine set when the Neuron tweaker sent the user here', async () => {
+ ollamaInChat()
+ useUIStore.getState().openDiscoverFor('builtin')
+ render(<DiscoverModels category="text" />)
+ await waitFor(() => expect(targetName()).toBe('LU Engine'))
+ expect(useUIStore.getState().discoverTarget).toBeNull()
+ })
+
+ it('offers no choice when the chat model already runs on the LU Engine', async () => {
+ ollamaInChat()
+ useModelStore.setState({ activeModel: 'openai::qwen' })
+ render(<DiscoverModels category="text" />)
+ await waitFor(() => expect(targetName()).toBe('LU Engine'))
+ expect(screen.queryByTestId('discover-target-builtin')).toBeNull()
+ })
+})
diff --git a/src/components/models/skin/ClassicTiles.tsx b/src/components/models/skin/ClassicTiles.tsx
index 20837bde..7fca82cb 100644
--- a/src/components/models/skin/ClassicTiles.tsx
+++ b/src/components/models/skin/ClassicTiles.tsx
@@ -87,7 +87,7 @@ export function SizePill({ sizeGB, bytes }: { sizeGB?: number; bytes?: number })
export function ClassicModelTile(props: ModelTileProps) {
const { variants, vramGb, sharedMemory = false, isInstalled, dlState, onDownload, onInfo, onOpenUrl, onUse, highlight } = props
- const { pickerOpen, setPickerOpen, setChosen, pickerRef, variantListRef, variantList, sel, groupTitle, dl, downloading, fit, action, sizeOf, selSize, downloadTitle } = useModelTile(props)
+ const { pickerOpen, setPickerOpen, setChosen, pickerRef, variantListRef, variantList, sel, groupTitle, dl, downloading, fit, action, sizeOf, selSize, downloadTitle, target } = useModelTile(props)
return (
<div
@@ -222,7 +222,7 @@ export function ClassicModelTile(props: ModelTileProps) {
className={TILE_ACTION}
title={downloadTitle}
>
- <Download size={ICON_SM} /> Get
+ <Download size={ICON_SM} /> Get{target && <span className="opacity-70">→ {target}</span>}
</button>
)}
</div>
diff --git a/src/components/neuron/NeuronView.tsx b/src/components/neuron/NeuronView.tsx
index 6d195df4..294adbd5 100644
--- a/src/components/neuron/NeuronView.tsx
+++ b/src/components/neuron/NeuronView.tsx
@@ -1,10 +1,10 @@
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
-import { Loader2, RotateCcw, Search, Sliders, Trash2 } from 'lucide-react'
+import { Download, FilePlus, Loader2, RotateCcw, Search, Sliders, Trash2 } from 'lucide-react'
import { Hinweis } from '../ui/Hinweis'
import { HINWEIS_TEXT } from '../../lib/hinweis'
import { ICON_SM } from '../ui/icon-size'
import { openExternal } from '../../api/backend'
-import { listBundledModels, bundledEngineStatus, isEmbeddingGgufName, type BundledModel } from '../../api/engine'
+import { addGgufFile, listBundledModels, bundledEngineStatus, isEmbeddingGgufName, type BundledModel } from '../../api/engine'
import {
neuronApply, neuronBuildOwn, neuronBuildPreset, neuronCancel, neuronCompare, neuronDelete, neuronDismiss,
neuronFeatureAdd, neuronInfo, neuronPresets, neuronSaeDownload, neuronSaeSearch, neuronStatus,
@@ -22,11 +22,14 @@ import { editingKey, useNeuronStore } from '../../stores/neuronStore'
import { useModelStore } from '../../stores/modelStore'
import { useChatStore } from '../../stores/chatStore'
import { useSettingsStore } from '../../stores/settingsStore'
+import { useUIStore } from '../../stores/uiStore'
import type { BuiltinEngineTuning } from '../../types/settings'
const APPLY_DELAY_MS = 700
-const NO_CHAT_MODEL = 'There is no chat model for LU Engine yet. Download one to start. An embedding model (the one Document Chat uses) cannot be tweaked.'
+const NO_CHAT_MODEL = 'The tweaker works on chat models the LU Engine runs. Download one, or use a GGUF file you already have. An embedding model (the one Document Chat uses) cannot be tweaked.'
+/** Why a model the user already has in Ollama or LM Studio is not offered. */
+const OTHER_APPS = 'Models in Ollama or LM Studio do not show up here: those programs take no control vectors, so the sliders cannot reach them.'
/** Which program answers the chat's model right now. */
function chatBackend(activeModel: string | null, appMode: string | undefined): BackendKind {
@@ -87,9 +90,13 @@ export function NeuronView() {
const pathRef = useRef(modelPath)
pathRef.current = modelPath
- // Models and presets once; the loaded model (or the chat's) preselected.
+ // Presets once; the models once and again after a GGUF file was added
+ // from the empty state. The loaded model (or the chat's) preselected.
+ const [modelsSeq, setModelsSeq] = useState(0)
useEffect(() => {
void neuronPresets().then(setPresets).catch(() => setPresets([]))
+ }, [])
+ useEffect(() => {
void listBundledModels().then((all) => {
// Chat models only: an embedding model (Document Chat's) has no chat
// turn to steer, and the vector tool aborts on it.
@@ -100,7 +107,7 @@ export function NeuronView() {
setModelPath((cur) => cur || (chat ?? loaded ?? list[0])?.path || '')
}).catch(() => setModels([])).finally(() => setModelsLoaded(true))
// eslint-disable-next-line react-hooks/exhaustive-deps
- }, [])
+ }, [modelsSeq])
const refreshInfo = useCallback(async (path: string) => {
if (!path) return
@@ -200,10 +207,21 @@ export function NeuronView() {
if (modelsLoaded && models.length === 0) {
return (
- <Shell>
- {backend !== 'lu-engine' && backend !== 'none' && <Hinweis className="mb-3">{backendNote(backend)}</Hinweis>}
- <Hinweis><span data-testid="neuron-no-chat-model">{NO_CHAT_MODEL}</span></Hinweis>
- </Shell>
+ <NoModel
+ onDownload={() => {
+ useModelStore.getState().setCategoryFilter('text')
+ useUIStore.getState().openDiscoverFor('builtin')
+ }}
+ onAddFile={async () => {
+ try {
+ if (await addGgufFile()) setModelsSeq((n) => n + 1)
+ } catch (e) {
+ setError(String(e))
+ }
+ }}
+ error={error}
+ onDismissError={() => setError(null)}
+ />
)
}
@@ -339,6 +357,37 @@ export function NeuronView() {
)
}
+/** No LU Engine chat model yet: one centred state with the two ways to get
+ * one (David, 2026-10-30: the line used to sit at the top, "hingeklatscht").
+ * Download opens Discover with the LU Engine as the target whatever the chat
+ * model is, so the file lands where the tweaker can read it. */
+function NoModel({ onDownload, onAddFile, error, onDismissError }: {
+ onDownload: () => void
+ onAddFile: () => void
+ error: string | null
+ onDismissError: () => void
+}) {
+ return (
+ <div className="h-full overflow-y-auto scrollbar-thin flex items-center justify-center px-6 py-8" data-testid="neuron-view">
+ <div className="max-w-md flex flex-col items-center text-center gap-3" data-testid="neuron-empty">
+ <Sliders size={32} className="text-gray-400 dark:text-gray-500" aria-hidden />
+ <h1 className="t-title text-gray-900 dark:text-white">No chat model for the LU Engine yet</h1>
+ <p className="t-body text-gray-600 dark:text-gray-300" data-testid="neuron-no-chat-model">{NO_CHAT_MODEL}</p>
+ <p className={`t-body ${HINWEIS_TEXT.ruhig}`} data-testid="neuron-other-apps">{OTHER_APPS}</p>
+ <div className="flex flex-wrap items-center justify-center gap-2 pt-1">
+ <button className="lu-tonal" onClick={onDownload} data-testid="neuron-get-model">
+ <Download size={ICON_SM} /> Get a model for the LU Engine
+ </button>
+ <button className="lu-control" onClick={onAddFile} data-testid="neuron-add-gguf" title="Use a GGUF file from your drive as a chat model on the LU Engine">
+ <FilePlus size={ICON_SM} /> GGUF file
+ </button>
+ </div>
+ {error && <Hinweis ton="fehler" className="mt-2 text-left" onDismiss={onDismissError}>{error}</Hinweis>}
+ </div>
+ </div>
+ )
+}
+
function Shell({ children }: { children: React.ReactNode }) {
return (
<div className="h-full overflow-y-auto scrollbar-thin" data-testid="neuron-view">
diff --git a/src/components/neuron/__tests__/neuron-view-steers-the-engine.test.tsx b/src/components/neuron/__tests__/neuron-view-steers-the-engine.test.tsx
index 69b314c5..e28e3328 100644
--- a/src/components/neuron/__tests__/neuron-view-steers-the-engine.test.tsx
+++ b/src/components/neuron/__tests__/neuron-view-steers-the-engine.test.tsx
@@ -43,7 +43,9 @@ vi.mock('../../../api/neuron', () => ({
neuronBuildOwn: vi.fn(), neuronCancel: vi.fn(), neuronCompare: vi.fn(), neuronDelete: vi.fn(), neuronDismiss: vi.fn(),
neuronFeatureAdd: vi.fn(), neuronSaeDownload: vi.fn(), neuronSaeSearch: vi.fn(),
}))
+const addGgufFile = vi.hoisted(() => vi.fn(async (): Promise<string | null> => null))
vi.mock('../../../api/engine', () => ({
+ addGgufFile: () => addGgufFile(),
listBundledModels: async () => [...disk.models],
isEmbeddingGgufName: (name: string) => /embed/.test(name.toLowerCase()),
bundledEngineStatus: async () => ({ running: true, healthy: true, port: 8127, model_path: '/models/qwen.gguf', ctx: 8192 }),
@@ -62,6 +64,7 @@ import { useModelStore } from '../../../stores/modelStore'
import { useNeuronStore } from '../../../stores/neuronStore'
import { useSettingsStore } from '../../../stores/settingsStore'
import { useChatStore } from '../../../stores/chatStore'
+import { useUIStore } from '../../../stores/uiStore'
import type { Persona } from '../../../types/settings'
beforeEach(() => {
@@ -161,11 +164,50 @@ describe('Neuron tweaker view', () => {
disk.models = [NOMIC]
useModelStore.setState({ activeModel: 'ollama::llama3:8b' })
render(createElement(NeuronView))
- expect((await screen.findByTestId('neuron-no-chat-model')).textContent).toMatch(/no chat model/)
- expect(screen.getByText(/Ollama takes no control vectors/)).toBeTruthy()
+ expect((await screen.findByTestId('neuron-empty')).textContent).toMatch(/No chat model for the LU Engine yet/)
+ expect(screen.getByTestId('neuron-no-chat-model').textContent).toMatch(/embedding model/)
+ // Why the Ollama model the user has is not offered, in one sentence.
+ expect(screen.getByTestId('neuron-other-apps').textContent).toMatch(/Ollama or LM Studio .* take no control vectors/)
expect(screen.queryByTestId('neuron-model')).toBeNull()
})
+ // David, 30.10.2026: the line sat at the top, "hingeklatscht". It is one
+ // state in the middle of the panel, both ways, with its text centred.
+ it('stands in the middle of the panel when there is no model', async () => {
+ disk.models = []
+ render(createElement(NeuronView))
+ const box = await screen.findByTestId('neuron-empty')
+ const panel = screen.getByTestId('neuron-view')
+ expect(panel.className).toMatch(/\bh-full\b/)
+ expect(panel.className).toMatch(/\bflex\b/)
+ expect(panel.className).toMatch(/\bitems-center\b/)
+ expect(panel.className).toMatch(/\bjustify-center\b/)
+ expect(box.className).toMatch(/\btext-center\b/)
+ expect(box.className).toMatch(/\bitems-center\b/)
+ })
+
+ it('its download button opens Discover on the chat lane with the LU Engine as target', async () => {
+ disk.models = []
+ useModelStore.setState({ activeModel: 'llama3:8b', categoryFilter: 'image' })
+ useUIStore.setState({ currentView: 'neuron', discoverTarget: null })
+ render(createElement(NeuronView))
+ fireEvent.click(await screen.findByTestId('neuron-get-model'))
+ expect(useUIStore.getState().currentView).toBe('models')
+ expect(useUIStore.getState().discoverTarget).toBe('builtin')
+ expect(useModelStore.getState().categoryFilter).toBe('text')
+ // The chat model is not touched.
+ expect(useModelStore.getState().activeModel).toBe('llama3:8b')
+ })
+
+ it('its GGUF file button adds a file and the tweaker opens on it', async () => {
+ disk.models = []
+ addGgufFile.mockImplementationOnce(async () => { disk.models = [QWEN]; return QWEN.name })
+ render(createElement(NeuronView))
+ fireEvent.click(await screen.findByTestId('neuron-add-gguf'))
+ expect(await screen.findByTestId('neuron-model')).toBeTruthy()
+ expect(addGgufFile).toHaveBeenCalledTimes(1)
+ })
+
it('says plainly when the chat model runs in Ollama', async () => {
useModelStore.setState({ activeModel: 'ollama::llama3:8b' })
render(createElement(NeuronView))
diff --git a/src/lib/__tests__/text-download-target.test.ts b/src/lib/__tests__/text-download-target.test.ts
index bed7b1cc..ba570976 100644
--- a/src/lib/__tests__/text-download-target.test.ts
+++ b/src/lib/__tests__/text-download-target.test.ts
@@ -15,7 +15,7 @@
* Run: npx vitest run src/lib/__tests__/text-download-target.test.ts
*/
import { describe, it, expect } from 'vitest'
-import { resolveTextDownloadTarget } from '../text-download-target'
+import { resolveTextDownloadTarget, textDownloadTargetLabel, chosenTextDownloadTarget } from '../text-download-target'
const SHIPPED_DEFAULTS = {
openai: { enabled: true, managed: true, name: 'Built-in Engine' },
@@ -115,3 +115,21 @@ describe('resolveTextDownloadTarget: no active model, other setups', () => {
).toBe('builtin')
})
})
+
+// P11 (David, 30.10.2026): the target is shown on Get, and the LU Engine can
+// be chosen for a download without switching the chat model first.
+describe('the target shown and the target chosen', () => {
+ it('names each target the way the Get button says it', () => {
+ expect(textDownloadTargetLabel('builtin')).toBe('LU Engine')
+ expect(textDownloadTargetLabel('ollama')).toBe('Ollama')
+ expect(textDownloadTargetLabel('lmstudio')).toBe('LM Studio')
+ expect(textDownloadTargetLabel('openai-compat', 'Jan')).toBe('Jan')
+ expect(textDownloadTargetLabel('openai-compat')).toBe('your server')
+ })
+
+ it('the LU Engine chosen wins over an Ollama model in the chat; no choice follows the chat', () => {
+ const input = { activeChatModel: 'llama3:8b', ollamaEnabled: true, openai: { enabled: true, managed: true } }
+ expect(chosenTextDownloadTarget(input, null)).toBe('ollama')
+ expect(chosenTextDownloadTarget(input, 'builtin')).toBe('builtin')
+ })
+})
diff --git a/src/lib/text-download-target.ts b/src/lib/text-download-target.ts
index 51404b6d..b8c5f784 100644
--- a/src/lib/text-download-target.ts
+++ b/src/lib/text-download-target.ts
@@ -83,6 +83,31 @@ export function resolveTextDownloadTarget(input: TextDownloadTargetInput): TextD
return 'builtin'
}
+/**
+ * What the Get button and the line over the list call a target (P11, David
+ * 2026-10-30). The target used to be decided out of sight: with an Ollama
+ * model in the chat a GGUF went into Ollama, and the Neuron tweaker, which
+ * only works on LU Engine files, never saw it.
+ */
+export function textDownloadTargetLabel(target: TextDownloadTarget, serverName?: string): string {
+ switch (target) {
+ case 'builtin': return 'LU Engine'
+ case 'ollama': return 'Ollama'
+ case 'lmstudio': return 'LM Studio'
+ case 'openai-compat': return serverName?.trim() || 'your server'
+ }
+}
+
+/**
+ * The target of a download once the user's choice for this visit of
+ * Discover counts: "LU Engine" sends the file to the app's own engine
+ * whatever the chat model is, without switching the chat model first.
+ * No choice: the rule above.
+ */
+export function chosenTextDownloadTarget(input: TextDownloadTargetInput, choice: 'builtin' | null): TextDownloadTarget {
+ return choice === 'builtin' ? 'builtin' : resolveTextDownloadTarget(input)
+}
+
/**
* Why an Ollama-only model (one listed by its Ollama tag) cannot be pulled
* right now, or null when the pull may go ahead.
diff --git a/src/stores/uiStore.ts b/src/stores/uiStore.ts
index 72fc9864..c67fe276 100644
--- a/src/stores/uiStore.ts
+++ b/src/stores/uiStore.ts
@@ -144,6 +144,13 @@ interface UIState {
* again. Never persisted: it describes one click, not a preference. */
modelAskSeq: number
askForModel: () => void
+ /** Where Discover's chat downloads go for the next visit, when a button
+ * elsewhere already knows (the Neuron tweaker needs LU Engine files).
+ * Read once by Discover, then cleared. Never persisted. */
+ discoverTarget: 'builtin' | null
+ /** Open Models on Discover's chat lane with downloads going to `target`. */
+ openDiscoverFor: (target: 'builtin') => void
+ clearDiscoverTarget: () => void
setView: (view: View) => void
/** Open Settings on a given tab, optionally with one section unfolded. */
openSettingsAt: (focus: SettingsFocus) => void
@@ -220,6 +227,9 @@ export const useUIStore = create<UIState>()(
settingsFocus: null,
modelAskSeq: 0,
askForModel: () => set((s) => ({ modelAskSeq: s.modelAskSeq + 1 })),
+ discoverTarget: null,
+ openDiscoverFor: (target) => set({ currentView: 'models', settingsFocus: null, discoverTarget: target }),
+ clearDiscoverTarget: () => set({ discoverTarget: null }),
// Navigation no longer touches sidebarOpen. The conversation list only
// makes sense in Chat, and that rule now lives in the Sidebar itself