Skip to content

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

address review (copilot): lms -y flag, dequote setup env parse, preserve ollama tags, top-level import

Adam Eivy211c47b85aef
diff --git a/scripts/setup-llm.js b/scripts/setup-llm.js
index 612e64c261..9dc232d7d6 100644
--- a/scripts/setup-llm.js
+++ b/scripts/setup-llm.js
@@ -32,7 +32,11 @@ function parseEnvFile() {
if (!trimmed || trimmed.startsWith('#')) continue;
const idx = trimmed.indexOf('=');
if (idx === -1) continue;
- result[trimmed.slice(0, idx).trim()] = trimmed.slice(idx + 1).trim();
+ let value = trimmed.slice(idx + 1).trim();
+ if ((value.startsWith('"') && value.endsWith('"')) || (value.startsWith("'") && value.endsWith("'"))) {
+ value = value.slice(1, -1);
+ }
+ result[trimmed.slice(0, idx).trim()] = value;
}
return result;
}
diff --git a/server/index.js b/server/index.js
index f5c9dd6534..16f570d258 100644
--- a/server/index.js
+++ b/server/index.js
@@ -69,6 +69,7 @@ import autobiographyRoutes from './routes/autobiography.js';
import backupRoutes from './routes/backup.js';
import databaseRoutes from './routes/database.js';
import localLlmRoutes from './routes/localLlm.js';
+import { ensureBackendProvider, getBackend as getLocalLlmBackend } from './services/localLlm.js';
import searchRoutes from './routes/search.js';
import paletteRoutes from './routes/palette.js';
import dashboardLayoutsRoutes from './routes/dashboardLayouts.js';
@@ -273,7 +274,6 @@ try {
// Ensure the provider paired with the active local-LLM backend (LLM_BACKEND in
// .env, chosen at setup time) is enabled, so a fresh install can use Ollama /
// LM Studio for runs without hand-toggling it in the Providers UI.
-import { ensureBackendProvider, getBackend as getLocalLlmBackend } from './services/localLlm.js';
ensureBackendProvider(getLocalLlmBackend()).catch((err) =>
console.error(`⚠️ Failed to enable local LLM backend provider: ${err.message}`));
diff --git a/server/lib/localLlmCatalog.js b/server/lib/localLlmCatalog.js
index 9a2f664d1f..f4c5b35f73 100644
--- a/server/lib/localLlmCatalog.js
+++ b/server/lib/localLlmCatalog.js
@@ -168,8 +168,11 @@ export const LOCAL_LLM_CATALOG = [
}
];
-// Strip an Ollama tag suffix (`llama3.2:latest` → `llama3.2`) and lowercase.
-const normalizeOllamaId = (id) => String(id || '').split(':')[0].trim().toLowerCase();
+// Strip only the implicit `:latest` tag (`llama3.2:latest` → `llama3.2`) and
+// lowercase. Meaningful tags (`gpt-oss:20b`, `qwen2.5:7b`) are preserved so a
+// `7b` build can't normalize onto — and be mistaken for — a `20b` catalog entry.
+const normalizeOllamaId = (id) =>
+ String(id || '').trim().toLowerCase().replace(/:latest$/, '');
// Reduce an LM Studio / HuggingFace id to a comparable stem:
// `lmstudio-community/Llama-3.2-3B-Instruct-GGUF` → `llama-3.2-3b-instruct`.
diff --git a/server/services/localLlm.js b/server/services/localLlm.js
index 9cea4aa6da..fcd3a7d944 100644
--- a/server/services/localLlm.js
+++ b/server/services/localLlm.js
@@ -160,7 +160,7 @@ export async function installModel(backend, modelId, onProgress) {
}
// LM Studio: prefer the `lms` CLI (real download), fall back to the REST hook.
if (await commandExists('lms', ['version'])) {
- const r = await execFileAsync('lms', ['get', modelId, '--yes'], { timeout: 0 })
+ const r = await execFileAsync('lms', ['get', '-y', modelId], { timeout: 0 })
.then(() => ({ ok: true })).catch((err) => ({ _err: err.stderr || err.message }))
if (r._err) return { success: false, error: r._err, modelId }
lmStudioManager.resetCache()
@@ -179,7 +179,7 @@ export async function deleteModel(backend, modelId) {
}
// LM Studio has no delete in its REST API — use the `lms` CLI if present.
if (await commandExists('lms', ['version'])) {
- const r = await execFileAsync('lms', ['rm', modelId, '--yes'], { timeout: 30_000 })
+ const r = await execFileAsync('lms', ['rm', modelId, '-y'], { timeout: 30_000 })
.then(() => ({ ok: true })).catch((err) => ({ _err: err.stderr || err.message }))
if (r._err) return { success: false, error: r._err, modelId }
lmStudioManager.resetCache()