Skip to content

Conversation

qnixsynapse
Copy link
Contributor

@qnixsynapse qnixsynapse commented Jul 23, 2025

This change introduces a new get_devices method to the llamacpp_extension engine that allows the frontend to query and display a list of available devices (e.g., Vulkan, CUDA, SYCL) from the compiled llama-server binary.

  • Added DeviceList interface to represent GPU/device metadata.

  • Implemented getDevices(): Promise<DeviceList[]> method.

    • Splits version/backend, ensures backend is ready.
    • Invokes the new Tauri command get_devices.
  • Introduced a new get_devices Tauri command.

  • Parses llama-server --list-devices output to extract available devices with memory info.

  • Introduced DeviceInfo struct (id, name, mem, free) and exposed it via serialization.

  • Robust parsing logic using string processing (non-regex) to locate memory stats.

  • Registered the new command in the tauri::Builder in lib.rs.

  • Fixed logic to correctly parse multiple devices from the llama-server output.

  • Handles common failure modes: binary not found, malformed memory info, etc.

This sets the foundation for device selection, memory-aware model loading, and improved diagnostics in Jan AI engine setup flows.


Important

Adds support for querying available backend devices in llamacpp extension via new Tauri command and parsing logic.

  • Behavior:
    • Adds getDevices() method in index.ts to query available devices (Vulkan, CUDA, SYCL) from llama-server.
    • Introduces get_devices Tauri command in server.rs to parse llama-server --list-devices output.
    • Handles errors like binary not found and malformed memory info.
  • Models:
    • Adds DeviceList interface in index.ts and DeviceInfo struct in server.rs for device metadata.
  • Misc:
    • Registers get_devices command in lib.rs.

This description was created by Ellipsis for 0b9354f. You can customize this summary. It will automatically update as commits are pushed.

This change introduces a new `get_devices` method to the `llamacpp_extension` engine that allows the frontend to query and display a list of available devices (e.g., Vulkan, CUDA, SYCL) from the compiled `llama-server` binary.

* Added `DeviceList` interface to represent GPU/device metadata.
* Implemented `getDevices(): Promise<DeviceList[]>` method.

  * Splits `version/backend`, ensures backend is ready.
  * Invokes the new Tauri command `get_devices`.

* Introduced a new `get_devices` Tauri command.
* Parses `llama-server --list-devices` output to extract available devices with memory info.
* Introduced `DeviceInfo` struct (`id`, `name`, `mem`, `free`) and exposed it via serialization.
* Robust parsing logic using string processing (non-regex) to locate memory stats.
* Registered the new command in the `tauri::Builder` in `lib.rs`.

* Fixed logic to correctly parse multiple devices from the llama-server output.
* Handles common failure modes: binary not found, malformed memory info, etc.

This sets the foundation for device selection, memory-aware model loading, and improved diagnostics in Jan AI engine setup flows.
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed everything up to 0b9354f in 2 minutes and 31 seconds. Click for details.
  • Reviewed 342 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. src-tauri/src/core/utils/extensions/inference_llamacpp_extension/server.rs:148
  • Draft comment:
    The Windows branch uses a raw string literal in trim_start_matches (e.g. r"\?") which may not compile as expected (raw strings cannot end with a backslash). Consider using an escaped standard string (e.g. "\\?\") or an alternative approach.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
2. src-tauri/src/core/utils/extensions/inference_llamacpp_extension/server.rs:414
  • Draft comment:
    Typographical issue: The raw string literal r"\\?\" appears to be incorrectly terminated. In Rust, a raw string that contains a quote needs to use a different delimiter (e.g., r#"\\?\"#) or proper escaping. Please review and correct this to ensure the intended UNC prefix is properly trimmed.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.

Workflow ID: wflow_oHv2xuCgSimu3Y0L

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Copy link
Contributor

github-actions bot commented Jul 23, 2025

Barecheck - Code coverage report

Total: 36.95%

Your code coverage diff: 0.01% ▴

✅ All code changes are covered

@qnixsynapse qnixsynapse merged commit 1d0bb53 into release/v0.6.6 Jul 23, 2025
28 of 32 checks passed
@qnixsynapse qnixsynapse deleted the feat/get_devices_list branch July 23, 2025 13:50
@github-project-automation github-project-automation bot moved this to QA in Jan Jul 23, 2025
@github-actions github-actions bot added this to the v0.6.6 milestone Jul 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

idea: Add llamacpp extension function to get list of devices
3 participants