308 Commits

Author SHA1 Message Date
Louis
9b730058b4
feat: use hardware information api 2025-07-02 12:29:02 +07:00
Louis
d264220245
fix: restrict Windows-specific code to x86_64 and update scripts
Updated Rust code to apply Windows-specific logic only on x86_64 targets using #[cfg(all(windows, target_arch = "x86_64"))]. Modified dev:tauri script in package.json to remove CLEAN=true and added CLEAN=true to beforeDevCommand in tauri.conf.json for consistency. Minor formatting changes in tauri.conf.json.
2025-07-02 12:29:02 +07:00
Akarshan
ad06b2a903
Move llama-server cleanup code to a separate file 2025-07-02 12:27:42 +07:00
Akarshan
7de694c0cd
add missing import during rebase 2025-07-02 12:27:42 +07:00
Akarshan
62ba503b86
chore: cleanup llama-server processes upon app exit 2025-07-02 12:27:42 +07:00
Akarshan
01d49a4b28
fix: Update server process handling for Windows and Unix systems 2025-07-02 12:27:42 +07:00
Akarshan
2eeabf8ae6
fix: ensure server process is properly terminated and reaped 2025-07-02 12:27:35 +07:00
Akarshan
4ffc504150
style: Rename camelCase to snake_case in llamacpp extension code
Rename variable, struct, and enum names from camelCase to snake_case throughout the llamacpp extension codebase to align with Rust naming conventions. This change improves readability and consistency without altering functionality.
2025-07-02 12:27:34 +07:00
Akarshan
6c769c5db9
feat: refactor llama server process storage to use HashMap
Change the llama_server_process state from an Option<Child> to a HashMap<String, Child> to support managing multiple server instances by PID. This allows precise process tracking and termination, replacing the previous single-process limitation.

Previously, only one server process could be tracked at a time. Now, each process is stored with its PID as the key, enabling:
- Accurate session matching during unloading
- Proper termination of specific processes
- Better error handling for mismatched PIDs

The load_llama_model function now inserts processes into the map, and unload_llama_model removes them by PID.
2025-07-02 12:27:34 +07:00
Thien Tran
8bf4a5eb7d
remove migration 2025-07-02 12:27:34 +07:00
Thien Tran
ae349159ce
remove yarn install:cortex 2025-07-02 12:27:33 +07:00
Thien Tran
95944fa081
add Jan's library path to path 2025-07-02 12:27:17 +07:00
Thien Tran
1eb49350e9
add is_library_available command 2025-07-02 12:27:17 +07:00
Akarshan Biswas
4dfdcd68d5
refactor: rename session identifiers to pid and modelId
The changes standardize identifier names across the codebase for clarity:
- Replaced `sessionId` with `pid` to reflect process ID usage
- Changed `modelName` to `modelId` for consistency with identifier naming
- Renamed `api_key` to `apiKey` for camelCase consistency
- Updated corresponding methods to use these new identifiers
- Improved type safety and readability by aligning variable names with their semantic meaning
2025-07-02 12:27:16 +07:00
Akarshan Biswas
f9d3935269
feat: allow specifying port via command line argument
This change allows the port to be specified via command line arguments, providing flexibility. The port is parsed from the arguments, defaulting to 8080 if not provided.
2025-07-02 12:27:16 +07:00
Akarshan Biswas
5d61062b0e
feat: enhance argument parsing and add API key generation
The changes improve the robustness of command-line argument parsing in the Llama model server by replacing direct index access with safe iteration methods. A new generate_api_key function was added to handle API key generation securely. The sessionId parameter was standardized to match the renamed property in the client code.
2025-07-02 12:27:15 +07:00
Thien Tran
1ae7c0b59a
update version/backend format. fix bugs around load() 2025-07-02 12:27:15 +07:00
Akarshan Biswas
fd9e034461
feat: update AIEngine load method and backend path handling
- Changed load method to accept modelId instead of loadOptions for better clarity and simplicity
- Renamed engineBasePath parameter to backendPath for consistency with the backend's directory structure
- Added getRandomPort method to ensure unique ports for each session to prevent conflicts
- Refactored configuration and model loading logic to improve maintainability and reduce redundancy
2025-07-02 12:27:15 +07:00
Thien Tran
40cd7e962a
feat: download backend for llama.cpp extension (#5123)
* wip

* update

* add download logic

* add decompress. support delete file

* download backend upon selecting setting

* add some logging and nootes

* add note on race condition

* remove then catch

* default to none backend. only download if it's not installed

* merge version and backend. fetch version from GH

* restrict scope of output_dir

* add note on unpack
2025-07-02 12:27:13 +07:00
Akarshan Biswas
da23673a44
feat: Add API key generation for Llama.cpp
This commit introduces API key generation for the Llama.cpp extension.  The API key is now generated on the server side using HMAC-SHA256 and a secret key to ensure security and uniqueness.  The frontend now passes the model ID and API secret to the server to generate the key. This addresses the requirement for secure model access and authorization.
2025-07-02 12:27:12 +07:00
Thien Tran
39bb3f34d6
patch failing calls to cortex 2025-07-02 12:27:12 +07:00
Akarshan Biswas
31971e7821
(WIP)randomly generate api-key hash each session 2025-07-02 12:27:12 +07:00
Thien Tran
5803fcdb99
add read_yaml. use buffered reader/writer 2025-07-02 12:27:11 +07:00
Thien Tran
d01cbe44ae
use PathBuf to check exists() 2025-07-02 12:27:11 +07:00
Akarshan Biswas
c5a0ee7f6e
refactor unload and implement a destructor to clean up sessions 2025-07-02 12:27:10 +07:00
Thien Tran
ded9ae733a
feat: Model import (download + local import) for llama.cpp extension (#5087)
* add pull and abortPull

* add model import (download only)

* write model.yaml. support local model import

* remove cortex-related command

* add TODO

* remove cortex-related command
2025-07-02 12:27:09 +07:00
Akarshan Biswas
a7a2dcc8d8
refactor load/unload again; move types to core and refactor AIEngine abstract class 2025-07-02 12:27:09 +07:00
Akarshan Biswas
bbbf4779df
refactor load/unload 2025-07-02 12:27:08 +07:00
Akarshan Biswas
b4670b5526
remove cortex engine dirs 2025-07-02 12:27:08 +07:00
Akarshan Biswas
47881db696
remove cortex from tauri.conf.json 2025-07-02 12:27:08 +07:00
Akarshan Biswas
021f8ae80f
Fixup: llama-server load 2025-07-02 12:27:08 +07:00
Akarshan Biswas
ed6f86d4b1
Change scripts to download only llama.cpp engine 2025-07-02 12:27:07 +07:00
Akarshan Biswas
a8abc9f9aa
Resolved conflicts by keeping HEAD changes 2025-07-02 12:27:07 +07:00
Thien Tran
15f0b11c0d
make it compile 2025-07-02 12:26:38 +07:00
Akarshan Biswas
0551b0bfd2
Fix import 2025-07-02 12:26:38 +07:00
Akarshan Biswas
f5b5596306
add thiserror to Cargo.toml 2025-07-02 12:26:38 +07:00
Akarshan Biswas
5c9e8dce76
Add spaces before EOF 2025-07-02 12:26:38 +07:00
Akarshan Biswas
9016fbff68
feat: inference-llamacpp-extension: backend implementation 2025-07-02 12:26:37 +07:00
Faisal Amir
2a0597ff01
Merge branch 'dev' into release/v0.6.6 2025-07-02 10:26:32 +07:00
Louis
834bc39242
test: init e2e test with selenium and CI work (#5591)
* test: init e2e test

* Update yarn.lock
2025-06-29 17:12:16 +07:00
Nguyen Ngoc Minh
472ef88bdc
chore: flexible installation path windows installer (#5573) 2025-06-27 23:21:28 +07:00
Faisal Amir
9bbf9a590c
enhancement: support base layout responsive UI (#5472)
* enhancement: support base layout responsive UI

* Update web-app/src/containers/LeftPanel.tsx

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

* Update web-app/src/containers/ThreadList.tsx

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

* enhancement: responsive assistant screen (#5502)

* enhancement: support base layout responsive UI

* Update web-app/src/containers/LeftPanel.tsx

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

* Update web-app/src/containers/ThreadList.tsx

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

* enhancement: responsive assistant screen

* Update web-app/src/containers/dialogs/AddEditAssistant.tsx

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

* enhancement: sort assistant

* Update web-app/src/routes/assistant.tsx

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

---------

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

* enhancement: responsive hub screen (#5507)

* enhancement: support base layout responsive UI

* Update web-app/src/containers/LeftPanel.tsx

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

* Update web-app/src/containers/ThreadList.tsx

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

* enhancement: responsive assistant screen

* Update web-app/src/containers/dialogs/AddEditAssistant.tsx

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

* enhancement: sort assistant

* Update web-app/src/routes/assistant.tsx

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

* enhancement: responsive hub screen

* 🧹cleanup: multiple key and useless for hub translation

---------

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

---------

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
2025-06-26 15:01:50 +07:00
Sam Hoang Van
64a7822cc8
Feat: auto restart mcp (#5226)
* feat: implement retry mechanism for MCP server activation with exponential backoff

feat: enhance MCP server activation with configurable retry attempts

feat: implement MCP server restart monitoring and cleanup functionality

feat: enhance MCP server restart logic with improved monitoring and configuration handling

feat: add manual deactivation for MCP servers to prevent automatic restarts

* feat: enhance MCP server startup with initial attempt tracking and health monitoring
2025-06-23 12:20:05 +07:00
Louis
22396111be
fix: stop api server on page unload (#5356)
* fix: stop api server on page unload

* fix: check api server status on reload

* refactor: api server state

* fix: should not pop the guard
2025-06-19 00:12:03 +07:00
Bui Quang Huy
f5971b9d03
🔀 Merge: pull request #5351 from menloresearch/fix/window-path-fix
🐛 Fix: window path name with a space lead to cannot find correct path to Jan datafolder
2025-06-18 17:17:53 +07:00
Sam Hoang Van
eb5655bbd4
fix(proxy): implement true HTTP streaming for chat completions API (#5350) 2025-06-18 16:19:48 +07:00
Sam Hoang Van
6cee466f52
fix(server): add gzip decompression support for /models endpoint filtering (#5349)
- Add gzip detection using magic number check (0x1f 0x8b)
- Implement gzip decompression before JSON parsing
- Add gzip re-compression for filtered responses
- Fix "invalid utf-8 sequence" error when upstream returns gzipped content
- Maintain Content-Encoding consistency for compressed responses
- Add comprehensive gzip handling with flate2 library

Resolves issue where filtering failed on gzip-compressed model responses.
2025-06-18 15:30:31 +07:00
Sam Hoang Van
369ba5ac75
feat(server): filter /models endpoint to show only downloaded models (#5343)
- Add filtering logic to proxy server for GET /models requests
- Keep only models with status "downloaded" in response
- Remove Content-Length header to prevent mismatch after filtering
- Support both ListModelsResponseDto and direct array formats
- Add comprehensive tests for filtering functionality
- Fix Content-Length header conflict causing empty responses

Fixes issue where all models were returned regardless of download status.
2025-06-18 14:11:53 +07:00
LazyYuuki
a075debb05 🐛 fix: window path problem 2025-06-18 14:02:36 +08:00
Nguyen Ngoc Minh
3f07358125
🐛 fix(updater): terminate sidecar processes before update to avoid file access errors (#5325) 2025-06-17 23:43:15 +07:00