feat(ai): add hardware selection - #217
Merged
Merged
Conversation
📝 WalkthroughWalkthroughThe PR adds persisted AI compute-device selection for automatic, CPU, or explicit devices. It discovers available accelerators, applies selections to sidecar launches, includes hardware in benchmark fingerprints, and switches Windows llama.cpp packaging to Vulkan. ChangesGPU compute-device selection
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant AISettings
participant computeDevice
participant engine_info
participant llama_server
AISettings->>computeDevice: hydrate selected device
computeDevice-->>AISettings: cached or persisted selection
AISettings->>engine_info: request engine information
engine_info->>llama_server: invoke --list-devices
llama_server-->>engine_info: device output
engine_info-->>AISettings: devices and device_error
AISettings->>computeDevice: persist changed selection
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed and why
Adds an explicit Settings → AI hardware selector for Automatic, CPU, and each accelerator reported by the local llama.cpp engine, closing #211. The selection is persisted locally, applied to both live inference and benchmarks, and preserved across sidecar crash respawns. Windows now ships the pinned b9095 Vulkan engine so NVIDIA, AMD, Intel, and external GPUs use one cross-vendor backend; CPU remains an explicit
--device nonefallback. Benchmark fingerprints include the hardware choice so CPU timings are never reused after switching to a GPU/eGPU. The managed-engine package identity is also revisioned so a pre-#211 CPU-only Windows cache cannot be reused as a recovery fallback. Hardware discovery is bounded, cached for the app process, and invalidated after engine reinstall so a wedged GPU driver cannot hang Settings or cause repeated probe processes.Manual test
This connector environment does not expose the repository's Windows desktop-control MCP, so I did not claim a machine-walked UI smoke test. The changed settings surface is covered by the existing Storybook build/a11y gate and the native paths are compiled/tested on the repository's macOS, Linux, and Windows CI runners.
npm run tauri devlaunched and the changed surface behaves as described — not run in this environmentCompatibility surfaces
src-tauri/src/db/migrations/— untouchedai-hardware.json/selection; missing or invalid data defaults toauto, so existing installs remain validGates
GitHub Actions is the authoritative execution environment for this PR. Final head
3bb7ffcpassed the complete pre-merge matrix, CodeQL, and preview installer builds for both macOS and Windows.npm run build && npm run lint && npm run testnpm run check-tokens && npm run check-strings && npm run check-contrastnpm run check-migrations && npm run check-storiesnpm run build-storybook && npm run check-a11ycd src-tauri && cargo fmt --check && cargo clippy && cargo test— macOS, Linux, and Windowscd src-tauri && cargo deny check— supply chainCI-only checks also passed: workflow lint, dependency review, typos, version lockstep, PR title, CodeQL, the aggregate pre-merge gate, and macOS/Windows preview installer builds.
Merge style
Summary by CodeRabbit