Skip to content

feat(settings): add opt-in local model setup and lifecycle - #107

Open
nonamexishere wants to merge 6 commits into
McanKul:epic/local-ai-runtimefrom
nonamexishere:feat/84-model-setup-ui
Open

nonamexishere wants to merge 6 commits into
McanKul:epic/local-ai-runtimefrom
nonamexishere:feat/84-model-setup-ui

Conversation

@nonamexishere

Copy link
Copy Markdown
Contributor

Summary

Adds a Local model section on Settings: import a file from this computer (preview size, license, location, hardware-check stub, then confirm), then load / unload / cancel / remove. Import copies into the #83 store. Load uses the pathless #81 Fake. Restart keeps the file on disk and starts Unloaded. No HTTP, no catalog, no auto-download, no chat/Test button.

Fixes #84.

Stacked on #106 (feat/83-model-store). This branch includes those store commits until #106 merges.

Why

Parent #76 needs an opt-in Settings flow before a real runtime or assistant can ask anyone to load weights. Compatibility is a stub until #82.

Validation

  • cargo test --manifest-path src-tauri/Cargo.toml --lib lifecycle_ (8 passed)
  • npx vitest run src/features/settings/modelSetupView.test.ts
  • npm test / npm run typecheck / cargo test --lib
  • Manual tauri:dev: Import any file (no extension filter), facts then confirm, Load/Unload, restart stays listed + Unloaded, Remove reports freed bytes, PDF tools work with no model

Privacy Checklist

  • This keeps OffPDF usable offline.
  • This does not upload, log, or transmit user files.
  • New dependencies or bundled binaries have compatible licenses. (none added)

Content-addressed blobs under an injected root. SHA-256 must match
before a model is ready. Interrupted staging and truncated files stay
unlistable. Duplicate imports reuse one blob. No HTTP, no auto-download,
no Tauri commands.
Rename-over the dest manifest instead of deleting it first. The no-GGUF
walk ignores gitignored bundle trees so local prepare scripts do not fail cargo test.
Settings can import a local file after a preview of size, license,
location, and a hardware-check stub. Load, unload, cancel, and remove
use the Fake backend and the McanKul#83 store. No HTTP, no auto-download, no
chat. The file picker has no extension filter so any file can be chosen.
Use the preview DTO compatibility string once. After preview, choose a
different file or Cancel to dismiss. A checksum mismatch drops the stale
hash. Trim Fake-era comments on ai_cancel and ai_generate.
…ancel

Settings Cancel no longer latches Fake cancel. open() removes leftover
staging/install-* dirs. Dest manifests replace via a sibling tmp file.
list_ready uses size only; import_file preflights disk space.
…hing

Sweep only leftover install-* dirs from other pids. Remove reads
recorded size from the dest manifest (or blob metadata), not a full
SHA-256 get.

@McanKul McanKul left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the work here. The setup UI should not present an imported file as a loaded, ready model while it is still backed by the Fake runtime and hardware compatibility is unavailable. Please keep the user-facing section hidden or clearly disabled until the real runtime and compatibility check are connected; the underlying lifecycle/store scaffolding can remain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants