-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feat: add support for querying available backend devices #5877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
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.
There was a problem hiding this 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 in3
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 literalr"\\?\"
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 by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
src-tauri/src/core/utils/extensions/inference_llamacpp_extension/server.rs
Show resolved
Hide resolved
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
louis-menlo
approved these changes
Jul 23, 2025
Barecheck - Code coverage reportTotal: 36.95%Your code coverage diff: 0.01% ▴ ✅ All code changes are covered |
urmauur
approved these changes
Jul 23, 2025
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.
This change introduces a new
get_devices
method to thellamacpp_extension
engine that allows the frontend to query and display a list of available devices (e.g., Vulkan, CUDA, SYCL) from the compiledllama-server
binary.Added
DeviceList
interface to represent GPU/device metadata.Implemented
getDevices(): Promise<DeviceList[]>
method.version/backend
, ensures backend is ready.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
inlib.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.
getDevices()
method inindex.ts
to query available devices (Vulkan, CUDA, SYCL) fromllama-server
.get_devices
Tauri command inserver.rs
to parsellama-server --list-devices
output.DeviceList
interface inindex.ts
andDeviceInfo
struct inserver.rs
for device metadata.get_devices
command inlib.rs
.This description was created by
for 0b9354f. You can customize this summary. It will automatically update as commits are pushed.