243 Commits

Author SHA1 Message Date
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
Faisal Amir
11d767633e
🐛fix: allow script posthog (#5316) 2025-06-17 18:35:02 +07:00
Louis
1e17cc6ec7
enhancement: model run improvement (#5268)
* fix: mcp tool error handling

* fix: error message

* fix: trigger download from recommend model

* fix: can't scroll hub

* fix: show progress

* enhancement: prompt users to increase context size

* enhancement: rearrange action buttons for a better UX

* 🔧chore: clean up logics

---------

Co-authored-by: Faisal Amir <urmauur@gmail.com>
2025-06-14 16:32:15 +07:00
Faisal Amir
2b8c448be4
chore: enable shortcut zoom (#5261)
* chore: enable shortcut zoom

* chore: update shortcut setting
2025-06-13 11:37:34 +07:00
Louis
27c4918395
fix: default settings should leave empty (#5257)
* fix: default settings should leave empty

* fix: default settings

* fix: remove some more default settings

* fix: threads and cont

* fix: data

* fix: default setting

* fix: settings

* chore: bump cortex version

* chore: bump to cortex 1.0.14

* chore: clean up

* typoe

* chore: fix dialog hang

* fix: default parameter

* chore: truncate edit model title

* chore: update default provider settings

* chore: fix typo

---------

Co-authored-by: Faisal Amir <urmauur@gmail.com>
2025-06-13 00:01:25 +07:00
Sam Hoang Van
e22452b26e
fix: add cortex_killed_intentionally state to manage sidecar process termination (#5255)
* fix: add cortex_killed_intentionally state to manage sidecar process termination

* fix: improve handling of intentionally killed sidecar process
2025-06-12 19:20:27 +07:00
Faisal Amir
7b59aa32f9
chore: onboarding local model (#5234)
* chore: simple onboarding local model

* chore: update new model and improve flow e2e onboarding local model

* fix: default tool support models

---------

Co-authored-by: Louis <louis@jan.ai>
2025-06-11 18:38:07 +07:00
sam hoang
6f030f720a
feat(local-api-server): add button to open API documentation and improve layout 2025-06-11 11:46:04 +07:00
Sam Hoang Van
eef37defb4
fix(server): enhance CORS handling for local API network access (#5236)
* fix(server): enhance CORS handling for local API network access

- Fix CORS preflight validation to use Host header for target validation
- Use Origin header correctly for CORS response headers
- Improve host validation to support both host:port and host-only formats
- Filter upstream CORS headers to prevent duplicate Access-Control-Allow-Origin
- Add CORS headers to all error responses for consistent behavior
- Fix host matching logic to handle trusted hosts with and without ports
- Ensure single Access-Control-Allow-Origin header per response

This resolves CORS preflight failures that were blocking cross-origin
requests to the local API server, enabling proper network access from
web applications and external tools.

Fixes: OPTIONS requests being rejected due to incorrect host validation
Resolves: "access control allow origin cannot contain more than one origin" error

* fix(proxy): bypass host and authorization checks for root path in CORS preflight

* fix(proxy): bypass host and authorization checks for whitelisted paths
2025-06-11 09:44:17 +07:00
Louis
92a52dfa08
fix: tauri path env (#5233) 2025-06-10 18:31:21 +07:00
Louis
891c149f1b
fix: MCP server should not spawn shell window (#5223)
* fix: MCP server should not spawn shell window

* Update src-tauri/src/core/mcp.rs

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-09 23:23:34 +07:00
Louis
6d6790d5e0
fix: clean up cortex processes (#5215)
* fix: clean up cortex processes

* chore: clean up

* chore: does not need output shell
2025-06-09 22:23:07 +07:00
Louis
919b6671a1
enahancement: mcp server activation response and error handling (#5220)
* fix: mcp server error handling

* fix: custom installation path of MCP package managers

* chore: clean up

* chore: clean up

* chore: append mcp server errors to app logs

* fix: logs reading

* chore: typo
2025-06-09 19:43:16 +07:00
Louis
c444643294
fix: path resolver in windows (#5209) 2025-06-06 17:26:08 +07:00
Nguyen Ngoc Minh
19bcce80fa
ci: update file size tauri build template macos and windows (#5208)
* chore: update filesize latest-mac.yaml

* chore: disable createUpdaterArtifacts as handled on ci

* chore: update file size latest.yaml
2025-06-06 16:02:09 +07:00
David
3cdbff53eb fix: file system mcp server missing param 2025-06-05 14:32:10 +07:00