Skip to content

Conversation

qnixsynapse
Copy link
Contributor

Describe Your Changes

This commit introduces significant improvements to the llama.cpp extension, focusing on the 'Flash Attention' setting and refactoring Tauri plugin interactions for better code clarity and maintenance.

The backend interaction is streamlined by removing the unnecessary libraryPath argument from the Tauri plugin commands for loading models and listing devices.

  • Simplified API Calls: The loadLlamaModel, unloadLlamaModel, and get_devices functions in both the extension and the Tauri plugin now manage the library path internally based on the backend executable's location.

  • Decoupled Logic: The extension (src/index.ts) now uses the new, simplified Tauri plugin functions, which enhances modularity and reduces boilerplate code in the extension.

  • Type Consistency: Added UnloadResult interface to guest-js/index.ts for consistency.

  • Updated UI Control: The 'Flash Attention' setting in settings.json is changed from a boolean checkbox to a string-based dropdown, offering 'auto', 'on', and 'off' options.

  • Improved Logic: The extension logic in src/index.ts is updated to correctly handle the new string-based flash_attn configuration. It now passes the string value ('auto', 'on', or 'off') directly as a command-line argument to the llama.cpp backend, simplifying the version-checking logic previously required for older llama.cpp versions. The old, complex logic tied to specific backend versions is removed.

This refactoring cleans up the extension's codebase and moves environment and path setup concerns into the Tauri plugin where they are most relevant.

Fixes Issues

  • Closes #
  • Closes #

Self Checklist

  • Added relevant comments, esp in complex areas
  • Updated docs (for bug fixes / features)
  • Created issues for follow-up changes or refactoring needed

…etting

This commit introduces significant improvements to the llama.cpp extension, focusing on the 'Flash Attention' setting and refactoring Tauri plugin interactions for better code clarity and maintenance.

The backend interaction is streamlined by removing the unnecessary `libraryPath` argument from the Tauri plugin commands for loading models and listing devices.

* **Simplified API Calls:** The `loadLlamaModel`, `unloadLlamaModel`, and `get_devices` functions in both the extension and the Tauri plugin now manage the library path internally based on the backend executable's location.
* **Decoupled Logic:** The extension (`src/index.ts`) now uses the new, simplified Tauri plugin functions, which enhances modularity and reduces boilerplate code in the extension.
* **Type Consistency:** Added `UnloadResult` interface to `guest-js/index.ts` for consistency.

* **Updated UI Control:** The 'Flash Attention' setting in `settings.json` is changed from a boolean checkbox to a string-based dropdown, offering **'auto'**, **'on'**, and **'off'** options.
* **Improved Logic:** The extension logic in `src/index.ts` is updated to correctly handle the new string-based `flash_attn` configuration. It now passes the string value (`'auto'`, `'on'`, or `'off'`) directly as a command-line argument to the llama.cpp backend, simplifying the version-checking logic previously required for older llama.cpp versions. The old, complex logic tied to specific backend versions is removed.

This refactoring cleans up the extension's codebase and moves environment and path setup concerns into the Tauri plugin where they are most relevant.
Copy link
Contributor

Barecheck - Code coverage report

Total: 30.43%

Your code coverage diff: 0.00% ▴

✅ All code changes are covered

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

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant