733 Commits

Author SHA1 Message Date
Nghia Doan
c5a5968bf8
Merge pull request #6643 from menloresearch/fix/model-name-change
fix: Apply model name change correctly
2025-09-30 22:41:05 +07:00
Louis
de9c04474e
fix: should not allow duplicating model (#6658) 2025-09-30 13:59:17 +07:00
Faisal Amir
334b160012
Merge pull request #6656 from menloresearch/fix/thinking-block
fix: remove thinking tag on projects list message history
2025-09-30 13:48:34 +07:00
Nguyen Ngoc Minh
d315522c5a
Merge pull request #6618 from github-roushan/show-supported-files
Show supported files
2025-09-30 12:19:22 +07:00
Faisal Amir
1c9890649d fix: remove thinking tag on projects list message history 2025-09-30 11:08:31 +07:00
Nghia Doan
3cbf348585
Merge pull request #6642 from menloresearch/fix/toast-text-selection-disable
feat: Disable text selection on Toaster
2025-09-30 11:01:31 +07:00
Louis
eb79642863
fix: unhandled model load error (#6648) 2025-09-29 21:52:39 +07:00
Dinh Long Nguyen
0dbf3b1652 fix: scroll issue padding not re render correctly (#6639) 2025-09-29 17:11:08 +07:00
Faisal Amir
b4df56e0d8 chore: placement menu leftpanel, and ux create add projects 2025-09-29 13:44:56 +07:00
Louis
311b79fe13
fix: thread rerender due to thread scrolling padding subscription (#6629) 2025-09-28 22:36:05 +07:00
Dinh Long Nguyen
b422970369
feat: scrolling behaves like chatgpt with padding (#6598)
* scroll like chatgpt with padding

* minor refactor
2025-09-26 15:53:05 +07:00
Faisal Amir
580bdc511a
Merge pull request #6616 from menloresearch/chore/projects
chore: update project page title too long
2025-09-26 15:47:35 +07:00
Faisal Amir
b7dae19756
feat: custom downloaded model name (#6588)
* feat: add field edit model name

* fix: update model

* chore: updaet UI form with save button, and handle edit capabilities and  rename folder will need save button

* fix: relocate model

* chore: update and refresh list model provider also update test case

* chore: state loader

* fix: model path

* fix: model config update

* chore: fix remove depencies provider on edit model dialog

* chore: avoid shifted model name or id

---------

Co-authored-by: Louis <louis@jan.ai>
2025-09-26 15:25:44 +07:00
Faisal Amir
3d224f8cff chore: update project page title too long 2025-09-26 14:59:38 +07:00
Faisal Amir
39aa1c4f7e
Merge pull request #6607 from menloresearch/fix/projects-left-panel-title
fix: projects title long name
2025-09-26 13:20:54 +07:00
Louis
55c42ba526
fix: lock all of the dependencies (#6561)
* fix: pin web app dependencies

* fix: pin extension versions

* fix: pin extensions-web dependencies

* fix: pin extensions lockfile

* fix: remove unnecessary semicolon
2025-09-26 13:07:29 +07:00
Faisal Amir
0a82fdd784 fix: projects title long name 2025-09-26 10:06:42 +07:00
Faisal Amir
d806c4719e
Merge pull request #6586 from menloresearch/feat/thread-project-org
feat: thread organization folder
2025-09-25 20:21:02 +07:00
Faisal Amir
d690e0fa87 chore: max height project list on left panel 2025-09-25 17:29:38 +07:00
Faisal Amir
a8b9e1f147 chore: fix navigartion thread from project 2025-09-25 16:24:55 +07:00
Akarshan Biswas
11b3a60675
fix: refactor, fix and move gguf support utilities to backend (#6584)
* feat: move estimateKVCacheSize to BE

* feat: Migrate model planning to backend

This commit migrates the model load planning logic from the frontend to the Tauri backend. This refactors the `planModelLoad` and `isModelSupported` methods into the `tauri-plugin-llamacpp` plugin, making them directly callable from the Rust core.

The model planning now incorporates a more robust and accurate memory estimation, considering both VRAM and system RAM, and introduces a `batch_size` parameter to the model plan.

**Key changes:**

- **Moved `planModelLoad` to `tauri-plugin-llamacpp`:** The core logic for determining GPU layers, context length, and memory offloading is now in Rust for better performance and accuracy.
- **Moved `isModelSupported` to `tauri-plugin-llamacpp`:** The model support check is also now handled by the backend.
- **Removed `getChatClient` from `AIEngine`:** This optional method was not implemented and has been removed from the abstract class.
- **Improved KV Cache estimation:** The `estimate_kv_cache_internal` function in Rust now accounts for `attention.key_length` and `attention.value_length` if available, and considers sliding window attention for more precise estimates.
- **Introduced `batch_size` in ModelPlan:** The model plan now includes a `batch_size` property, which will be automatically adjusted based on the determined `ModelMode` (e.g., lower for CPU/Hybrid modes).
- **Updated `llamacpp-extension`:** The frontend extension now calls the new Tauri commands for model planning and support checks.
- **Removed `batch_size` from `llamacpp-extension/settings.json`:** The batch size is now dynamically determined by the planning logic and will be set as a model setting directly.
- **Updated `ModelSetting` and `useModelProvider` hooks:** These now handle the new `batch_size` property in model settings.
- **Added new Tauri commands and permissions:** `get_model_size`, `is_model_supported`, and `plan_model_load` are new commands with corresponding permissions.
- **Consolidated `ModelSupportStatus` and `KVCacheEstimate`:** These types are now defined in `src/tauri/plugins/tauri-plugin-llamacpp/src/gguf/types.rs`.

This refactoring centralizes critical model resource management logic, improving consistency and maintainability, and lays the groundwork for more sophisticated model loading strategies.

* feat: refine model planner to handle more memory scenarios

This commit introduces several improvements to the `plan_model_load` function, enhancing its ability to determine a suitable model loading strategy based on system memory constraints. Specifically, it includes:

-   **VRAM calculation improvements:**  Corrects the calculation of total VRAM by iterating over GPUs and multiplying by 1024*1024, improving accuracy.
-   **Hybrid plan optimization:**  Implements a more robust hybrid plan strategy, iterating through GPU layer configurations to find the highest possible GPU usage while remaining within VRAM limits.
-   **Minimum context length enforcement:** Enforces a minimum context length for the model, ensuring that the model can be loaded and used effectively.
-   **Fallback to CPU mode:** If a hybrid plan isn't feasible, it now correctly falls back to a CPU-only mode.
-   **Improved logging:** Enhanced logging to provide more detailed information about the memory planning process, including VRAM, RAM, and GPU layers.
-   **Batch size adjustment:** Updated batch size based on the selected mode, ensuring efficient utilization of available resources.
-   **Error handling and edge cases:**  Improved error handling and edge case management to prevent unexpected failures.
-   **Constants:** Added constants for easier maintenance and understanding.
-   **Power-of-2 adjustment:** Added power of 2 adjustment for max context length to ensure correct sizing for the LLM.

These changes improve the reliability and robustness of the model planning process, allowing it to handle a wider range of hardware configurations and model sizes.

* Add log for raw GPU info from tauri-plugin-hardware

* chore: update linux runner for tauri build

* feat: Improve GPU memory calculation for unified memory

This commit improves the logic for calculating usable VRAM, particularly for systems with **unified memory** like Apple Silicon. Previously, the application would report 0 total VRAM if no dedicated GPUs were found, leading to incorrect calculations and failed model loads.

This change modifies the VRAM calculation to fall back to the total system RAM if no discrete GPUs are detected. This is a common and correct approach for unified memory architectures, where the CPU and GPU share the same memory pool.

Additionally, this commit refactors the logic for calculating usable VRAM and RAM to prevent potential underflow by checking if the total memory is greater than the reserved bytes before subtracting. This ensures the calculation remains safe and correct.

* chore: fix update migration version

* fix: enable unified memory support on model support indicator

* Use total_system_memory in bytes

---------

Co-authored-by: Minh141120 <minh.itptit@gmail.com>
Co-authored-by: Faisal Amir <urmauur@gmail.com>
2025-09-25 12:17:57 +05:30
Faisal Amir
ba768d46e6 chore: update dialog test case 2025-09-25 13:24:06 +07:00
Louis
7fe58d6bee
fix: allow users cancel backend download (#6582)
* fix: allow users cancel backend download

* fix: should not redownload on cancel
2025-09-25 13:19:14 +07:00
Faisal Amir
8479b7c105 chore: update rename and delete thread from dynamic project screen 2025-09-25 13:12:33 +07:00
Faisal Amir
b0bca2ac1f
Update web-app/src/routes/project/index.tsx
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
2025-09-25 10:19:18 +07:00
Faisal Amir
d0f62fa634 chore: fix missing classname 2025-09-25 10:18:21 +07:00
Faisal Amir
e7a1a06395 feat: thread organization folder 2025-09-25 10:12:08 +07:00
Louis
57110d2bd7
fix: allow users to download the same model from different authors (#6577)
* fix: allow users to download the same model from different authors

* fix: importing models should have author name in the ID

* fix: incorrect model id show

* fix: tests

* fix: default to mmproj f16 instead of bf16

* fix: type

* fix: build error
2025-09-24 17:57:10 +07:00
Faisal Amir
5b59c7a18a
Merge pull request #6560 from menloresearch/fix/layout-downlod-management
fix: download management ui and double refresh model
2025-09-24 09:48:42 +07:00
Akarshan Biswas
38ad8deae2
feat: normalize LaTeX fragments in markdown rendering (#6488)
* feat: normalize LaTeX fragments in markdown rendering

Added a preprocessing step that converts LaTeX delimiters `\[…\]` to `$$…$$` and `\(...\)` to `$…$` before rendering. The function skips code blocks, inline code, and HTML tags to avoid unintended transformations. This improves authoring experience by supporting common LaTeX syntax without requiring explicit `$` delimiters.

* fix: correct inline LaTeX normalization replacement

The replacement function for inline math (`\(...\)`) incorrectly accepted a fourth
parameter (`post`) and appended it to the result, which could introduce stray
characters or `undefined` into the rendered output. Updated the function to
use only the captured prefix and inner content and removed the extraneous
`${post}` interpolation, ensuring clean LaTeX conversion.

* feat: optimize markdown rendering with LaTeX caching and memoized code blocks

- Added cache to normalizeLatex to avoid reprocessing repeated content
- Introduced CodeComponent with stable IDs and memoization to reduce re-renders
- Replaced per-render code block ID mapping with hash-based IDs
- Memoized copy handler and normalized markdown content
- Simplified plugin/component setup with stable references
- Added custom comparison for RenderMarkdown memoization to prevent unnecessary updates

* refactor: memoize content only

---------

Co-authored-by: Louis <louis@jan.ai>
2025-09-24 07:19:32 +05:30
Dinh Long Nguyen
b322c7649b
Merge pull request #6563 from menloresearch/feat/web-minor-ui-tweak-login
feat: tweak login UI
2025-09-23 21:09:58 +07:00
Faisal Amir
3a5580c725 chore: update test case 2025-09-23 20:25:05 +07:00
Faisal Amir
d3fff154d4 fix: download management ui and double refresh model 2025-09-23 20:17:51 +07:00
Roushan Kumar Singh
3f51c35229
feat: support .zip archives for manual backend install (#6534)
* feat(llamacpp): support .zip archives for manual backend install

* Update Lock Files
2025-09-23 18:02:06 +05:30
Nghia Doan
6f827872fb
fix: Catch local API server various errors (#6548)
* fix: Catch local API server various errors

* chore: Add tests to cover error catches
2025-09-23 17:40:16 +07:00
Faisal Amir
3bbce97329
Merge pull request #6559 from menloresearch/fix/layout-ability-model
fix: layout ability model
2025-09-23 16:13:33 +07:00
Louis
8a51cc1656
feat: add azure as first class provider (#6555)
* feat: add azure as first class provider

* fix: deployment url
2025-09-23 16:09:06 +07:00
Faisal Amir
3133d40081 fix: layout ability model 2025-09-23 15:27:41 +07:00
Dinh Long Nguyen
df61546942
feat: web remote conversation (#6554)
* feat: implement conversation endpoint

* use conversation aware endpoint

* fetch message correctly

* preserve first message

* fix logout

* fix broadcast issue locally + auth not refreshing profile on other tabs+ clean up and sync messages

* add is dev tag
2025-09-23 15:09:45 +07:00
Louis
292941e1d0
fix: prevent relocation to root directories (#6547)
* fix: prevent relocation to root directories

* Update web-app/src/locales/zh-TW/settings.json

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-09-23 10:16:11 +07:00
Alexey Haidamaka
5adc0d9d46
add full-width model names (#6350) 2025-09-23 10:14:21 +07:00
Louis
568ee857d5
fix: custom fetch for all providers (#6538)
* fix: custom fetch for all providers

* fix: run in development should use built-in fetch
2025-09-23 09:55:36 +07:00
Akarshan Biswas
885da29f28
feat: add getTokensCount method to compute token usage (#6467)
* feat: add getTokensCount method to compute token usage

Implemented a new async `getTokensCount` function in the LLaMA.cpp extension.
The method validates the model session, checks process health, applies the request template, and tokenizes the resulting prompt to return the token count. Includes detailed error handling for crashed models and API failures, enabling callers to assess token usage before sending completions.

* Fix: typos

* chore: update ui token usage

* chore: remove unused code

* feat: add image token handling for multimodal LlamaCPP models

Implemented support for counting image tokens when using vision-enabled models:
- Extended `SessionInfo` with optional `mmprojPath` to store the multimodal project file.
- Propagated `mmproj_path` from the Tauri plugin into the session info.
- Added import of `chatCompletionRequestMessage` and enhanced token calculation logic in the LlamaCPP extension:
- Detects image content in messages.
- Reads GGUF metadata from `mmprojPath` to compute accurate image token counts.
- Provides a fallback estimation if metadata reading fails.
- Returns the sum of text and image tokens.
- Introduced helper methods `calculateImageTokens` and `estimateImageTokensFallback`.
- Minor clean‑ups such as comment capitalization and debug logging.

* chore: update FE send params message include content type image_url

* fix mmproj path from session info and num tokens calculation

* fix: Correct image token estimation calculation in llamacpp extension

This commit addresses an inaccurate token count for images in the llama.cpp extension.

The previous logic incorrectly calculated the token count based on image patch size and dimensions. This has been replaced with a more precise method that uses the clip.vision.projection_dim value from the model metadata.

Additionally, unnecessary debug logging was removed, and a new log was added to show the mmproj metadata for improved visibility.

* fix per image calc

* fix: crash due to force unwrap

---------

Co-authored-by: Faisal Amir <urmauur@gmail.com>
Co-authored-by: Louis <louis@jan.ai>
2025-09-23 07:52:19 +05:30
Akarshan Biswas
bf7f176741
feat: Prompt progress when streaming (#6503)
* feat: Prompt progress when streaming

- BE changes:
    - Add a `return_progress` flag to `chatCompletionRequest` and a corresponding `prompt_progress` payload in `chatCompletionChunk`. Introduce `chatCompletionPromptProgress` interface to capture cache, processed, time, and total token counts.
    - Update the Llamacpp extension to always request progress data when streaming, enabling UI components to display real‑time generation progress and leverage llama.cpp’s built‑in progress reporting.

* Make return_progress optional

* chore: update ui prompt progress before streaming content

* chore: remove log

* chore: remove progress when percentage >= 100

* chore: set timeout prompt progress

* chore: move prompt progress outside streaming content

* fix: tests

---------

Co-authored-by: Faisal Amir <urmauur@gmail.com>
Co-authored-by: Louis <louis@jan.ai>
2025-09-22 20:37:27 +05:30
Faisal Amir
e1294cdc30
Merge pull request #6529 from menloresearch/enhancement/toaster-delete-mcp
enhancement: toaster delete mcp server
2025-09-22 21:12:02 +07:00
Louis
0d2c99a413
fix: prevent consecutive messages with same role (#6544)
* fix: prevent consecutive messages with same role

* fix: tests

* fix: first message should not be assistant

* fix: tests
2025-09-22 19:27:45 +07:00
Louis
b0b84b7eda
Merge pull request #6475 from menloresearch/feat/bump-tokenjs
feat: fix remote provider vision capability
2025-09-22 14:37:26 +07:00
Faisal Amir
ec425163d3 enhancement: toaster delete mcp server 2025-09-19 23:25:01 +07:00
Roushan Singh
ae2532d40d fix(number-input): preserve '0.0x' format when typing (#6520) 2025-09-19 11:36:06 +05:30
Louis
6bd64409e8
fix: thread rerender issue (#6515)
* fix: thread rerender issue

* chore: clean up console log

* chore: uncomment irrelevant fix

* fix: linter

* chore: remove duplicated block

* fix: tests

* fix: reduce unnessary rerender due to current thread retrieval

* fix: reduce app layout rerender due to router state update

* fix: avoid the entire app layout re render on route change

* clean: unused import

* fix: should not rerender thread message components when typing

* fix re render issue

* direct tokenspeed access

* chore: sync latest

* fix: tests

* fix: linter

* fix: build

---------

Co-authored-by: Dinh Long Nguyen <dinhlongviolin1@gmail.com>
2025-09-19 11:50:46 +07:00