Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
refresh the bundled local-LLM catalog against the live Ollama and HF registries
[._.]/ Adam Eivy54de36f3a7a2
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex d3bd164fe3..27269f5eae 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -4,6 +4,8 @@- **A failed CoS task now diagnoses itself and comes back on its own.** A failing task used to pile up a queue of approval-gated tasks — the crash filed one, the provider failure filed another, repeated orphaning filed a third — and then, even after the cause was fixed, the original task sat `blocked` until someone un-blocked it by hand (or the 14-day reaper quietly retired it as stale). Both halves of that are now automatic. Every failure-driven investigation is filed through one producer, so they share a single approval policy, a single storm counter, and a single dedup fingerprint: unattended by default, held for you in exactly the two cases where another unattended agent would just repeat itself — the same cause was already investigated in the last 24 hours, or failures are cascading rather than isolated — and the task says which of the two it is. Completing an investigation, whether an agent finished it or you fixed the cause and ticked it off, then automatically retries every task that failure was blocking. Bounded at two automatic retries per task, after which the task stays blocked and says the retry loop gave up rather than still showing the original failure. A task you terminated or paused, one parked awaiting your arbitration, and one waiting on a repository path you have to fix are never revived behind your back.+- **The bundled local-LLM install catalog has been refreshed to the current model landscape.** Every suggested model was re-verified against the Ollama registry and the Hugging Face API, and the list is now built from what's current: Qwen3.5 / Qwen3.6, Gemma 4 (12B alongside the existing 26B/31B), Muse Glimmer, GLM-4.7 Flash, Granite 4.1, Ministral 3, Nemotron 3 Nano (including a 1M-context 30B), Olmo 3.1, LFM2.5, Qwen3-VL, MiniCPM-V 4.6, EmbeddingGemma, and the Ornith / North Mini Code / Devstral Small 2 coding tier. Models superseded by two generations were retired (Llama 3.1/3.2/3.3, Qwen2.5 + Qwen2.5-VL, Mistral 7B, Gemma 2, Phi-3, DeepSeek-R1 Distill, LLaVA 1.5, Code Llama, SmolLM2, Moondream) — but they still map exactly across backends, so migrating an older Ollama library to LM Studio doesn't degrade to a guessed name. Two entries were broken outright: the LM Studio repos for LLaVA 1.5 and Code Llama now 404. Ollama ids are checked for real local weights, because several headline 2026 models (Mistral Large 3, GLM-5.2, DeepSeek-V4, MiniMax-M3, Kimi K3) are published only as `:cloud` passthrough tags that would have installed nothing.+- **Local-model capability detection caught up with the models it now recommends.** Gemma 4 and Granite 4 report tool use (Gemma 3 genuinely couldn't, which is why the old rule stopped at Gemma 3), Gemma 4 reports vision, and Ornith / LFM2 / Olmo 3 / Muse Glimmer / North Mini Code / FunctionGemma are recognized as tool-callers — so they stop being hidden from agent and caption pickers on LM Studio, where PortOS has only the model id to go on. `embeddinggemma` is now correctly identified as an embedding model: it glues the marker onto the family name, slipped past the anchored `embedding` rule, and would otherwise have been offered as a chat model (the nomic-embed-text fallback bug). The editorial-model recommender learned the new families and now declines vision *specialists* (`*-VL`, `*V`, OCR) while still happily using a general model that can read images.- **Series Autopilot now protects the author’s originating story intent.** The Universe Builder starter idea is included in foundation-cache invalidation, rendered ahead of derived canon for the independent foundation judge, and supplied explicitly to arc generation with a hard rule against replacing its ontology, protagonists, or core story engine. Full-control runs still unlock derived world fields, but they keep the human-authored starter idea locked.- **Character-first foundation repair gets a quality-first runtime.** Productive ensemble work may run for up to two hours instead of being discarded at ten minutes, while a finite ceiling still stops a genuinely hung provider.- **Episode synopsis revisions are now restorable.** Text-stage history snapshots preserve input-only stages as well as generated output, so regenerating an episode plan can no longer discard the prior synopsis merely because that planning stage stores its authored text in `input`.diff --git a/client/src/components/ProviderModelSelector.test.jsx b/client/src/components/ProviderModelSelector.test.jsxindex 324eb80b9a..3e31ccc8ff 100644--- a/client/src/components/ProviderModelSelector.test.jsx+++ b/client/src/components/ProviderModelSelector.test.jsx@@ -125,19 +125,19 @@ describe('ProviderModelSelector', () => {providers: OLLAMA,selectedProviderId: 'ollama',selectedModel: 'qwen3.6:35b',- availableModels: ['qwen3.6:35b', 'gemma4:e4b'],+ availableModels: ['qwen3.6:35b', 'gemma3:4b'],highlightToolUse: true,});const labels = [...screen.getAllByRole('combobox')[1].querySelectorAll('option')].map((o) => o.textContent);- expect(labels).toEqual(['qwen3.6:35b · 🔧 tool use', 'gemma4:e4b · ⚠ no known tool use']);+ expect(labels).toEqual(['qwen3.6:35b · 🔧 tool use', 'gemma3:4b · ⚠ no known tool use']);});it('warns when the selected LOCAL model cannot call tools', () => {renderSelector({providers: OLLAMA,selectedProviderId: 'ollama',- selectedModel: 'gemma4:e4b',- availableModels: ['qwen3.6:35b', 'gemma4:e4b'],+ selectedModel: 'gemma3:4b',+ availableModels: ['qwen3.6:35b', 'gemma3:4b'],highlightToolUse: true,});expect(screen.getByText(/recognized tool-calling model/i)).toBeInTheDocument();@@ -147,10 +147,10 @@ describe('ProviderModelSelector', () => {// "Default model" (blank) isn't a no-op — the resolver runs the provider's// defaultModel, which here is a non-tool local model.renderSelector({- providers: [{ id: 'ollama', name: 'Ollama', defaultModel: 'gemma4:e4b' }],+ providers: [{ id: 'ollama', name: 'Ollama', defaultModel: 'gemma3:4b' }],selectedProviderId: 'ollama',selectedModel: '',- availableModels: ['qwen3.6:35b', 'gemma4:e4b'],+ availableModels: ['qwen3.6:35b', 'gemma3:4b'],alwaysShowModel: true,emptyModelOption: 'Default model',highlightToolUse: true,@@ -163,7 +163,7 @@ describe('ProviderModelSelector', () => {providers: OLLAMA,selectedProviderId: 'ollama',selectedModel: 'qwen3.6:35b',- availableModels: ['qwen3.6:35b', 'gemma4:e4b'],+ availableModels: ['qwen3.6:35b', 'gemma3:4b'],highlightToolUse: true,});expect(screen.queryByText(/recognized tool-calling model/i)).not.toBeInTheDocument();@@ -186,11 +186,11 @@ describe('ProviderModelSelector', () => {renderSelector({providers: OLLAMA,selectedProviderId: 'ollama',- selectedModel: 'gemma4:e4b',- availableModels: ['qwen3.6:35b', 'gemma4:e4b'],+ selectedModel: 'gemma3:4b',+ availableModels: ['qwen3.6:35b', 'gemma3:4b'],});const labels = [...screen.getAllByRole('combobox')[1].querySelectorAll('option')].map((o) => o.textContent);- expect(labels).toEqual(['qwen3.6:35b', 'gemma4:e4b']);+ expect(labels).toEqual(['qwen3.6:35b', 'gemma3:4b']);expect(screen.queryByText(/recognized tool-calling model/i)).not.toBeInTheDocument();});});diff --git a/client/src/components/creative-director/CreativeDirectorModelsDrawer.test.jsx b/client/src/components/creative-director/CreativeDirectorModelsDrawer.test.jsxindex 6b250afc88..8d518893e1 100644--- a/client/src/components/creative-director/CreativeDirectorModelsDrawer.test.jsx+++ b/client/src/components/creative-director/CreativeDirectorModelsDrawer.test.jsx@@ -21,8 +21,8 @@ const ASSIGNMENTS = {name: 'Ollama',type: 'api',enabled: true,- defaultModel: 'gemma4:26b',- models: ['qwen2.5vl:latest', 'llava:latest', 'gemma4:26b', 'llama3.2:latest'],+ defaultModel: 'gemma2:9b',+ models: ['qwen2.5vl:latest', 'llava:latest', 'gemma2:9b', 'llama3.2:latest'],},],assignments: [@@ -63,7 +63,7 @@ describe('CreativeDirectorModelsDrawer', () => {it('warns when the plan stage is pinned to a local model that cannot call tools', async () => {// The incident: a plan agent on gemma (no tool use) narrates "done" without// ever PATCHing the plan, wedging the project. The drawer must flag it.- renderDrawer({ id: 'cd-1', name: 'Demo', modelOverrides: { plan: { providerId: 'ollama', model: 'gemma4:26b' } } });+ renderDrawer({ id: 'cd-1', name: 'Demo', modelOverrides: { plan: { providerId: 'ollama', model: 'gemma2:9b' } } });await waitFor(() => expect(screen.getByLabelText('Production plan model')).toBeTruthy());expect(screen.getByText(/recognized tool-calling model/i)).toBeInTheDocument();});@@ -75,7 +75,7 @@ describe('CreativeDirectorModelsDrawer', () => {});it('warns when the plan stage inherits a non-tool provider default (blank model)', async () => {- // ollama's defaultModel is gemma4:26b; a blank model pin runs that default.+ // ollama's defaultModel is gemma2:9b; a blank model pin runs that default.renderDrawer({ id: 'cd-1', name: 'Demo', modelOverrides: { plan: { providerId: 'ollama', model: '' } } });await waitFor(() => expect(screen.getByLabelText('Production plan provider')).toBeTruthy());expect(screen.getByText(/recognized tool-calling model/i)).toBeInTheDocument();@@ -84,7 +84,7 @@ describe('CreativeDirectorModelsDrawer', () => {it('never shows a tool-use warning on the vision (evaluation) stage', async () => {// The evaluation stage is a direct vision call, not an agent — a non-tool// local model there is expected and must NOT be flagged as tool-incapable.- renderDrawer({ id: 'cd-1', name: 'Demo', modelOverrides: { evaluation: { providerId: 'ollama', model: 'gemma4:26b' } } });+ renderDrawer({ id: 'cd-1', name: 'Demo', modelOverrides: { evaluation: { providerId: 'ollama', model: 'gemma2:9b' } } });await waitFor(() => expect(screen.getByLabelText('Scene evaluation provider')).toBeTruthy());expect(screen.queryByText(/recognized tool-calling model/i)).not.toBeInTheDocument();});@@ -128,20 +128,21 @@ describe('CreativeDirectorModelsDrawer', () => {expect(optionValues).toContain('');expect(optionValues).toContain('qwen2.5vl:latest');expect(optionValues).toContain('llava:latest');- expect(optionValues).not.toContain('gemma4:26b');+ expect(optionValues).not.toContain('gemma2:9b');expect(optionValues).not.toContain('llama3.2:latest');// Text-only default is replaced by the first eligible VLM.expect(modelSelect.value).toBe('qwen2.5vl:latest');});- // The reported bug: the client id regex knows `gemma-3` but not `gemma4`, so a- // user whose only installed VLMs are gemma4/qwen3.6 saw an EMPTY Scene- // evaluation model picker. The server already knows better via Ollama's- // /api/show capabilities, so its verdict is unioned in.+ // The reported bug: multimodal models whose id carries no `vl`/`vision` marker+ // (Muse Glimmer, Ministral 3) are invisible to the client id regex, so a user+ // whose only installed VLMs are those saw an EMPTY Scene evaluation model+ // picker. The server knows better via Ollama's /api/show capabilities, so its+ // verdict is unioned in.it('offers vision models the id regex misses but the server reports as vision-capable', async () => {getVisionModels.mockResolvedValue({models: [- { providerId: 'ollama', backend: 'ollama', id: 'gemma4:26b', vision: true },+ { providerId: 'ollama', backend: 'ollama', id: 'muse-glimmer:30b', vision: true },{ providerId: 'ollama', backend: 'ollama', id: 'llama3.2:latest', vision: true },],});@@ -155,7 +156,7 @@ describe('CreativeDirectorModelsDrawer', () => {screen.getByLabelText('Scene evaluation model').querySelectorAll('option'),).map((o) => o.value);// Server-reported ids the regex would have hidden.- expect(optionValues).toContain('gemma4:26b');+ expect(optionValues).toContain('muse-glimmer:30b');expect(optionValues).toContain('llama3.2:latest');// Union, not replacement — regex-matched ids the server didn't list survive.expect(optionValues).toContain('qwen2.5vl:latest');@@ -175,7 +176,7 @@ describe('CreativeDirectorModelsDrawer', () => {],});getVisionModels.mockResolvedValue({- models: [{ providerId: 'ollama', backend: 'ollama', id: 'gemma4:e4b', vision: true }],+ models: [{ providerId: 'ollama', backend: 'ollama', id: 'muse-glimmer:30b', vision: true }],});renderDrawer({ id: 'cd-1', name: 'Demo', modelOverrides: {} });await waitFor(() => expect(getVisionModels).toHaveBeenCalled());@@ -183,9 +184,9 @@ describe('CreativeDirectorModelsDrawer', () => {fireEvent.change(screen.getByLabelText('Scene evaluation provider'), { target: { value: 'ollama' } });const modelSelect = screen.getByLabelText('Scene evaluation model');- expect(Array.from(modelSelect.querySelectorAll('option')).map((o) => o.value)).toContain('gemma4:e4b');+ expect(Array.from(modelSelect.querySelectorAll('option')).map((o) => o.value)).toContain('muse-glimmer:30b');// ...and it seeds, rather than leaving the stage on a blank/auto pin.- expect(modelSelect.value).toBe('gemma4:e4b');+ expect(modelSelect.value).toBe('muse-glimmer:30b');expect(screen.queryByText(/No vision-capable models found/i)).toBeNull();});@@ -202,7 +203,7 @@ describe('CreativeDirectorModelsDrawer', () => {expect(screen.getByLabelText('Scene evaluation provider').disabled).toBe(true);expect(screen.getByLabelText('Treatment provider').disabled).toBe(false);- resolveVision({ models: [{ providerId: 'ollama', backend: 'ollama', id: 'gemma4:26b', vision: true }] });+ resolveVision({ models: [{ providerId: 'ollama', backend: 'ollama', id: 'muse-glimmer:30b', vision: true }] });await waitFor(() => expect(screen.getByLabelText('Scene evaluation provider').disabled).toBe(false));});@@ -232,7 +233,7 @@ describe('CreativeDirectorModelsDrawer', () => {it('ignores cli-backend rows so a text-only model cannot be smuggled in as vision', async () => {getVisionModels.mockResolvedValue({models: [- { providerId: 'ollama', backend: 'ollama', id: 'gemma4:26b', vision: true },+ { providerId: 'ollama', backend: 'ollama', id: 'muse-glimmer:30b', vision: true },// The ollama-backed Claude CLI fronting a text-only Ollama model whose id// is also in the real `ollama` provider's list.{ providerId: 'claude-ollama', backend: 'cli', id: 'llama3.2:latest', vision: true },@@ -248,7 +249,7 @@ describe('CreativeDirectorModelsDrawer', () => {const optionValues = Array.from(screen.getByLabelText('Scene evaluation model').querySelectorAll('option'),).map((o) => o.value);- expect(optionValues).toContain('gemma4:26b');+ expect(optionValues).toContain('muse-glimmer:30b');// The cli-backend row must NOT make this text-only id a vision option.expect(optionValues).not.toContain('llama3.2:latest');});diff --git a/client/src/utils/providers.js b/client/src/utils/providers.jsindex 9185ba08ad..5c89d6b3b5 100644--- a/client/src/utils/providers.js+++ b/client/src/utils/providers.js@@ -431,7 +431,10 @@ export const resolveCliEffort = (effort, provider, model = null) => {*/export const isEmbeddingModel = (id) =>typeof id === 'string' && id.length > 0 &&- /(?:^|[-_/:])(?:embed|embedding|bge|nomic|mxbai|gte|e5|snowflake-arctic-embed)(?:[-_/:]|$)|text-embedding/i.test(id);+ // Mirror of EMBEDDING_RE in server/lib/localModelHeuristics.js — keep in lockstep.+ // `embeddinggemma` needs its own alternative: the anchored `embedding` marker+ // requires a separator after it, and that id glues the family straight on.+ /(?:^|[-_/:])(?:embed|embedding|bge|nomic|mxbai|gte|e5|snowflake-arctic-embed)(?:[-_/:]|$)|text-embedding|embeddinggemma/i.test(id);/*** Vision-capable (multimodal) model detector — mirror of `isVisionModel` in@@ -446,7 +449,7 @@ export const isEmbeddingModel = (id) =>export const isVisionModel = (id) =>typeof id === 'string' && id.length > 0 &&// Mirror of VISION_RE in server/lib/localModelHeuristics.js — keep in lockstep.- /(?:^|[-_/:])vision(?:[-_/:.]|$)|(?:^|[-_/:])vl(?:\d|[-_/:.]|$)|qwen[\d.]*-?vl|llava|bakllava|moondream|minicpm-?v|pixtral|gemma-?3|smolvlm|internvl|cogvlm|glm-?4v|phi-?3\.5?-vision|phi-?4-multimodal|got-ocr|idefics|fuyu|paligemma|kosmos|nanollava/i.test(id);+ /(?:^|[-_/:])vision(?:[-_/:.]|$)|(?:^|[-_/:])vl(?:\d|[-_/:.]|$)|qwen[\d.]*-?vl|(?:^|[-_/:])gemma-?[34]|llava|bakllava|moondream|minicpm-?v|pixtral|smolvlm|internvl|cogvlm|glm-?4v|phi-?3\.5?-vision|phi-?4-multimodal|got-ocr|idefics|fuyu|paligemma|kosmos|nanollava/i.test(id);/*** Tool-use (function-calling) capable model detector — mirror of `isToolUseModel`@@ -462,7 +465,7 @@ export const isVisionModel = (id) =>export const isToolUseModel = (id) =>typeof id === 'string' && id.length > 0 &&// Mirror of TOOL_USE_RE in server/lib/localModelHeuristics.js — keep in lockstep.- /qwen|llama-?3\.[1-9]|llama-?4|mistral|mixtral|ministral|codestral|devstral|magistral|command-?r|command-?a|firefunction|functionary|watt-tool|hermes|glm-?4|granite-?3|gpt-oss|nemotron|smollm2|deepseek-v3|deepseek-r1/i.test(id);+ /qwen|llama-?3\.[1-9]|llama-?4|mistral|mixtral|ministral|codestral|devstral|magistral|command-?r|command-?a|north-mini-code|firefunction|functionary|watt-tool|hermes|functiongemma|glm-?4|granite-?[34]|(?:^|[-_/:])gemma-?4|gpt-oss|nemotron|olmo-?3|lfm2|ornith|muse-glimmer|nex-n2|smollm2|deepseek-v3|deepseek-r1|deepseek-v4/i.test(id);/*** Per-model filter for a CODING / tool-use picker: restrict LOCAL backendsdiff --git a/client/src/utils/providers.test.js b/client/src/utils/providers.test.jsindex 47508d91a0..97affb6590 100644--- a/client/src/utils/providers.test.js+++ b/client/src/utils/providers.test.js@@ -633,25 +633,27 @@ describe('localToolUseHint', () => {});it('flags a local non-tool model (Gemma narrates instead of acting)', () => {- expect(localToolUseHint('gemma4:e4b', ollama)).toEqual({ toolCapable: false });+ // Gemma 3, not 4 — tool support landed in Gemma 4, so `gemma4:*` is a+ // tool-capable id and can't stand in for "narrates instead of acting".+ expect(localToolUseHint('gemma3:4b', ollama)).toEqual({ toolCapable: false });expect(localToolUseHint('gemma2:9b', ollama)).toEqual({ toolCapable: false });});it('returns null for cloud providers (their ids do not encode family)', () => {const cloud = { name: 'OpenAI', endpoint: 'https://api.openai.com/v1' };expect(localToolUseHint('gpt-4o', cloud)).toBeNull();- expect(localToolUseHint('gemma4:e4b', undefined)).toBeNull();+ expect(localToolUseHint('gemma3:4b', undefined)).toBeNull();});it('flags a renamed Ollama-backed CLI/TUI wrapper (no "ollama" name/endpoint)', () => {// The incident's provider class: a claude-ollama-tui wrapper the user renamed,// so localBackendForProvider misses it — but it still carries ollamaBacked.const wrapper = { id: 'my-local-agent', name: 'My Local Agent', ollamaBacked: true };- expect(localToolUseHint('gemma4:e4b', wrapper)).toEqual({ toolCapable: false });+ expect(localToolUseHint('gemma3:4b', wrapper)).toEqual({ toolCapable: false });expect(localToolUseHint('qwen3.6:35b', wrapper)).toEqual({ toolCapable: true });// Also via ANTHROPIC_BASE_URL pointing at the Ollama daemon.const viaBase = { name: 'Renamed', envVars: { ANTHROPIC_BASE_URL: 'http://localhost:11434/v1' } };- expect(localToolUseHint('gemma4:e4b', viaBase)).toEqual({ toolCapable: false });+ expect(localToolUseHint('gemma3:4b', viaBase)).toEqual({ toolCapable: false });});it('returns null for a blank id', () => {@@ -666,7 +668,7 @@ describe('withToolUseOptionLabel', () => {expect(withToolUseOptionLabel('qwen3.6:35b', 'qwen3.6:35b', ollama)).toBe('qwen3.6:35b · 🔧 tool use');// Non-match is worded as unverified, not a false-certain negative — the id// regex is a positive allowlist, so a miss only means "not recognized".- expect(withToolUseOptionLabel('gemma4:e4b', 'gemma4:e4b', ollama)).toBe('gemma4:e4b · ⚠ no known tool use');+ expect(withToolUseOptionLabel('gemma3:4b', 'gemma3:4b', ollama)).toBe('gemma3:4b · ⚠ no known tool use');});it('leaves cloud provider labels unchanged', () => {@@ -885,10 +887,11 @@ describe('visionLocalModelFilter', () => {});it('accepts a server-reported vision id the stale id regex does not know', () => {- // The id regex knows `gemma-3` but not `gemma4` — without the authoritative- // map, a user whose only VLMs are gemma4/qwen3.6 gets an empty picker.- expect(visionLocalModelFilter('gemma4:e4b', ollama)).toBe(false);- expect(visionLocalModelFilter('gemma4:e4b', ollama, { ollama: new Set(['gemma4:e4b']) })).toBe(true);+ // Multimodal models whose id carries no `vl`/`vision` marker (Muse Glimmer,+ // Ministral 3) are invisible to the regex — without the authoritative map a+ // user whose only VLMs are those gets an empty picker.+ expect(visionLocalModelFilter('muse-glimmer:30b', ollama)).toBe(false);+ expect(visionLocalModelFilter('muse-glimmer:30b', ollama, { ollama: new Set(['muse-glimmer:30b']) })).toBe(true);expect(visionLocalModelFilter('qwen3.6:35b', ollama, { ollama: new Set(['qwen3.6:35b']) })).toBe(true);});@@ -896,9 +899,9 @@ describe('visionLocalModelFilter', () => {// Fetched-but-empty (no local VLM reported) still keeps regex matches, and a// map that omits a model the regex knows must not hide it.expect(visionLocalModelFilter('llava:latest', ollama, { ollama: new Set() })).toBe(true);- expect(visionLocalModelFilter('llava:latest', ollama, { ollama: new Set(['gemma4:e4b']) })).toBe(true);+ expect(visionLocalModelFilter('llava:latest', ollama, { ollama: new Set(['muse-glimmer:30b']) })).toBe(true);// ...and it still can't smuggle a text-only model past the filter.- expect(visionLocalModelFilter('qwen2.5-coder:32b', ollama, { ollama: new Set(['gemma4:e4b']) })).toBe(false);+ expect(visionLocalModelFilter('qwen2.5-coder:32b', ollama, { ollama: new Set(['muse-glimmer:30b']) })).toBe(false);});it('scopes capabilities to the enumerated provider — an id is not a capability', () => {@@ -915,9 +918,9 @@ describe('visionLocalModelFilter', () => {// the local /vision-models result says nothing about that host — so a local// VLM's id must not make a same-named remote model "vision".const remote = { id: 'ollama-udev', name: 'Ollama (udev)', endpoint: 'http://udev:11434' };- const localOnly = { ollama: new Set(['gemma4:e4b']) };- expect(visionLocalModelFilter('gemma4:e4b', ollama, localOnly)).toBe(true);- expect(visionLocalModelFilter('gemma4:e4b', remote, localOnly)).toBe(false);+ const localOnly = { ollama: new Set(['muse-glimmer:30b']) };+ expect(visionLocalModelFilter('muse-glimmer:30b', ollama, localOnly)).toBe(true);+ expect(visionLocalModelFilter('muse-glimmer:30b', remote, localOnly)).toBe(false);});it('leaves cloud providers untouched regardless of the authoritative map', () => {@@ -945,8 +948,8 @@ describe('AI Assignments option helpers', () => {name: 'Ollama',type: 'api',enabled: true,- defaultModel: 'gemma4:26b',- models: ['qwen2.5vl:latest', 'llava:latest', 'gemma4:26b', 'llama3.2:latest', 'nomic-embed-text'],+ defaultModel: 'granite4.1:8b',+ models: ['qwen2.5vl:latest', 'llava:latest', 'granite4.1:8b', 'llama3.2:latest', 'nomic-embed-text'],},{id: 'openai',@@ -1008,7 +1011,7 @@ describe('AI Assignments option helpers', () => {expect(assignmentDefaultModel({ modelFilter: 'vision' }, providers, 'openai')).toBe('gpt-4o');// Non-vision rows still seed the provider default.- expect(assignmentDefaultModel({}, providers, 'ollama')).toBe('gemma4:26b');+ expect(assignmentDefaultModel({}, providers, 'ollama')).toBe('granite4.1:8b');expect(assignmentDefaultModel({}, providers, '')).toBe('');});});diff --git a/server/lib/aiToolkit/providers.js b/server/lib/aiToolkit/providers.jsindex 2363d5bfca..b1e1d3e0d7 100644--- a/server/lib/aiToolkit/providers.js+++ b/server/lib/aiToolkit/providers.js@@ -112,14 +112,17 @@ const TOOL_USE_RE = new RegExp(['qwen','llama-?3\\.[1-9]', 'llama-?4','mistral', 'mixtral', 'ministral', 'codestral', 'devstral', 'magistral',- 'command-?r', 'command-?a',- 'firefunction', 'functionary', 'watt-tool', 'hermes',+ 'command-?r', 'command-?a', 'north-mini-code',+ 'firefunction', 'functionary', 'watt-tool', 'hermes', 'functiongemma','glm-?4',- 'granite-?3',+ 'granite-?[34]',+ '(?:^|[-_/:])gemma-?4','gpt-oss','nemotron',+ 'olmo-?3',+ 'lfm2', 'ornith', 'muse-glimmer', 'nex-n2','smollm2',- 'deepseek-v3', 'deepseek-r1',+ 'deepseek-v3', 'deepseek-r1', 'deepseek-v4',].join('|'), 'i');/** Normalize an Ollama base URL (strip trailing slash + an OpenAI-compat `/v1`). */diff --git a/server/lib/localLlmCatalog.js b/server/lib/localLlmCatalog.jsindex 3452107f0a..6373e8195d 100644--- a/server/lib/localLlmCatalog.js+++ b/server/lib/localLlmCatalog.js@@ -44,42 +44,52 @@ export const LOCAL_LLM_CATEGORIES = [// `context` is the model's native context window in tokens — set it only when// it's a documented spec for that build (the install-card badge shows it; live// Hugging Face results read the true value from GGUF metadata instead).+//+// Ollama ids must name a build that runs LOCALLY. Several headline 2026 models+// (mistral-large-3, glm-5.2, deepseek-v4-*, minimax-m3, kimi-k3) are published+// to the Ollama library as `:cloud`-only tags whose manifests carry no weights —+// pulling one gets you an API passthrough, not a local model. Verify a tag has a+// non-zero manifest size before adding it here.export const LOCAL_LLM_CATALOG = [+ // ── Small & fast tier ──+ // Sub-4B models for classification, routing, and the voice agent's tool turns,+ // where round-trip latency matters more than prose quality.{- key: 'llama3.2',- name: 'Llama 3.2 3B',- category: 'chat',- params: '3B',- size: '2.0 GB',- family: 'llama',- description: "Meta's compact general-purpose chat model. Fast on most machines.",+ key: 'functiongemma-270m',+ name: 'FunctionGemma 270M',+ category: 'lightweight',+ params: '270M',+ size: '301 MB',+ family: 'gemma',+ description: "Google's Gemma 3 270M fine-tuned purely for function calling — the smallest model here that still drives tools reliably.",capabilities: ['chat', 'tools'],- ollama: 'llama3.2',- lmstudio: 'lmstudio-community/Llama-3.2-3B-Instruct-GGUF'+ context: 32768,+ ollama: 'functiongemma:270m',+ lmstudio: 'lmstudio-community/functiongemma-270m-it-GGUF'},{- key: 'llama3.1',- name: 'Llama 3.1 8B',- category: 'chat',- params: '8B',- size: '4.7 GB',- family: 'llama',- description: "Meta's mid-size instruct model — a solid general default.",- capabilities: ['chat', 'tools'],- ollama: 'llama3.1',- lmstudio: 'lmstudio-community/Meta-Llama-3.1-8B-Instruct-GGUF'+ key: 'gemma-3-270m-it',+ name: 'Gemma 3 270M IT',+ category: 'lightweight',+ params: '270M',+ size: '253 MB',+ family: 'gemma',+ description: 'Tiny instruction model for cheap classification, routing, and quick local utilities.',+ capabilities: ['chat', 'classification'],+ ollama: 'hf.co/lmstudio-community/gemma-3-270m-it-GGUF:Q4_K_M',+ lmstudio: 'lmstudio-community/gemma-3-270m-it-GGUF'},{- key: 'qwen2.5',- name: 'Qwen2.5 7B',- category: 'multilingual',- params: '7B',- size: '4.7 GB',- family: 'qwen',- description: "Alibaba's strong multilingual instruct model with good tool use.",- capabilities: ['chat', 'tools'],- ollama: 'qwen2.5',- lmstudio: 'lmstudio-community/Qwen2.5-7B-Instruct-GGUF'+ key: 'lfm2.5-thinking-1.2b',+ name: 'LFM2.5 Thinking 1.2B',+ category: 'lightweight',+ params: '1.2B',+ size: '731 MB',+ family: 'lfm2',+ description: "Liquid AI's on-device hybrid model — reasoning and tool calling in well under a gigabyte, with a ~125K context.",+ capabilities: ['chat', 'reasoning', 'tools'],+ ollama: 'lfm2.5-thinking:1.2b',+ lmstudio: 'lmstudio-community/LFM2.5-1.2B-Thinking-GGUF'},{key: 'qwen2.5-3b',@@ -96,6 +106,58 @@ export const LOCAL_LLM_CATALOG = [ollama: 'hf.co/lmstudio-community/Qwen2.5-3B-Instruct-GGUF:Q4_K_M',lmstudio: 'lmstudio-community/Qwen2.5-3B-Instruct-GGUF'},+ {+ key: 'granite4.1-3b',+ name: 'Granite 4.1 3B',+ category: 'lightweight',+ params: '3B',+ size: '2.1 GB',+ family: 'granite',+ description: "Apache-licensed IBM Granite — small, tool-capable, and tuned for tight instruction-following rather than chat flourish.",+ capabilities: ['chat', 'tools'],+ context: 131072,+ ollama: 'granite4.1:3b',+ lmstudio: 'lmstudio-community/granite-4.1-3b-GGUF'+ },+ {+ key: 'nemotron-3-nano-4b',+ name: 'Nemotron 3 Nano 4B',+ category: 'lightweight',+ params: '4B',+ size: '2.8 GB',+ family: 'nemotron',+ description: "NVIDIA's efficient agentic model — reasoning and tool calling at 4B with a 256K context.",+ capabilities: ['chat', 'reasoning', 'tools'],+ context: 262144,+ ollama: 'nemotron-3-nano:4b',+ lmstudio: 'lmstudio-community/NVIDIA-Nemotron-3-Nano-4B-GGUF'+ },+ {+ key: 'qwen3.5-4b',+ name: 'Qwen3.5 4B',+ category: 'lightweight',+ params: '4B',+ size: '3.4 GB',+ family: 'qwen',+ description: 'Compact current-generation Qwen with vision, tools, and a 256K context — a lot of capability per gigabyte.',+ capabilities: ['chat', 'tools', 'vision', 'multilingual'],+ context: 262144,+ ollama: 'qwen3.5:4b',+ lmstudio: 'lmstudio-community/Qwen3.5-4B-GGUF'+ },+ // ── Everyday chat tier (laptop-class: 16–32GB) ──+ {+ key: 'lfm2.5-8b-a1b',+ name: 'LFM2.5 8B-A1B',+ category: 'chat',+ params: '8B / 1B active',+ size: '5.2 GB',+ family: 'lfm2',+ description: "Liquid AI's edge MoE (1B active) built for fast, reliable tool calling on consumer hardware — 8B quality at roughly 1B speed.",+ capabilities: ['chat', 'reasoning', 'tools'],+ ollama: 'lfm2.5:8b',+ lmstudio: 'LiquidAI/LFM2.5-8B-A1B-GGUF'+ },{key: 'hermes-3-llama-3.1-8b',name: 'Hermes 3 8B',@@ -109,82 +171,149 @@ export const LOCAL_LLM_CATALOG = [lmstudio: 'NousResearch/Hermes-3-Llama-3.1-8B-GGUF'},{- key: 'qwen3.6-35b-a3b',- name: 'Qwen3.6 35B-A3B',- category: 'coding',- params: '35B / 3B active',- size: '24 GB',+ key: 'granite4.1-8b',+ name: 'Granite 4.1 8B',+ category: 'chat',+ params: '8B',+ size: '5.3 GB',+ family: 'granite',+ description: 'Apache-licensed IBM Granite instruct model with a 128K context — clean, constrained output for structured and editorial work.',+ capabilities: ['chat', 'tools', 'multilingual'],+ context: 131072,+ ollama: 'granite4.1:8b',+ lmstudio: 'lmstudio-community/granite-4.1-8b-GGUF'+ },+ {+ key: 'ministral-3-8b',+ name: 'Ministral 3 8B Instruct',+ category: 'chat',+ params: '8B',+ size: '6.0 GB',+ family: 'ministral',+ description: "Mistral's edge instruct model — vision, tools, and a 256K context, with no thinking phase to wait through. (A separate Ministral 3 Reasoning build exists if you want one.)",+ capabilities: ['chat', 'tools', 'vision', 'multilingual'],+ context: 262144,+ ollama: 'ministral-3:8b',+ lmstudio: 'lmstudio-community/Ministral-3-8B-Instruct-2512-GGUF'+ },+ {+ key: 'qwen3.5-9b',+ name: 'Qwen3.5 9B',+ category: 'multilingual',+ params: '9B',+ size: '6.6 GB',family: 'qwen',- description: 'Current Qwen coding model with agentic coding, repository reasoning, vision, and tool-use upgrades.',- capabilities: ['chat', 'code', 'tools', 'vision'],- ollama: 'qwen3.6:35b',- lmstudio: 'unsloth/Qwen3.6-35B-A3B-GGUF'+ description: "Alibaba's current multimodal all-rounder — strong multilingual coverage, vision, tools, and a 256K context. A solid general default.",+ capabilities: ['chat', 'tools', 'vision', 'multilingual'],+ context: 262144,+ ollama: 'qwen3.5:9b',+ lmstudio: 'lmstudio-community/Qwen3.5-9B-GGUF'},{- key: 'nex-n2-mini',- name: 'Nex-N2-mini 35B-A3B',- category: 'coding',- params: '35B / 3B active',- size: '22 GB',- family: 'nex-n2',- description: "Nex AGI's agentic MoE (3B active) on a Qwen3.5 base — strong at coding, tool calling, long-horizon agent tasks, and vision (75.3 Terminal-Bench 2.1). Apache-2.0; the Q4 build fits comfortably on 32GB+ and is easy on a 128GB Mac. Vision needs the repo's mmproj file. The 397B Nex-N2-Pro is the big sibling — it won't fit a 128GB Mac even at Q4.",- capabilities: ['chat', 'code', 'tools', 'reasoning', 'vision'],- ollama: 'hf.co/sjakek/Nex-N2-mini-GGUF:UD-Q4_K_M',- lmstudio: 'sjakek/Nex-N2-mini-GGUF'+ key: 'gemma4-12b',+ name: 'Gemma 4 12B',+ category: 'chat',+ params: '12B',+ size: '7.6 GB',+ family: 'gemma',+ description: "Google's mid-size Gemma 4 with vision, tools, and a 256K context — frontier-ish quality that still fits a 16GB machine.",+ capabilities: ['chat', 'tools', 'vision'],+ context: 262144,+ ollama: 'gemma4:12b',+ lmstudio: 'lmstudio-community/gemma-4-12B-it-GGUF'+ },+ {+ key: 'ministral-3-14b',+ name: 'Ministral 3 14B Instruct',+ category: 'reasoning',+ params: '14B',+ size: '9.1 GB',+ family: 'ministral',+ description: 'The largest Ministral 3 — more headroom for reasoning and general work while staying laptop-friendly.',+ capabilities: ['chat', 'reasoning', 'tools', 'vision'],+ context: 262144,+ ollama: 'ministral-3:14b',+ lmstudio: 'lmstudio-community/Ministral-3-14B-Instruct-2512-GGUF'+ },+ {+ key: 'gpt-oss-20b',+ name: 'GPT-OSS 20B',+ category: 'reasoning',+ params: '20B',+ size: '12 GB',+ family: 'gpt-oss',+ description: 'Open-weights 20B model — the default local thinking model.',+ capabilities: ['chat', 'reasoning'],+ ollama: 'gpt-oss:20b',+ lmstudio: 'lmstudio-community/gpt-oss-20b-GGUF'},- // ── Large narrative / long-context tier (workstation-class: 64–128GB unified memory) ──+ // ── Large narrative / long-context tier (workstation-class: 32–128GB unified memory) ──// Best suited for whole-manuscript editorial review, where prose quality and a// long context window matter most. To actually fit the manuscript, raise Ollama's// context window (OLLAMA_CONTEXT_LENGTH) — the default 4K window silently truncates.{- key: 'mistral-large',- name: 'Mistral Large 2 123B',+ key: 'qwen3.6-27b',+ name: 'Qwen3.6 27B',category: 'chat',- params: '123B',- size: '73 GB',- family: 'mistral',- description: 'Top-tier open-weight prose model with a 128K context window — best local pick for long-form narrative and editorial review. Needs ~96GB+ unified memory.',- capabilities: ['chat', 'tools'],- context: 131072,- ollama: 'mistral-large:123b'+ params: '27B',+ size: '17 GB',+ family: 'qwen',+ description: 'Dense current-generation Qwen with a 256K context, vision, tools, and a thinking mode — the strongest all-round narrative editor that still fits 32GB.',+ capabilities: ['chat', 'reasoning', 'tools', 'vision'],+ context: 262144,+ ollama: 'qwen3.6:27b',+ lmstudio: 'lmstudio-community/Qwen3.6-27B-GGUF'},{- key: 'command-r-plus',- name: 'Command R+ 104B',+ key: 'gemma4-26b-a4b',+ name: 'Gemma 4 26B-A4B',category: 'chat',- params: '104B',- size: '59 GB',- family: 'command-r',- description: 'Cohere long-context model (128K) tuned for RAG and clean character-voice dialogue — strong for whole-manuscript continuity passes. Needs ~80GB+ unified memory.',- capabilities: ['chat', 'tools', 'multilingual'],- context: 131072,- ollama: 'command-r-plus:104b'+ params: '26B / 4B active',+ size: '18 GB',+ family: 'gemma',+ description: "Google's MoE (4B active) with a 256K context window and vision — a fast long-context option for one-shot whole-manuscript review. MLX build on Apple Silicon: gemma4:26b-mlx.",+ capabilities: ['chat', 'tools', 'vision'],+ context: 262144,+ ollama: 'gemma4:26b',+ lmstudio: 'lmstudio-community/gemma-4-26B-A4B-it-GGUF'},{- key: 'llama3.3',- name: 'Llama 3.3 70B',+ key: 'muse-glimmer-30b',+ name: 'Muse Glimmer 30B',category: 'chat',- params: '70B',- size: '43 GB',- family: 'llama',- description: "Meta's 70B instruct model with a 128K context — excellent narrative quality with memory headroom to spare for a large context window. Runs on 64GB+.",- capabilities: ['chat', 'tools'],+ params: '30B',+ size: '18 GB',+ family: 'muse-glimmer',+ description: "Meta's Apache-2.0 open model for always-on local agents — vision, tools, and thinking, tuned for long tasks and failure recovery. Runs on a single GPU.",+ capabilities: ['chat', 'reasoning', 'tools', 'vision'],context: 131072,- ollama: 'llama3.3:70b',- lmstudio: 'lmstudio-community/Llama-3.3-70B-Instruct-GGUF'+ ollama: 'muse-glimmer:30b',+ lmstudio: 'lmstudio-community/Muse-Glimmer-30B-GGUF'},{- key: 'qwen3-30b-a3b',- name: 'Qwen3 30B-A3B',+ key: 'glm-4.7-flash',+ name: 'GLM-4.7 Flash',category: 'chat',- params: '30B / 3B active',+ params: '30B class',size: '19 GB',- family: 'qwen',- description: 'Fast MoE with a native 256K context — the long-context workhorse for one-shot whole-manuscript review when you want maximum context with memory to spare.',- capabilities: ['chat', 'tools', 'multilingual'],- context: 262144,- ollama: 'qwen3:30b',- lmstudio: 'lmstudio-community/Qwen3-30B-A3B-GGUF'+ family: 'glm',+ description: 'Z.ai\'s strongest model in the 30B class — reasoning plus tools with a ~198K context, balanced for lightweight local deployment.',+ capabilities: ['chat', 'reasoning', 'tools'],+ ollama: 'glm-4.7-flash',+ lmstudio: 'lmstudio-community/GLM-4.7-Flash-GGUF'+ },+ {+ key: 'olmo-3.1-32b',+ name: 'Olmo 3.1 32B Instruct',+ category: 'reasoning',+ params: '32B',+ size: '20 GB',+ family: 'olmo',+ description: "AI2's fully-open model — weights, data, and training recipe all published. Reasoning and tools with a 64K context; the sibling `olmo-3.1:32b-think` trades latency for depth.",+ capabilities: ['chat', 'reasoning', 'tools'],+ context: 65536,+ ollama: 'olmo-3.1:32b-instruct',+ lmstudio: 'lmstudio-community/Olmo-3.1-32B-Instruct-GGUF'},{key: 'gemma4-31b',@@ -194,177 +323,193 @@ export const LOCAL_LLM_CATALOG = [size: '20 GB',family: 'gemma',description: "Google's dense 31B with a 256K context window and vision — a strong long-context narrative editor that fits comfortably on 64GB+. MLX build on Apple Silicon: gemma4:31b-mlx.",- capabilities: ['chat', 'vision'],+ capabilities: ['chat', 'tools', 'vision'],context: 262144,ollama: 'gemma4:31b',lmstudio: 'lmstudio-community/gemma-4-31B-it-GGUF'},{- key: 'gemma4-26b-a4b',- name: 'Gemma 4 26B-A4B',- category: 'chat',- params: '26B / 4B active',- size: '18 GB',- family: 'gemma',- description: "Google's MoE (4B active) with a 256K context window and vision — a fast long-context option for one-shot whole-manuscript review. MLX build on Apple Silicon: gemma4:26b-mlx.",- capabilities: ['chat', 'vision'],- context: 262144,- ollama: 'gemma4:26b',- lmstudio: 'lmstudio-community/gemma-4-26B-A4B-it-GGUF'+ key: 'nemotron-3-nano-30b-a3b',+ name: 'Nemotron 3 Nano 30B-A3B',+ category: 'reasoning',+ params: '30B / 3B active',+ size: '24 GB',+ family: 'nemotron',+ description: "NVIDIA's agentic MoE with a 1M-token context — by far the longest window here, for whole-corpus review rather than a single manuscript. Only 3B active, so it stays fast.",+ capabilities: ['chat', 'reasoning', 'tools'],+ context: 1048576,+ ollama: 'nemotron-3-nano:30b',+ lmstudio: 'lmstudio-community/NVIDIA-Nemotron-3-Nano-30B-A3B-GGUF'},{- key: 'mistral',- name: 'Mistral 7B',+ key: 'qwen3.5-122b-a10b',+ name: 'Qwen3.5 122B-A10B',category: 'chat',- params: '7B',- size: '4.1 GB',- family: 'mistral',- description: 'Fast, capable 7B instruct model that runs well on modest GPUs.',- capabilities: ['chat'],- ollama: 'mistral',- lmstudio: 'lmstudio-community/Mistral-7B-Instruct-v0.3-GGUF'+ params: '122B / 10B active',+ size: '81 GB',+ family: 'qwen',+ description: 'The largest locally-runnable Qwen3.5 — frontier-class prose with a 256K context and only 10B active parameters. Needs ~96GB+ unified memory.',+ capabilities: ['chat', 'reasoning', 'tools', 'vision', 'multilingual'],+ context: 262144,+ ollama: 'qwen3.5:122b',+ lmstudio: 'lmstudio-community/Qwen3.5-122B-A10B-GGUF'},+ // ── Coding / agentic tier ──{- key: 'gemma2',- name: 'Gemma 2 9B',- category: 'chat',+ key: 'ornith-9b',+ name: 'Ornith 1.0 9B',+ category: 'coding',params: '9B',- size: '5.4 GB',- family: 'gemma',- description: "Google's Gemma 2 instruct model — strong reasoning for its size.",- capabilities: ['chat'],- ollama: 'gemma2',- lmstudio: 'lmstudio-community/gemma-2-9b-it-GGUF'+ size: '5.6 GB',+ family: 'ornith',+ description: 'Self-improving open model family for agentic coding — the 9B fits a laptop while still driving tools over a 256K context.',+ capabilities: ['chat', 'code', 'tools'],+ context: 262144,+ ollama: 'ornith:9b',+ lmstudio: 'lmstudio-community/Ornith-1.0-9B-GGUF'},{- key: 'phi3',- name: 'Phi-3 Mini',- category: 'lightweight',- params: '3.8B',- size: '2.3 GB',- family: 'phi',- description: "Microsoft's small-but-capable model with a long context window.",- capabilities: ['chat'],- ollama: 'phi3',- lmstudio: 'lmstudio-community/Phi-3.1-mini-128k-instruct-GGUF'+ key: 'devstral-small-2-24b',+ name: 'Devstral Small 2 24B',+ category: 'coding',+ params: '24B',+ size: '15 GB',+ family: 'devstral',+ description: 'Mistral\'s agentic coding model for repo navigation, multi-file edits, and software-engineering agents — vision and a ~384K context.',+ capabilities: ['chat', 'code', 'tools', 'vision'],+ ollama: 'devstral-small-2:24b',+ lmstudio: 'unsloth/Devstral-Small-2-24B-Instruct-2512-GGUF'},{- key: 'deepseek-r1',- name: 'DeepSeek-R1 Distill 7B',- category: 'reasoning',- params: '7B',- size: '4.7 GB',- family: 'deepseek',- description: 'Reasoning-tuned distill — good local "thinking" model.',- capabilities: ['chat', 'reasoning'],- ollama: 'deepseek-r1',- lmstudio: 'lmstudio-community/DeepSeek-R1-Distill-Qwen-7B-GGUF'+ key: 'north-mini-code-1.0',+ name: 'North Mini Code 1.0 30B-A3B',+ category: 'coding',+ params: '30B / 3B active',+ size: '19 GB',+ family: 'north-mini-code',+ description: "Cohere's first developer model — a 30B MoE (3B active) for agentic software engineering, with a ~488K context for whole-repo work.",+ capabilities: ['chat', 'code', 'reasoning', 'tools'],+ ollama: 'north-mini-code-1.0',+ lmstudio: 'unsloth/North-Mini-Code-1.0-GGUF'},{- key: 'gpt-oss-20b',- name: 'GPT-OSS 20B',- category: 'reasoning',- params: '20B',- size: '12 GB',- family: 'gpt-oss',- description: 'Open-weights 20B model — the default local thinking model.',- capabilities: ['chat', 'reasoning'],- ollama: 'gpt-oss:20b',- lmstudio: 'lmstudio-community/gpt-oss-20b-GGUF'+ key: 'ornith-35b',+ name: 'Ornith 1.0 35B',+ category: 'coding',+ params: '35B',+ size: '21 GB',+ family: 'ornith',+ description: 'The larger Ornith for agentic coding — more headroom on long-horizon repo tasks, still a 256K context.',+ capabilities: ['chat', 'code', 'tools'],+ context: 262144,+ ollama: 'ornith:35b',+ lmstudio: 'lmstudio-community/Ornith-1.0-35B-GGUF'},{- key: 'qwen2.5-vl-7b',- name: 'Qwen2.5-VL 7B (vision)',- category: 'vision',- params: '7B',- size: '6.0 GB',- family: 'qwen',- description: 'Strong vision-language model — the recommended default for LoRA dataset captioning.',- capabilities: ['chat', 'vision'],- ollama: 'qwen2.5vl',- lmstudio: 'lmstudio-community/Qwen2.5-VL-7B-Instruct-GGUF'+ key: 'nex-n2-mini',+ name: 'Nex-N2-mini 35B-A3B',+ category: 'coding',+ params: '35B / 3B active',+ size: '22 GB',+ family: 'nex-n2',+ description: "Nex AGI's agentic MoE (3B active) on a Qwen3.5 base — strong at coding, tool calling, long-horizon agent tasks, and vision (75.3 Terminal-Bench 2.1). Apache-2.0; the Q4 build fits comfortably on 32GB+ and is easy on a 128GB Mac. Vision needs the repo's mmproj file. The 397B Nex-N2-Pro is the big sibling — it won't fit a 128GB Mac even at Q4.",+ capabilities: ['chat', 'code', 'tools', 'reasoning', 'vision'],+ ollama: 'hf.co/sjakek/Nex-N2-mini-GGUF:UD-Q4_K_M',+ lmstudio: 'sjakek/Nex-N2-mini-GGUF'},{- key: 'qwen2.5-vl-32b',- name: 'Qwen2.5-VL 32B (vision)',- category: 'vision',- params: '32B',- size: '21 GB',+ key: 'qwen3.6-35b-a3b',+ name: 'Qwen3.6 35B-A3B',+ category: 'coding',+ params: '35B / 3B active',+ size: '24 GB',family: 'qwen',- description: 'Larger Qwen2.5-VL for the most detailed image captions — best on high-memory machines.',- capabilities: ['chat', 'vision'],- ollama: 'qwen2.5vl:32b',- lmstudio: 'lmstudio-community/Qwen2.5-VL-32B-Instruct-GGUF'+ description: 'Current Qwen coding MoE with agentic coding, repository reasoning, vision, and tool-use upgrades over Qwen3.5.',+ capabilities: ['chat', 'code', 'tools', 'vision'],+ context: 262144,+ ollama: 'qwen3.6:35b',+ lmstudio: 'unsloth/Qwen3.6-35B-A3B-GGUF'},+ // ── Vision / image analysis tier ──{- key: 'llama3.2-vision',- name: 'Llama 3.2 Vision 11B',+ key: 'minicpm-v4.6',+ name: 'MiniCPM-V 4.6 (vision)',category: 'vision',- params: '11B',- size: '7.9 GB',- family: 'llama',- description: "Meta's vision-language model for image description and captioning.",+ params: '1B',+ size: '1.6 GB',+ family: 'minicpm',+ description: 'Pocket-sized multimodal model for image and video understanding — the cheapest way to caption a large dataset locally.',capabilities: ['chat', 'vision'],- ollama: 'llama3.2-vision'+ context: 262144,+ ollama: 'minicpm-v4.6:1b',+ lmstudio: 'openbmb/MiniCPM-V-4_6-gguf'},{- key: 'minicpm-v',- name: 'MiniCPM-V 2.6 8B (vision)',+ key: 'qwen3-vl-2b',+ name: 'Qwen3-VL 2B (vision)',category: 'vision',- params: '8B',- size: '5.5 GB',- family: 'minicpm',- description: 'Efficient vision-language model with strong single-image captioning.',+ params: '2B',+ size: '1.9 GB',+ family: 'qwen',+ description: 'Tiny Qwen3-VL for quick captions on modest hardware, with the same 256K context as its larger siblings.',capabilities: ['chat', 'vision'],- ollama: 'minicpm-v',- lmstudio: 'openbmb/MiniCPM-V-2_6-gguf'+ context: 262144,+ ollama: 'qwen3-vl:2b',+ lmstudio: 'lmstudio-community/Qwen3-VL-2B-Instruct-GGUF'},{- key: 'moondream',- name: 'Moondream 1.8B (vision)',+ key: 'qwen3-vl-8b',+ name: 'Qwen3-VL 8B (vision)',category: 'vision',- params: '1.8B',- size: '1.7 GB',- family: 'moondream',- description: 'Tiny, fast vision model for quick captions on modest hardware.',- capabilities: ['chat', 'vision'],- ollama: 'moondream'+ params: '8B',+ size: '6.1 GB',+ family: 'qwen',+ description: 'The most capable vision-language model in the Qwen family at a laptop-friendly size — the recommended default for LoRA dataset captioning.',+ capabilities: ['chat', 'tools', 'vision'],+ context: 262144,+ ollama: 'qwen3-vl:8b',+ lmstudio: 'lmstudio-community/Qwen3-VL-8B-Instruct-GGUF'},{- key: 'llava',- name: 'LLaVA 7B (vision)',+ key: 'glm-4.6v-flash',+ name: 'GLM-4.6V Flash',category: 'vision',- params: '7B',- size: '4.5 GB',- family: 'llava',- description: 'Vision-language model — answers questions about images.',+ params: 'Vision',+ size: '7.1 GB',+ family: 'glm',+ description: 'MLX vision-language model for image analysis on Apple Silicon.',capabilities: ['chat', 'vision'],- ollama: 'llava',- lmstudio: 'lmstudio-community/llava-v1.5-7b-GGUF'+ lmstudio: 'lmstudio-community/GLM-4.6V-Flash-MLX-4bit'},{- key: 'codellama',- name: 'Code Llama 7B',- category: 'coding',- params: '7B',- size: '3.8 GB',- family: 'llama',- description: "Meta's code-specialised Llama for completion and infilling.",- capabilities: ['chat', 'code'],- ollama: 'codellama',- lmstudio: 'lmstudio-community/CodeLlama-7b-Instruct-GGUF'+ key: 'qwen3-vl-30b-a3b',+ name: 'Qwen3-VL 30B-A3B (vision)',+ category: 'vision',+ params: '30B / 3B active',+ size: '20 GB',+ family: 'qwen',+ description: 'Larger Qwen3-VL MoE for the most detailed image captions — best on high-memory machines, and only 3B active so it stays responsive.',+ capabilities: ['chat', 'tools', 'vision'],+ context: 262144,+ ollama: 'qwen3-vl:30b',+ lmstudio: 'lmstudio-community/Qwen3-VL-30B-A3B-Instruct-GGUF'},+ // ── Text embeddings ──+ // PortOS's memory/recall pipeline expects 768-dimension vectors+ // (EMBEDDING_DIM in server/services/embeddings.js) — every entry below+ // produces them. Larger embedders (e.g. qwen3-embedding at 1024 dims) are+ // deliberately absent: they fail the dimension check on ingest.{- key: 'smollm2',- name: 'SmolLM2 1.7B',- category: 'lightweight',- params: '1.7B',- size: '1.1 GB',- family: 'smollm',- description: 'Tiny, fast model for quick classification and routing tasks.',- capabilities: ['chat'],- ollama: 'smollm2',- lmstudio: 'lmstudio-community/SmolLM2-1.7B-Instruct-GGUF'+ key: 'embeddinggemma-300m',+ name: 'EmbeddingGemma 300M',+ category: 'embedding',+ params: '300M',+ size: '622 MB',+ family: 'embedding',+ description: "Google's 300M embedding model — 768-dimension vectors for semantic search and memory recall.",+ capabilities: ['embeddings', 'multilingual'],+ ollama: 'embeddinggemma:300m',+ lmstudio: 'lmstudio-community/embeddinggemma-300m-qat-GGUF'},{key: 'nomic-embed-text',@@ -389,78 +534,49 @@ export const LOCAL_LLM_CATALOG = [capabilities: ['embeddings', 'multilingual'],ollama: 'hf.co/nomic-ai/nomic-embed-text-v2-moe-GGUF:Q4_K_M',lmstudio: 'nomic-ai/nomic-embed-text-v2-moe-GGUF'- },+ }+];++// Models that have aged out of the suggested-install picker but that installs+// upgraded from an older PortOS may still have on disk. `mapModelToBackend`+// consults these AFTER `LOCAL_LLM_CATALOG` so a migrate of an older library+// still resolves exactly instead of falling back to a guessed stem — dropping an+// entry from the catalog above must not silently downgrade the migrate flow.+//+// Entries need BOTH ids: a one-sided pair maps to nothing and would only add a+// dead HuggingFace repo to the mapping table (both `lmstudio-community/llava-v1.5-7b-GGUF`+// and `lmstudio-community/CodeLlama-7b-Instruct-GGUF` 404 as of this refresh,+// so LLaVA 1.5 and Code Llama are omitted rather than mapped to a broken repo).+const RETIRED_MODEL_MAPPINGS = [+ { ollama: 'llama3.2', lmstudio: 'lmstudio-community/Llama-3.2-3B-Instruct-GGUF' },+ { ollama: 'llama3.1', lmstudio: 'lmstudio-community/Meta-Llama-3.1-8B-Instruct-GGUF' },+ { ollama: 'llama3.3:70b', lmstudio: 'lmstudio-community/Llama-3.3-70B-Instruct-GGUF' },+ { ollama: 'qwen2.5', lmstudio: 'lmstudio-community/Qwen2.5-7B-Instruct-GGUF' },+ { ollama: 'qwen3:30b', lmstudio: 'lmstudio-community/Qwen3-30B-A3B-GGUF' },+ { ollama: 'qwen2.5vl', lmstudio: 'lmstudio-community/Qwen2.5-VL-7B-Instruct-GGUF' },+ { ollama: 'qwen2.5vl:32b', lmstudio: 'lmstudio-community/Qwen2.5-VL-32B-Instruct-GGUF' },{- key: 'qwen3-4b-instruct-2507',- name: 'Qwen3 4B Instruct 2507',- category: 'lightweight',- params: '4B',- size: '2.6 GB',- family: 'qwen',- description: 'Compact current Qwen3 instruct model for fast local chat and tool workflows.',- capabilities: ['chat', 'tools', 'multilingual'],ollama: 'hf.co/lmstudio-community/Qwen3-4B-Instruct-2507-GGUF:Q4_K_M',lmstudio: 'lmstudio-community/Qwen3-4B-Instruct-2507-GGUF'},+ { ollama: 'mistral', lmstudio: 'lmstudio-community/Mistral-7B-Instruct-v0.3-GGUF' },{- key: 'granite-3.2-8b-instruct',- name: 'Granite 3.2 8B Instruct',- category: 'reasoning',- params: '8B',- size: '4.9 GB',- family: 'granite',- description: 'Apache-licensed IBM Granite instruct model with long context and thinking controls.',- capabilities: ['chat', 'reasoning', 'multilingual'],- ollama: 'hf.co/lmstudio-community/granite-3.2-8b-instruct-GGUF:Q4_K_M',- lmstudio: 'lmstudio-community/granite-3.2-8b-instruct-GGUF'- },- {- key: 'gemma-3-270m-it',- name: 'Gemma 3 270M IT',- category: 'lightweight',- params: '270M',- size: '253 MB',- family: 'gemma',- description: 'Tiny instruction model for cheap classification, routing, and quick local utilities.',- capabilities: ['chat', 'classification'],- ollama: 'hf.co/lmstudio-community/gemma-3-270m-it-GGUF:Q4_K_M',- lmstudio: 'lmstudio-community/gemma-3-270m-it-GGUF'+ ollama: 'hf.co/unsloth/Devstral-Small-2-24B-Instruct-2512-GGUF:UD-Q4_K_XL',+ lmstudio: 'unsloth/Devstral-Small-2-24B-Instruct-2512-GGUF'},{- key: 'ministral-3-14b-instruct-2512',- name: 'Ministral 3 14B Instruct 2512',- category: 'reasoning',- params: '14B',- size: '8.6 GB',- family: 'mistral',- description: 'Current Mistral-family instruct model for strong local reasoning and general work.',- capabilities: ['chat', 'reasoning', 'tools'],ollama: 'hf.co/lmstudio-community/Ministral-3-14B-Instruct-2512-GGUF:Q4_K_M',lmstudio: 'lmstudio-community/Ministral-3-14B-Instruct-2512-GGUF'},{- key: 'devstral-small-2-24b',- name: 'Devstral Small 2 24B',- category: 'coding',- params: '24B',- size: '14 GB',- family: 'mistral',- description: 'Agentic coding model for repo navigation, edits, and software-engineering tasks.',- capabilities: ['chat', 'code', 'tools', 'vision'],- ollama: 'hf.co/unsloth/Devstral-Small-2-24B-Instruct-2512-GGUF:UD-Q4_K_XL',- lmstudio: 'unsloth/Devstral-Small-2-24B-Instruct-2512-GGUF'+ ollama: 'hf.co/lmstudio-community/granite-3.2-8b-instruct-GGUF:Q4_K_M',+ lmstudio: 'lmstudio-community/granite-3.2-8b-instruct-GGUF'},- {- key: 'glm-4.6v-flash',- name: 'GLM-4.6V Flash',- category: 'vision',- params: 'Vision',- size: '7.1 GB',- family: 'glm',- description: 'MLX vision-language model for image analysis on Apple Silicon.',- capabilities: ['chat', 'vision'],- lmstudio: 'lmstudio-community/GLM-4.6V-Flash-MLX-4bit'- }+ { ollama: 'gemma2', lmstudio: 'lmstudio-community/gemma-2-9b-it-GGUF' },+ { ollama: 'phi3', lmstudio: 'lmstudio-community/Phi-3.1-mini-128k-instruct-GGUF' },+ { ollama: 'deepseek-r1', lmstudio: 'lmstudio-community/DeepSeek-R1-Distill-Qwen-7B-GGUF' },+ { ollama: 'minicpm-v', lmstudio: 'openbmb/MiniCPM-V-2_6-gguf' },+ { ollama: 'smollm2', lmstudio: 'lmstudio-community/SmolLM2-1.7B-Instruct-GGUF' }];// Strip only the implicit `:latest` tag (`llama3.2:latest` → `llama3.2`) and@@ -531,7 +647,8 @@ export function searchCatalog(backend, query, installedIds = []) {* `toBackend`, used by the migrate flow.** Returns `{ targetId, exact }`:- * - `exact: true` — a curated catalog entry matched and the target build is known.+ * - `exact: true` — a curated (or retired-but-still-mapped) catalog entry+ * matched and the target build is known.* - `exact: false` — best-effort derived name (only when the target is Ollama,* which can pull bare model names); `targetId` is null when no reasonable* guess exists (e.g. mapping an unknown model TO LM Studio needs a HF repo).@@ -541,7 +658,9 @@ export function mapModelToBackend(fromBackend, modelId, toBackend) {return { targetId: null, exact: false };}const fromNorm = normalizeFor(fromBackend, modelId);- const entry = LOCAL_LLM_CATALOG.find(+ // Suggested models first, then models retired from the picker — an install+ // that predates a catalog refresh still migrates exactly.+ const entry = [...LOCAL_LLM_CATALOG, ...RETIRED_MODEL_MAPPINGS].find((e) => e[fromBackend] && normalizeFor(fromBackend, e[fromBackend]) === fromNorm);if (entry && entry[toBackend]) {diff --git a/server/lib/localLlmCatalog.test.js b/server/lib/localLlmCatalog.test.jsindex 052b4d40e3..78d29ebcac 100644--- a/server/lib/localLlmCatalog.test.js+++ b/server/lib/localLlmCatalog.test.js@@ -17,12 +17,12 @@ describe('localLlmCatalog', () => {describe('getCatalog', () => {it('projects entries onto the backend-specific install id', () => {const ollama = getCatalog('ollama');- const llama = ollama.find((m) => m.key === 'llama3.2');- expect(llama.id).toBe('llama3.2');- expect(llama.category).toBe('chat');+ const gemma = ollama.find((m) => m.key === 'gemma4-12b');+ expect(gemma.id).toBe('gemma4:12b');+ expect(gemma.category).toBe('chat');const lms = getCatalog('lmstudio');- const llamaLms = lms.find((m) => m.key === 'llama3.2');- expect(llamaLms.id).toBe('lmstudio-community/Llama-3.2-3B-Instruct-GGUF');+ const gemmaLms = lms.find((m) => m.key === 'gemma4-12b');+ expect(gemmaLms.id).toBe('lmstudio-community/gemma-4-12B-it-GGUF');});it('only includes entries that ship a build for the backend', () => {@@ -35,14 +35,14 @@ describe('localLlmCatalog', () => {});it('marks installed models (tag-insensitive for Ollama)', () => {- const list = getCatalog('ollama', ['llama3.2:latest']);- expect(list.find((m) => m.id === 'llama3.2').installed).toBe(true);- expect(list.find((m) => m.id === 'mistral').installed).toBe(false);+ const list = getCatalog('ollama', ['glm-4.7-flash:latest']);+ expect(list.find((m) => m.id === 'glm-4.7-flash').installed).toBe(true);+ expect(list.find((m) => m.id === 'gemma4:12b').installed).toBe(false);});it('matches LM Studio installed ids despite the -GGUF suffix / publisher prefix', () => {- const list = getCatalog('lmstudio', ['lmstudio-community/Llama-3.2-3B-Instruct-GGUF']);- expect(list.find((m) => m.key === 'llama3.2').installed).toBe(true);+ const list = getCatalog('lmstudio', ['lmstudio-community/gemma-4-12B-it-GGUF']);+ expect(list.find((m) => m.key === 'gemma4-12b').installed).toBe(true);});it('returns [] for an unknown backend', () => {@@ -71,12 +71,17 @@ describe('localLlmCatalog', () => {it('surfaces a documented context window as contextLength, null otherwise', () => {const ollama = getCatalog('ollama');- // mistral-large's description documents a 128K window.- expect(ollama.find((m) => m.key === 'mistral-large').contextLength).toBe(131072);- // qwen3-30b-a3b documents a native 256K window.- expect(ollama.find((m) => m.key === 'qwen3-30b-a3b').contextLength).toBe(262144);- // Entries with no documented window expose null (never undefined).- expect(ollama.find((m) => m.key === 'llama3.2').contextLength).toBeNull();+ // granite4.1-8b documents a 128K window.+ expect(ollama.find((m) => m.key === 'granite4.1-8b').contextLength).toBe(131072);+ // qwen3.6-27b documents a native 256K window.+ expect(ollama.find((m) => m.key === 'qwen3.6-27b').contextLength).toBe(262144);+ // Entries whose real window isn't a documented round number expose null+ // (never undefined) rather than an invented one.+ expect(ollama.find((m) => m.key === 'glm-4.7-flash').contextLength).toBeNull();+ });++ it('never lists an Ollama `:cloud` tag — those manifests carry no local weights', () => {+ expect(LOCAL_LLM_CATALOG.every((e) => !/(?:^|:)cloud$/.test(e.ollama || ''))).toBe(true);});});@@ -86,7 +91,7 @@ describe('localLlmCatalog', () => {});it('filters by name, family, and description', () => {expect(searchCatalog('ollama', 'coding').some((m) => m.key === 'qwen3.6-35b-a3b')).toBe(true);- expect(searchCatalog('ollama', 'vision').some((m) => m.key === 'llava')).toBe(true);+ expect(searchCatalog('ollama', 'vision').some((m) => m.key === 'qwen3-vl-8b')).toBe(true);expect(searchCatalog('ollama', 'embedding').some((m) => m.key === 'nomic-embed-text-v2-moe')).toBe(true);expect(searchCatalog('ollama', 'zzzznotamodel')).toEqual([]);});@@ -94,10 +99,22 @@ describe('localLlmCatalog', () => {describe('mapModelToBackend', () => {it('maps a known model exactly across backends', () => {+ expect(mapModelToBackend('ollama', 'gemma4:12b', 'lmstudio'))+ .toEqual({ targetId: 'lmstudio-community/gemma-4-12B-it-GGUF', exact: true });+ expect(mapModelToBackend('lmstudio', 'lmstudio-community/gemma-4-12B-it-GGUF', 'ollama'))+ .toEqual({ targetId: 'gemma4:12b', exact: true });+ });++ it('still maps models retired from the suggested-install catalog', () => {+ // Retiring an entry from LOCAL_LLM_CATALOG must not downgrade an existing+ // install's migrate to a guessed stem — RETIRED_MODEL_MAPPINGS keeps it exact.+ expect(getCatalog('ollama').some((m) => m.key === 'llama3.2')).toBe(false);expect(mapModelToBackend('ollama', 'llama3.2:latest', 'lmstudio')).toEqual({ targetId: 'lmstudio-community/Llama-3.2-3B-Instruct-GGUF', exact: true });expect(mapModelToBackend('lmstudio', 'lmstudio-community/Llama-3.2-3B-Instruct-GGUF', 'ollama')).toEqual({ targetId: 'llama3.2', exact: true });+ expect(mapModelToBackend('ollama', 'qwen2.5vl:32b', 'lmstudio'))+ .toEqual({ targetId: 'lmstudio-community/Qwen2.5-VL-32B-Instruct-GGUF', exact: true });});it('best-effort derives an Ollama name for an unknown LM Studio model', () => {diff --git a/server/lib/localModelHeuristics.js b/server/lib/localModelHeuristics.jsindex c8deacc71c..2aa923a6a1 100644--- a/server/lib/localModelHeuristics.js+++ b/server/lib/localModelHeuristics.js@@ -16,8 +16,11 @@// Embedding-only models — never valid for chat/generation. The bge/nomic/e5/gte// markers are anchored so they don't match mid-word inside an unrelated id.+// `embeddinggemma` glues the marker to the family with no separator, so the+// anchored `embedding` alternative misses it — match that name explicitly or it+// reads as a chat-capable Gemma and gets picked for generation.const EMBEDDING_RE =- /(?:^|[-_/:])(?:embed|embedding|bge|nomic|mxbai|gte|e5|snowflake-arctic-embed)(?:[-_/:]|$)|text-embedding/i;+ /(?:^|[-_/:])(?:embed|embedding|bge|nomic|mxbai|gte|e5|snowflake-arctic-embed)(?:[-_/:]|$)|text-embedding|embeddinggemma/i;/*** @param {string} id model id (e.g. "nomic-embed-text:latest")@@ -52,7 +55,10 @@ const VISION_RE = new RegExp([// (Ollama tags it `qwen2.5vl`, not `qwen2.5-vl`), so the bounded `vl` rule// above misses them — match the qwen…vl form explicitly.'qwen[\\d.]*-?vl',- 'llava', 'bakllava', 'moondream', 'minicpm-?v', 'pixtral', 'gemma-?3',+ // Gemma 3 and 4 are multimodal. Anchor the family so `embeddinggemma-300m`+ // (which contains the literal `gemma-3`) isn't read as a vision model.+ '(?:^|[-_/:])gemma-?[34]',+ 'llava', 'bakllava', 'moondream', 'minicpm-?v', 'pixtral','smolvlm', 'internvl', 'cogvlm', 'glm-?4v', 'phi-?3\\.5?-vision','phi-?4-multimodal', 'got-ocr', 'idefics', 'fuyu', 'paligemma','kosmos', 'nanollava',@@ -115,9 +121,11 @@ export function isVisionModel(model) {// `tools` capability that is authoritative when present — this id regex is the// fallback for bare model-id strings (e.g. LM Studio, or a stored provider// `models` list). Matches the families with dependable function-calling support-// (Qwen 2.5/3, Llama 3.1+, Mistral/Mixtral, Cohere Command, Hermes, GLM-4,-// Granite 3, gpt-oss, Nemotron, function-calling-specialized models). Llama 3.0-// is deliberately NOT matched (tool use landed in 3.1).+// (Qwen 2.5/3+, Llama 3.1+, Mistral/Mixtral/Ministral, Cohere Command + North,+// Hermes, GLM-4, Granite 3/4, Gemma 4, gpt-oss, Nemotron, Olmo 3, LFM2, Ornith,+// Muse Glimmer, function-calling-specialized models). Llama 3.0 is deliberately+// NOT matched (tool use landed in 3.1); neither is Gemma 3 (tools landed in+// Gemma 4), so the gemma rule is anchored to the family AND the version.//// MIRRORED in client/src/utils/providers.js (isToolUseModel) and inlined in// server/lib/aiToolkit/providers.js (TOOL_USE_RE) — keep all three in lockstep.@@ -125,14 +133,17 @@ const TOOL_USE_RE = new RegExp(['qwen','llama-?3\\.[1-9]', 'llama-?4','mistral', 'mixtral', 'ministral', 'codestral', 'devstral', 'magistral',- 'command-?r', 'command-?a',- 'firefunction', 'functionary', 'watt-tool', 'hermes',+ 'command-?r', 'command-?a', 'north-mini-code',+ 'firefunction', 'functionary', 'watt-tool', 'hermes', 'functiongemma','glm-?4',- 'granite-?3',+ 'granite-?[34]',+ '(?:^|[-_/:])gemma-?4','gpt-oss','nemotron',+ 'olmo-?3',+ 'lfm2', 'ornith', 'muse-glimmer', 'nex-n2','smollm2',- 'deepseek-v3', 'deepseek-r1',+ 'deepseek-v3', 'deepseek-r1', 'deepseek-v4',].join('|'), 'i');/**@@ -165,21 +176,31 @@ export function isToolUseModel(model) {// notes and a `PANNEL` typo bleeding into a manuscript fix). Order is// "most-preferred first"; `command-r-plus` must precede `command-r`/`command`// so the longest substring match wins.+// Retired-but-installable families stay listed — this ranks whatever the user+// actually has on disk, not what the suggested-install catalog currently ships.const EDITORIAL_FAMILY_RANK = ['qwen', // Qwen — top-tier instruction-following + clean structured output+ 'muse-glimmer', // Meta's current open model — Llama's successor lineage'llama', // Llama 3.x instruct- 'gemma', // Gemma 2/3 instruct- 'mixtral', 'mistral', // Mistral family+ 'gemma', // Gemma 2/3/4 instruct+ 'glm', // GLM-4.x — strong prose, tight instruction-following+ 'mixtral', 'ministral', 'mistral', // Mistral family+ 'granite', // IBM Granite — constrained, clean structured output+ 'olmo', // AI2 Olmo — fully-open instruct'command-r-plus', 'command-r', 'command', // Cohere Command — capable but chatty/RAG-tuned+ 'nemotron', // NVIDIA — agentic/reasoning-tuned, chattier for prose'deepseek', // capable, leans code/math'phi', // smaller but capable'gpt-oss', // open-weights GPT];// Models we never recommend for editorial prose: embeddings, code-specialized,-// vision/multimodal, and media-generation weights that may be installed.+// vision-ONLY/multimodal, and media-generation weights that may be installed.+// Only vision-*specialist* markers belong here — general models that happen to+// read images (Gemma 4, Qwen3.5, Ministral 3) are excellent editors, so the+// `-VL` / `…V` / OCR suffixes are matched rather than a whole family.const NON_EDITORIAL_RE =- /(?:^|[-_/:])(?:embed|embedding|bge|nomic|mxbai|gte|e5)(?:[-_/:]|$)|text-embedding|coder|code-|starcoder|codellama|codegemma|(?:^|[-_/:])vision(?:[-_/:]|$)|llava|moondream|minicpm-v|whisper|(?:^|[-_/:])tts(?:[-_/:]|$)|stable-?diffusion|sdxl|flux/i;+ /(?:^|[-_/:])(?:embed|embedding|bge|nomic|mxbai|gte|e5)(?:[-_/:]|$)|text-embedding|embeddinggemma|coder|code-|starcoder|codellama|codegemma|(?:^|[-_/:])vision(?:[-_/:]|$)|(?:^|[-_/:])vl(?:\d|[-_/:.]|$)|qwen[\d.]*-?vl|glm-?[\d.]+v(?:[-_/:.]|$)|(?:^|[-_/:])ocr(?:[-_/:.]|$)|llava|moondream|minicpm-v|whisper|(?:^|[-_/:])tts(?:[-_/:]|$)|stable-?diffusion|sdxl|flux/i;/** Parse a parameter count in billions from a model's `params`/id (e.g. "35B"). */function parseParamsB(model) {diff --git a/server/lib/localModelHeuristics.test.js b/server/lib/localModelHeuristics.test.jsindex 402d971f8a..c6570a9c3b 100644--- a/server/lib/localModelHeuristics.test.js+++ b/server/lib/localModelHeuristics.test.js@@ -17,6 +17,19 @@ describe('localModelHeuristics', () => {'glm-4:9b','granite3-dense:8b','gpt-oss:20b',+ // Families added with the 2026-08 catalog refresh.+ 'granite4.1:8b',+ 'gemma4:12b',+ 'lmstudio-community/gemma-4-31B-it-GGUF',+ 'functiongemma:270m',+ 'ministral-3:8b',+ 'lfm2.5:8b',+ 'lfm2.5-thinking:1.2b',+ 'ornith:35b',+ 'muse-glimmer:30b',+ 'north-mini-code-1.0',+ 'olmo-3.1:32b-instruct',+ 'nemotron-3-nano:4b',]) {expect(isToolUseModel(id), id).toBe(true);}@@ -26,9 +39,13 @@ describe('localModelHeuristics', () => {for (const id of ['llama3:8b', // Llama 3.0 — tool use landed in 3.1'gemma2:9b',+ 'gemma3:4b', // Gemma 3 — tool use landed in Gemma 4'phi3:mini','orca-mini','nomic-embed-text',+ // Contains the literal `gemma`, but is an embedder — the anchored gemma+ // rule must not promote it into a tool-capable model.+ 'embeddinggemma:300m',]) {expect(isToolUseModel(id), id).toBe(false);}@@ -62,6 +79,10 @@ describe('localModelHeuristics', () => {'snowflake-arctic-embed:latest','text-embedding-3-small','gte-large',+ // Glues the `embedding` marker straight onto the family, so the anchored+ // marker alone misses it — it must never be offered for generation.+ 'embeddinggemma:300m',+ 'lmstudio-community/embeddinggemma-300m-qat-GGUF',]) {expect(isEmbeddingModel(id), id).toBe(true);}@@ -109,6 +130,9 @@ describe('localModelHeuristics', () => {'internvl2:8b','glm-4v:9b','paligemma',+ 'gemma4:31b',+ 'qwen3-vl:8b',+ 'minicpm-v4.6:1b',]) {expect(isVisionModel(id), id).toBe(true);}@@ -121,6 +145,9 @@ describe('localModelHeuristics', () => {'gpt-oss:20b','mistral-small:latest','nomic-embed-text:latest',+ // `embeddinggemma-300m` contains the literal `gemma-3`; the family rule+ // is anchored so an embedder isn't offered as a caption model.+ 'lmstudio-community/embeddinggemma-300m-qat-GGUF',]) {expect(isVisionModel(id), id).toBe(false);}@@ -192,6 +219,18 @@ describe('localModelHeuristics', () => {expect(rec?.id).toBe('gemma2:9b');});+ it('skips vision-specialist and OCR models but keeps general models that read images', () => {+ // Qwen3-VL / GLM-4.6V / *-ocr exist to describe pictures — never the best+ // pick for prose. Gemma 4 reads images too but is a general instruct model.+ const rec = recommendEditorialModel([+ { id: 'qwen3-vl:30b', params: '30B' },+ { id: 'glm-4.6v-flash', params: '30B' },+ { id: 'deepseek-ocr:3b', params: '3B' },+ { id: 'gemma4:31b', params: '31B' },+ ]);+ expect(rec?.id).toBe('gemma4:31b');+ });+it('accepts plain string ids', () => {const rec = recommendEditorialModel(['command-r-plus:latest', 'phi3:mini']);expect(rec?.id).toBe('command-r-plus:latest');diff --git a/server/routes/localLlm.test.js b/server/routes/localLlm.test.jsindex 46bfa0ca27..79d56544ef 100644--- a/server/routes/localLlm.test.js+++ b/server/routes/localLlm.test.js@@ -63,13 +63,13 @@ describe('local LLM playground routes', () => {// but getCatalog's normalizer can't parse `@quant` — so the overlay must get the// RAW ids, or an already-installed model wrongly shows Install. (Enrichment is// mocked to a no-op, simulating HF being unreachable.)- listModels.mockResolvedValue([{ id: 'lmstudio-community/Llama-3.2-3B-Instruct-GGUF', quantization: 'Q4_K_M' }]);+ listModels.mockResolvedValue([{ id: 'lmstudio-community/gemma-4-12B-it-GGUF', quantization: 'Q4_K_M' }]);const res = await request(makeApp()).get('/api/local-llm/catalog?backend=lmstudio&variants=1');expect(res.status).toBe(200);expect(enrichCatalogWithVariants).toHaveBeenCalled();- const entry = res.body.models.find((m) => m.id === 'lmstudio-community/Llama-3.2-3B-Instruct-GGUF');+ const entry = res.body.models.find((m) => m.id === 'lmstudio-community/gemma-4-12B-it-GGUF');expect(entry).toBeTruthy();expect(entry.installed).toBe(true);});diff --git a/server/services/localLlm.test.js b/server/services/localLlm.test.jsindex cce2666eb4..7970b9306c 100644--- a/server/services/localLlm.test.js+++ b/server/services/localLlm.test.js@@ -479,7 +479,11 @@ describe('localLlm', () => {it('detects a vision-capable Ollama model whose id lacks a vl/vision token via /api/show capabilities', async () => {mocks.ollama.getInstalledModels.mockResolvedValueOnce([{ id: 'qwen3.6:35b', name: 'qwen3.6:35b', family: 'qwen35moe' },- { id: 'gemma4:31b', name: 'gemma4:31b', family: 'gemma4' },+ // Text-only, and its id carries no vision marker — so it has to be+ // resolved through /api/show rather than the id heuristic. (Gemma 4 no+ // longer works as this fixture: every published build is multimodal, so+ // the id heuristic short-circuits before /api/show is consulted.)+ { id: 'granite4.1:8b', name: 'granite4.1:8b', family: 'granite' },]);mocks.ollama.getModelCapabilities.mockImplementation(async (id) =>id === 'qwen3.6:35b' ? ['completion', 'vision', 'tools'] : ['completion']);@@ -488,8 +492,8 @@ describe('localLlm', () => {expect(models).toEqual([{ providerId: 'ollama', backend: 'ollama', id: 'qwen3.6:35b', name: 'qwen3.6:35b', vision: true },]);- // The text-only gemma was excluded even though /api/show was consulted.- expect(mocks.ollama.getModelCapabilities).toHaveBeenCalledWith('gemma4:31b');+ // The text-only granite was excluded even though /api/show was consulted.+ expect(mocks.ollama.getModelCapabilities).toHaveBeenCalledWith('granite4.1:8b');});it('skips the /api/show round-trip when the id already matches the vision heuristic', async () => {diff --git a/server/services/voice/bootstrap.js b/server/services/voice/bootstrap.jsindex 546258cea0..5124ad95d9 100644--- a/server/services/voice/bootstrap.js+++ b/server/services/voice/bootstrap.js@@ -223,10 +223,10 @@ const DEFAULT_TOOL_MODEL_CHAIN = () => {const override = process.env.PORTOS_VOICE_DEFAULT_TOOL_MODEL;if (override) return [override];return [- 'lmstudio-community/Qwen3-4B-Instruct-2507-GGUF', // 4B, ~2.6 GB, current non-thinking Qwen3- 'lmstudio-community/Llama-3.2-3B-Instruct-GGUF', // 3B, ~2 GB, smaller fallback- 'lmstudio-community/Qwen2.5-7B-Instruct-GGUF', // 7B, ~4.7 GB, classic workhorse- 'lmstudio-community/Meta-Llama-3.1-8B-Instruct-GGUF', // 8B, ~4.7 GB, Llama fallback+ 'lmstudio-community/Qwen2.5-3B-Instruct-GGUF', // 3B, ~2 GB, no thinking phase at all+ 'lmstudio-community/functiongemma-270m-it-GGUF', // 270M, ~300 MB, function-calling specialist+ 'lmstudio-community/granite-4.1-8b-GGUF', // 8B, ~5.3 GB, tools without a thinking mode+ 'lmstudio-community/Ministral-3-8B-Instruct-2512-GGUF', // 8B, ~6 GB, Instruct (not the Reasoning build)];};