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): one usable value says one; the original search lists originals first

purple870005620ddc
diff --git a/src/components/models/DiscoverModels.tsx b/src/components/models/DiscoverModels.tsx
index d03495d8..619b4a81 100644
--- a/src/components/models/DiscoverModels.tsx
+++ b/src/components/models/DiscoverModels.tsx
@@ -45,6 +45,7 @@ import { mayBeStartHerePick } from '../../lib/start-here-picks'
import { modelInfoTitle } from '../../lib/model-info-title'
import { hfUrlToOllamaRef, hfUrlToLmStudioSubdir, parseHfUrl, isShardedOrIncompatibleGguf } from '../../lib/hf-to-provider'
import { HINWEIS_TEXT } from '../../lib/hinweis'
+import { originalsFirst } from '../../lib/original-search'
import { Modal } from '../ui/Modal'
import { ModalActions, ModalButton } from '../ui/ModalActions'
import { countLabel } from '../../lib/formatters'
@@ -63,6 +64,10 @@ interface Props {
search?: string
/** Bumped by ModelManager whenever the user submits the search (Enter). */
searchSubmitToken?: number
+ /** The search that looks for a maker's original model (Neurons' "Get the
+ * original"). While the field still holds it, changed versions of the
+ * model are listed after the originals, under their own heading. */
+ originalFor?: string | null
}
// Size buckets stay EXACTLY the ones from the old VRAM-tier filter (the owner
@@ -229,7 +234,7 @@ export function awaitDownloadedFile(
})
}
-export function DiscoverModels({ category, search = '', searchSubmitToken = 0 }: Props) {
+export function DiscoverModels({ category, search = '', searchSubmitToken = 0, originalFor = null }: Props) {
const [loading, setLoading] = useState(false)
const systemVRAM = useGraphicsMemoryGb()
const [ramGb, setRamGb] = useState<number | null>(null)
@@ -1245,32 +1250,49 @@ export function DiscoverModels({ category, search = '', searchSubmitToken = 0 }:
</div>
{/* HuggingFace Search Results */}
- {hfSearchResults.length > 0 && (
- <div className={`${skin.cls.group} mt-6`}>
- <skin.Head place="hf-results" Icon={Search} title="HuggingFace results" />
- <div className="grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-2.5">
- {hfSearchResults.map((model, i) => (
- <motion.div key={model.name + i} className={skin.cls.tileWrap} initial={{ opacity: 0, y: 8 }} animate={{ opacity: 1, y: 0 }} transition={{ delay: Math.min(i, 12) * 0.025 }}>
- <skin.ModelTile
- variants={[model]}
- vramGb={chatFitGb}
- sharedMemory={sharedMemory}
- isInstalled={isModelFullyInstalled}
- dlState={getModelDownloadState}
- onDownload={handleTextDownload}
- getTarget={getTargetOf}
- onUse={handleUseInstalled}
- canUse={canUseInstalled}
- isUsing={(m) => installedEntryFor(m)?.name === usingModel && usingModel !== null}
- onInfo={openInfo}
- withImagePart={wantsImagePart}
- onOpenUrl={(u) => openExternal(u)}
- />
- </motion.div>
- ))}
+ {hfSearchResults.length > 0 && (() => {
+ const wantsOriginal = !!originalFor && search.trim() === originalFor
+ const { originals, changed } = wantsOriginal ? originalsFirst(hfSearchResults) : { originals: hfSearchResults, changed: [] }
+ const tiles = (list: DiscoverModel[]) => list.map((model, i) => (
+ <motion.div key={model.name + i} className={skin.cls.tileWrap} initial={{ opacity: 0, y: 8 }} animate={{ opacity: 1, y: 0 }} transition={{ delay: Math.min(i, 12) * 0.025 }}>
+ <skin.ModelTile
+ variants={[model]}
+ vramGb={chatFitGb}
+ sharedMemory={sharedMemory}
+ isInstalled={isModelFullyInstalled}
+ dlState={getModelDownloadState}
+ onDownload={handleTextDownload}
+ getTarget={getTargetOf}
+ onUse={handleUseInstalled}
+ canUse={canUseInstalled}
+ isUsing={(m) => installedEntryFor(m)?.name === usingModel && usingModel !== null}
+ onInfo={openInfo}
+ withImagePart={wantsImagePart}
+ onOpenUrl={(u) => openExternal(u)}
+ />
+ </motion.div>
+ ))
+ return (
+ <div className={`${skin.cls.group} mt-6`} data-testid="hf-results">
+ <skin.Head place="hf-results" Icon={Search} title={wantsOriginal ? 'Original models on Hugging Face' : 'HuggingFace results'} />
+ {wantsOriginal && originals.length === 0 && (
+ <p className={`t-body ${HINWEIS_TEXT.ruhig} mb-2`}>No original of this model in the results. Try a shorter search.</p>
+ )}
+ <div className="grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-2.5" data-testid="hf-results-originals">
+ {tiles(originals)}
+ </div>
+ {changed.length > 0 && (
+ <div className="mt-5" data-testid="hf-results-changed">
+ <p className="t-label text-gray-300 mb-0.5">Changed by others, not the original</p>
+ <p className={`t-micro ${HINWEIS_TEXT.ruhig} mb-2`}>Uncensored, merged or fine-tuned versions. Neuron sliders work best on the originals above.</p>
+ <div className="grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-2.5">
+ {tiles(changed)}
+ </div>
+ </div>
+ )}
</div>
- </div>
- )}
+ )
+ })()}
</>
) : null}
diff --git a/src/components/models/ModelManager.tsx b/src/components/models/ModelManager.tsx
index 8921d800..0fb820ef 100644
--- a/src/components/models/ModelManager.tsx
+++ b/src/components/models/ModelManager.tsx
@@ -121,6 +121,8 @@ export function ModelManager() {
// original"): it starts the field and the catalog search once.
const [searchQuery, setSearchQuery] = useState(() => useUIStore.getState().discoverQuery ?? '')
const [searchSubmitToken, setSearchSubmitToken] = useState(() => (useUIStore.getState().discoverQuery ? 1 : 0))
+ // That search looks for an original model: its changed versions go last.
+ const [originalFor] = useState(() => { const s = useUIStore.getState(); return s.discoverOriginal ? s.discoverQuery : null })
useEffect(() => {
if (useUIStore.getState().discoverQuery) useUIStore.getState().clearDiscoverQuery()
}, [])
@@ -606,6 +608,7 @@ export function ModelManager() {
category={mode}
search={searchQuery}
searchSubmitToken={searchSubmitToken}
+ originalFor={originalFor}
/>
)
)}
diff --git a/src/components/neuron/NeuronView.tsx b/src/components/neuron/NeuronView.tsx
index 92a46510..351ca659 100644
--- a/src/components/neuron/NeuronView.tsx
+++ b/src/components/neuron/NeuronView.tsx
@@ -322,7 +322,7 @@ export function NeuronView() {
const getOriginal = () => {
if (!original) return
useModelStore.getState().setCategoryFilter('text')
- useUIStore.getState().openDiscoverFor('builtin', original)
+ useUIStore.getState().openDiscoverFor('builtin', original, { original: true })
}
if (modelsLoaded && models.length === 0) {
diff --git a/src/components/neuron/__tests__/neurons-for-beginners.test.tsx b/src/components/neuron/__tests__/neurons-for-beginners.test.tsx
index 30b26ebf..e7d92dde 100644
--- a/src/components/neuron/__tests__/neurons-for-beginners.test.tsx
+++ b/src/components/neuron/__tests__/neurons-for-beginners.test.tsx
@@ -221,6 +221,8 @@ describe('coordinates', () => {
await screen.findByTestId('neuron-slider-cheerful')
fireEvent.click(screen.getByTestId('neuron-way-coords'))
fireEvent.change(await screen.findByTestId('neuron-coords-input'), { target: { value: '@cheerful+0.4 L14N8949+1.0' } })
+ // FEHLER-N2 #1: one value, said as one.
+ expect(screen.getByTestId('neuron-coords-use').textContent?.trim()).toBe('Use the one usable value')
fireEvent.click(screen.getByTestId('neuron-coords-use'))
expect(useNeuronStore.getState().profiles['qwen-1']).toEqual({ cheerful: 0.4 })
expect(screen.getByTestId('neuron-coords-later').textContent).toMatch(/^One single neuron was not applied\./)
@@ -259,7 +261,7 @@ describe('tweaked models', () => {
expect((screen.getByTestId('neuron-compute-creative') as HTMLButtonElement).disabled).toBe(false)
fireEvent.click(screen.getByTestId('neuron-get-original'))
const ui = useUIStore.getState()
- expect([ui.currentView, ui.discoverTarget, ui.discoverQuery]).toEqual(['models', 'builtin', 'Qwen3.5 9B'])
+ expect([ui.currentView, ui.discoverTarget, ui.discoverQuery, ui.discoverOriginal]).toEqual(['models', 'builtin', 'Qwen3.5 9B', true])
expect(useModelStore.getState().categoryFilter).toBe('text')
})
diff --git a/src/components/neuron/panels.tsx b/src/components/neuron/panels.tsx
index a2ddc8be..07c91dd8 100644
--- a/src/components/neuron/panels.tsx
+++ b/src/components/neuron/panels.tsx
@@ -287,7 +287,7 @@ export function CoordinatesPanel({ presets, modelNames, states, onUse, disabled
data-testid="neuron-coords-use"
className="lu-control lu-primary"
>
- {usable.length === 0 && later.length === 0 ? 'Nothing usable on this model' : usable.length === parsed.recipe.entries.length || usable.length === 0 ? 'Use these values' : `Use the ${usable.length} usable values`} <ArrowRight size={ICON_SM} />
+ {usable.length === 0 && later.length === 0 ? 'Nothing usable on this model' : usable.length === parsed.recipe.entries.length || usable.length === 0 ? 'Use these values' : usable.length === 1 ? 'Use the one usable value' : `Use the ${usable.length} usable values`} <ArrowRight size={ICON_SM} />
</button>
<span className={`t-micro ${HINWEIS_TEXT.ruhig}`}>{usable.length ? 'Replaces your current sliders. You can undo.' : 'Nothing changes on your sliders.'}</span>
</div>
diff --git a/src/lib/__tests__/original-search.test.ts b/src/lib/__tests__/original-search.test.ts
new file mode 100644
index 00000000..4e5466bf
--- /dev/null
+++ b/src/lib/__tests__/original-search.test.ts
@@ -0,0 +1,35 @@
+/**
+ * FEHLER-N2 #1 (T1, 31.10.2026): "Get the original: Qwen3.5 9B" showed the
+ * changed model the user came from as the first Hugging Face hit. In that
+ * search the originals come first, the changed versions after them.
+ *
+ * Run: npx vitest run src/lib/__tests__/original-search.test.ts
+ */
+import { describe, it, expect } from 'vitest'
+import { looksTweaked, originalsFirst } from '../original-search'
+import type { DiscoverModel } from '../../api/discover'
+
+const hit = (repo: string): DiscoverModel => ({
+ name: repo.split('/')[1].replace(/-GGUF$/i, ''), description: repo, pulls: '1K', tags: [], updated: '',
+})
+
+describe('original search', () => {
+ it('knows a changed model by its name, and leaves the maker\'s own alone', () => {
+ for (const r of [
+ 'DavidAU/Qwen3.5-9B-The-Defiant-Heretic-Uncensored-GGUF',
+ 'mlabonne/Meta-Llama-3.1-8B-Instruct-abliterated-GGUF',
+ 'someone/Qwen3.5-9B-Claude-Distill-GGUF',
+ 'someone/Qwen3.5-9B-RP-GGUF',
+ 'someone/Qwen3.5-9B-MTP-GGUF',
+ ]) expect(looksTweaked(r), r).toBe(true)
+ for (const r of ['unsloth/Qwen3.5-9B-GGUF', 'Qwen/Qwen3.5-9B-Instruct-GGUF', 'bartowski/Qwen_Qwen3.5-9B-GGUF', 'someone/Sharp-Qwen3.5-9B-GGUF'])
+ expect(looksTweaked(r), r).toBe(false)
+ })
+
+ it('puts the originals first, plain uploaders on top, and the changed ones after', () => {
+ const hf = ['DavidAU/Qwen3.5-9B-The-Defiant-Heretic-GGUF', 'mradermacher/Qwen3.5-9B-GGUF', 'unsloth/Qwen3.5-9B-GGUF', 'x/Qwen3.5-9B-abliterated-GGUF'].map(hit)
+ const { originals, changed } = originalsFirst(hf)
+ expect(originals.map((m) => m.description)).toEqual(['unsloth/Qwen3.5-9B-GGUF', 'mradermacher/Qwen3.5-9B-GGUF'])
+ expect(changed.map((m) => m.description)).toEqual(['DavidAU/Qwen3.5-9B-The-Defiant-Heretic-GGUF', 'x/Qwen3.5-9B-abliterated-GGUF'])
+ })
+})
diff --git a/src/lib/original-search.ts b/src/lib/original-search.ts
new file mode 100644
index 00000000..9f497be2
--- /dev/null
+++ b/src/lib/original-search.ts
@@ -0,0 +1,43 @@
+// Neurons' "Get the original" searches Hugging Face for the maker's model
+// (N2, FEHLER-N2 #1, T1 31.10.2026): the first hit for "Qwen3.5 9B" was the
+// changed model the user came from. In that search the originals come first
+// and the changed versions follow under their own heading.
+
+import type { DiscoverModel } from '../api/discover'
+
+/** Words in a repo name that mean someone changed the weights after the
+ * maker's release. The first four mirror the engine's own list
+ * (commands/neuron/model.rs TWEAK_WORDS); the rest are names community
+ * tweaks often carry. Matched inside the lower-case name. */
+const TWEAK_PARTS = [
+ 'abliterat', 'obliterat', 'heretic', 'uncensor', 'decensor', 'merge',
+ 'defiant', 'nsfw', 'erotic', 'roleplay', 'lewd', 'distill', 'finetune', 'fine-tune',
+]
+
+/** Short marks that only count as a whole word ("rp" not in "sharp"). */
+const TWEAK_WORDS = ['mtp', 'rp', 'ft', 'evil', 'dark']
+
+/** Uploaders whose GGUFs are straight conversions of the maker's weights. */
+const PLAIN_UPLOADERS = ['qwen', 'unsloth', 'bartowski', 'ggml-org', 'lmstudio-community', 'google', 'meta-llama', 'mistralai', 'microsoft']
+
+export function looksTweaked(repoId: string): boolean {
+ const low = repoId.split('/').pop()!.toLowerCase()
+ if (TWEAK_PARTS.some((p) => low.includes(p))) return true
+ const words = low.split(/[^a-z0-9]+/)
+ return TWEAK_WORDS.some((w) => words.includes(w))
+}
+
+function repoOf(m: DiscoverModel): string {
+ return m.description || m.name
+}
+
+/** Originals first (plain uploaders before the rest, the search's own order
+ * kept inside each group), then the changed versions. */
+export function originalsFirst(models: DiscoverModel[]): { originals: DiscoverModel[]; changed: DiscoverModel[] } {
+ const originals: DiscoverModel[] = []
+ const changed: DiscoverModel[] = []
+ for (const m of models) (looksTweaked(repoOf(m)) ? changed : originals).push(m)
+ const plain = (m: DiscoverModel) => PLAIN_UPLOADERS.includes(repoOf(m).split('/')[0].toLowerCase()) ? 0 : 1
+ originals.sort((a, b) => plain(a) - plain(b))
+ return { originals, changed }
+}
diff --git a/src/stores/__tests__/discover-query-handoff.test.ts b/src/stores/__tests__/discover-query-handoff.test.ts
index 40207c84..9ac5f9ac 100644
--- a/src/stores/__tests__/discover-query-handoff.test.ts
+++ b/src/stores/__tests__/discover-query-handoff.test.ts
@@ -20,6 +20,17 @@ describe('Discover search hand-off', () => {
expect(useUIStore.getState().discoverQuery).toBeNull()
})
+ it('marks a search for an original model, and forgets it with the query', () => {
+ useUIStore.getState().openDiscoverFor('builtin', 'Qwen3.5 9B', { original: true })
+ expect(useUIStore.getState().discoverOriginal).toBe(true)
+ useUIStore.getState().clearDiscoverQuery()
+ expect(useUIStore.getState().discoverOriginal).toBe(false)
+ useUIStore.getState().openDiscoverFor('builtin', ' ', { original: true })
+ expect(useUIStore.getState().discoverOriginal).toBe(false)
+ useUIStore.getState().openDiscoverFor('builtin', 'Qwen3.5 9B')
+ expect(useUIStore.getState().discoverOriginal).toBe(false)
+ })
+
it('is not saved, and the Models page starts its search with it once', () => {
const store = readFileSync(resolve(__dirname, '../uiStore.ts'), 'utf8')
const kept = store.slice(store.indexOf('partialize:'))
@@ -27,5 +38,10 @@ describe('Discover search hand-off', () => {
const page = readFileSync(resolve(__dirname, '../../components/models/ModelManager.tsx'), 'utf8')
expect(page).toMatch(/useState\(\(\) => useUIStore\.getState\(\)\.discoverQuery \?\? ''\)/)
expect(page).toMatch(/clearDiscoverQuery\(\)/)
+ // The original search reaches Discover, which sorts only while the field holds it.
+ expect(page).toMatch(/originalFor=\{originalFor\}/)
+ const discover = readFileSync(resolve(__dirname, '../../components/models/DiscoverModels.tsx'), 'utf8')
+ expect(discover).toMatch(/const wantsOriginal = !!originalFor && search\.trim\(\) === originalFor/)
+ expect(discover).toMatch(/originalsFirst\(hfSearchResults\)/)
})
})
diff --git a/src/stores/uiStore.ts b/src/stores/uiStore.ts
index 2d0b2e9e..73d9419e 100644
--- a/src/stores/uiStore.ts
+++ b/src/stores/uiStore.ts
@@ -152,9 +152,12 @@ interface UIState {
* "Get the original"). Read once by the Models page, then cleared. Never
* persisted. */
discoverQuery: string | null
+ /** The query looks for the maker's original model: Discover lists the
+ * changed versions after the originals (FEHLER-N2 #1). */
+ discoverOriginal: boolean
/** Open Models on Discover's chat lane with downloads going to `target`,
* optionally searching for `query`. */
- openDiscoverFor: (target: 'builtin', query?: string) => void
+ openDiscoverFor: (target: 'builtin', query?: string, opts?: { original?: boolean }) => void
clearDiscoverTarget: () => void
clearDiscoverQuery: () => void
setView: (view: View) => void
@@ -235,9 +238,10 @@ export const useUIStore = create<UIState>()(
askForModel: () => set((s) => ({ modelAskSeq: s.modelAskSeq + 1 })),
discoverTarget: null,
discoverQuery: null,
- openDiscoverFor: (target, query) => set({ currentView: 'models', settingsFocus: null, discoverTarget: target, discoverQuery: query?.trim() || null }),
+ discoverOriginal: false,
+ openDiscoverFor: (target, query, opts) => set({ currentView: 'models', settingsFocus: null, discoverTarget: target, discoverQuery: query?.trim() || null, discoverOriginal: !!(opts?.original && query?.trim()) }),
clearDiscoverTarget: () => set({ discoverTarget: null }),
- clearDiscoverQuery: () => set({ discoverQuery: null }),
+ clearDiscoverQuery: () => set({ discoverQuery: null, discoverOriginal: false }),
// Navigation no longer touches sidebarOpen. The conversation list only
// makes sense in Chat, and that rule now lives in the Sidebar itself