You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
resolve_model_path() never checks the Tauri-bundled resources/models/ path, only ~/.nodespace/models/ #2781
Surfaced during #2771's investigation (Windows .msi shipping without the bundled embedding model — now fixed, CI downloads the model into resources/models/ before tauri build on all platforms).
Question
packages/daemon/src/services/assembly.rs's resolve_model_path() only ever checks ~/.nodespace/models/ — it never looks at the Tauri-bundled resources/models/ path that ships inside the installed app on both macOS and Windows. This raises a real architectural question that #2771 deliberately did NOT try to answer (out of scope for a release-blocking CI fix): does bundling the model into the installer actually enable anything at runtime today, on either platform, or is resources/models/ shipped-but-dead weight?
Options to consider
If the bundled model is meant to seed ~/.nodespace/models/ on first run (a local copy-on-first-launch), that step doesn't currently exist — resolve_model_path() would need to check the bundled path as a fallback, or an onboarding/first-run step would need to copy it into place.
If the bundled model is genuinely unused at runtime, bundling it is pure installer-size cost with no benefit, and it's worth deciding whether to stop bundling it at all (letting first-run download handle it instead) or wire up the fallback.
Non-goals
Not proposing a fix here — this needs a maintainer decision on intended behavior before any code changes.
Picking this up. New evidence from today's release smoke test: packages/daemon/src/services/assembly.rsresolve_model_path() resolves the model under the real $HOME/.nodespace/models even when NODESPACE_HOME points somewhere else. An isolated test home therefore still loads the real embedding model, which uses the GPU. That part is a plain bug and gets fixed first. The bundled resources/models/ question needs a design decision, so the docs will be written and agreed before any code.
Part B findings: the bundled model is never used at runtime
Short answer: no, on either platform. The macOS and Windows installers ship nomic-embed-text-v1.5.Q8_0.gguf (about 146 MB) in the app's resources/models/. Nothing reads that copy or copies it out, and nothing downloads the model either. On a fresh install the daemon finds no embedding model, so semantic search is off until someone puts the file in ~/.nodespace/models/ by hand.
This is traced through the code; I haven't observed it on a real install.
What happens today
CI puts the model in the bundle..github/workflows/release.yml:96-103 (macOS) and :336-346 (Windows) run gh release download models-v2 --pattern nomic-embed-text-v1.5.Q8_0.gguf into packages/desktop-app/src-tauri/resources/models/. Neither step checks a digest. The load-time check against the pinned SHA-256 (packages/nlp-engine/src/config.rs:69, ADR-058) is the only one.
Tauri bundles it.packages/desktop-app/src-tauri/tauri.conf.json:42-45 lists resources/models/**/*. With the standard Tauri layout it lands in NodeSpace.app/Contents/Resources/resources/models/ on macOS and next to the exe on Windows.
No app code reads it. The app resolves BaseDirectory::Resource only for resources/skill (packages/desktop-app/app-lib/src/skill_setup.rs:644, :816). The only mention of resources/models in app code is a doc comment (packages/desktop-app/app-lib/src/daemon_setup.rs:1258-1260).
No startup path tells the daemon where it is.
The app's launchd plist passes NODESPACED_SOCKET, NODESPACE_UI_BINARY and the profile's service_env (daemon_setup.rs:1446-1452).
The .pkg's plist runs /usr/local/bin/nodespaced --tray with no environment (scripts/pkg-resources/app.nodespace.daemon.plist:18-21).
On Windows the app spawns the daemon detached and adds only NODESPACE_UI_BINARY (daemon_setup.rs:2174-2193).
None of them sets NODESPACED_MODEL_PATH.
The daemon looks in one place.packages/daemon/src/services/assembly.rsresolve_model_path() uses NODESPACED_MODEL_PATH if set, otherwise <home>/.nodespace/models/nomic-embed-text-v1.5.Q8_0.gguf. After Part A, <home> follows NODESPACE_HOME. If the file is missing, the daemon logs NLP model not found — semantic search disabled and starts no load task.
No installer step copies it.
scripts/pkg-resources/postinstall does chmod and chown, creates the log directory, and runs launchctl bootstrap.
scripts/build-pkg.sh doesn't handle the model.
tauri.conf.json has no NSIS or WiX hooks.
Nothing downloads it.
The model catalog behind nodespace model and the app's model manager (packages/agent/src/local_agent/model_manager.rs:106, CATALOG) lists only the Gemma chat models.
Onboarding (packages/desktop-app/src/lib/components/onboarding/) has no embedding-model step.
scripts/download-models.ts is a dev script (bun run download:models).
The CLI-only Homebrew formula installs nodespaced with no app bundle, so it has no bundled copy to fall back on either.
So the macOS installer has carried about 146 MB that nothing reads, and #2771 added the same to the Windows installer. ADR-045 §2 assumes the reverse ("the installer/release path bundles and the daemons default to exactly nomic-embed-text-v1.5.Q8_0.gguf"), and no doc says where a shipped install's model is supposed to come from.
Options
1. The app copies the bundled model into the model directory at launch, when the file is missing or its digest is wrong. This would run where daemon_setup already copies the sidecars into ~/.nodespace/bin/ (extract_sidecar_if_changed, daemon_setup.rs:1080).
✅ The daemon keeps one lookup. Every way the daemon starts finds the model in the same place: the app's plist, the .pkg's plist, the Windows spawn, and a CLI-started daemon.
✅ The integrity check's cache file (<model>.verified.json, written next to the model: config.rs:150-175) lands in a user-writable directory.
❌ The model sits on disk twice, about 146 MB in the bundle and 146 MB in the home directory, and the first launch spends about a second copying.
❌ It only helps installs that include the app. A CLI-formula install still has no model.
❌ The copy has to resolve the home directory through NODESPACE_HOME the way the daemon does. Otherwise it brings back the bug Part A fixes.
2. The app passes the bundled path to the daemon, through NODESPACED_MODEL_PATH in the plist and the Windows spawn environment, or through a new, general "bundled resources" variable the daemon falls back to.
✅ One copy on disk, and no copy step.
❌ The .pkg's plist is static, so it needs the path too, and the path breaks if the app is moved.
❌ The integrity check writes <model>.verified.json next to the model, inside NodeSpace.app/Contents/Resources. That write either fails, so a root-owned .pkg install re-hashes 146 MB on every start, or it lands inside the signed bundle and breaks the code-signature seal. This option needs the cache moved somewhere else first.
❌ NODESPACED_MODEL_PATH is the override that testing and isolation use. Making it the production path mixes the two roles.
3. Stop bundling, and download on first run. Add the embedding model to the model catalog or to onboarding, pinned to the digest scripts/download-models.ts already uses.
✅ Both installers shrink by about 146 MB, the CLI-formula install gets a model too, and every install type uses one code path.
❌ The first run needs network, semantic search stays off until the download finishes, and onboarding needs progress UI for it.
4. Stop bundling, and document the manual step. This is today's behaviour without the unused weight.
✅ The smallest change.
❌ Semantic search stays off on every fresh install.
Recommendation (for the maintainer to decide): option 1 for installs that include the app. It keeps the daemon's single lookup and doesn't write into the signed bundle. Add option 3 if the CLI-only install should get semantic search. Whichever is chosen, it should be written up in nodespace-docs before any code: where a shipped install's model comes from, and an update to ADR-045 §2 to match.
Part B is going ahead with option 1: the desktop app copies its bundled model from resources/models/ into the NodeSpace home's models/ directory on launch, when no model is there. The copy is atomic, never overwrites an existing model, and doesn't block startup. The docs change comes first as a nodespace-docs PR, then the code. Part A (#3601) is merging now.
Activity
mstomar125 commentedon Oct 5, 2026
Picking this up. New evidence from today's release smoke test:
packages/daemon/src/services/assembly.rsresolve_model_path()resolves the model under the real$HOME/.nodespace/modelseven whenNODESPACE_HOMEpoints somewhere else. An isolated test home therefore still loads the real embedding model, which uses the GPU. That part is a plain bug and gets fixed first. The bundledresources/models/question needs a design decision, so the docs will be written and agreed before any code.🤖 Generated with Claude Code
mstomar125 commentedon Oct 5, 2026
Part B findings: the bundled model is never used at runtime
Short answer: no, on either platform. The macOS and Windows installers ship
nomic-embed-text-v1.5.Q8_0.gguf(about 146 MB) in the app'sresources/models/. Nothing reads that copy or copies it out, and nothing downloads the model either. On a fresh install the daemon finds no embedding model, so semantic search is off until someone puts the file in~/.nodespace/models/by hand.This is traced through the code; I haven't observed it on a real install.
What happens today
.github/workflows/release.yml:96-103(macOS) and:336-346(Windows) rungh release download models-v2 --pattern nomic-embed-text-v1.5.Q8_0.ggufintopackages/desktop-app/src-tauri/resources/models/. Neither step checks a digest. The load-time check against the pinned SHA-256 (packages/nlp-engine/src/config.rs:69, ADR-058) is the only one.packages/desktop-app/src-tauri/tauri.conf.json:42-45listsresources/models/**/*. With the standard Tauri layout it lands inNodeSpace.app/Contents/Resources/resources/models/on macOS and next to the exe on Windows.BaseDirectory::Resourceonly forresources/skill(packages/desktop-app/app-lib/src/skill_setup.rs:644,:816). The only mention ofresources/modelsin app code is a doc comment (packages/desktop-app/app-lib/src/daemon_setup.rs:1258-1260).NODESPACED_SOCKET,NODESPACE_UI_BINARYand the profile'sservice_env(daemon_setup.rs:1446-1452)./usr/local/bin/nodespaced --traywith no environment (scripts/pkg-resources/app.nodespace.daemon.plist:18-21).NODESPACE_UI_BINARY(daemon_setup.rs:2174-2193).NODESPACED_MODEL_PATH.packages/daemon/src/services/assembly.rsresolve_model_path()usesNODESPACED_MODEL_PATHif set, otherwise<home>/.nodespace/models/nomic-embed-text-v1.5.Q8_0.gguf. After Part A,<home>followsNODESPACE_HOME. If the file is missing, the daemon logsNLP model not found — semantic search disabledand starts no load task.scripts/pkg-resources/postinstalldoes chmod and chown, creates the log directory, and runslaunchctl bootstrap.scripts/build-pkg.shdoesn't handle the model.tauri.conf.jsonhas no NSIS or WiX hooks.nodespace modeland the app's model manager (packages/agent/src/local_agent/model_manager.rs:106,CATALOG) lists only the Gemma chat models.packages/desktop-app/src/lib/components/onboarding/) has no embedding-model step.scripts/download-models.tsis a dev script (bun run download:models).nodespacedwith no app bundle, so it has no bundled copy to fall back on either.So the macOS installer has carried about 146 MB that nothing reads, and #2771 added the same to the Windows installer. ADR-045 §2 assumes the reverse ("the installer/release path bundles and the daemons default to exactly
nomic-embed-text-v1.5.Q8_0.gguf"), and no doc says where a shipped install's model is supposed to come from.Options
1. The app copies the bundled model into the model directory at launch, when the file is missing or its digest is wrong. This would run where
daemon_setupalready copies the sidecars into~/.nodespace/bin/(extract_sidecar_if_changed,daemon_setup.rs:1080).<model>.verified.json, written next to the model:config.rs:150-175) lands in a user-writable directory.NODESPACE_HOMEthe way the daemon does. Otherwise it brings back the bug Part A fixes.2. The app passes the bundled path to the daemon, through
NODESPACED_MODEL_PATHin the plist and the Windows spawn environment, or through a new, general "bundled resources" variable the daemon falls back to.<model>.verified.jsonnext to the model, insideNodeSpace.app/Contents/Resources. That write either fails, so a root-owned .pkg install re-hashes 146 MB on every start, or it lands inside the signed bundle and breaks the code-signature seal. This option needs the cache moved somewhere else first.NODESPACED_MODEL_PATHis the override that testing and isolation use. Making it the production path mixes the two roles.3. Stop bundling, and download on first run. Add the embedding model to the model catalog or to onboarding, pinned to the digest
scripts/download-models.tsalready uses.4. Stop bundling, and document the manual step. This is today's behaviour without the unused weight.
Recommendation (for the maintainer to decide): option 1 for installs that include the app. It keeps the daemon's single lookup and doesn't write into the signed bundle. Add option 3 if the CLI-only install should get semantic search. Whichever is chosen, it should be written up in nodespace-docs before any code: where a shipped install's model comes from, and an update to ADR-045 §2 to match.
🤖 Generated with Claude Code
mstomar125 commentedon Oct 5, 2026
Part B is going ahead with option 1: the desktop app copies its bundled model from
resources/models/into the NodeSpace home'smodels/directory on launch, when no model is there. The copy is atomic, never overwrites an existing model, and doesn't block startup. The docs change comes first as a nodespace-docs PR, then the code. Part A (#3601) is merging now.🤖 Generated with Claude Code
Resolve the embedding model under NODESPACE_HOME
Resolve the embedding model under NODESPACE_HOME (#3601)