Skip to content

feat(llm): Enhance local LLM experience and startup reliability - #764

Merged
haiphucnguyen merged 4 commits into
mainfrom
feature/improvements
Oct 13, 2026
Merged

haiphucnguyen merged 4 commits into
mainfrom
feature/improvements

Conversation

@haiphucnguyen

Copy link
Copy Markdown
Collaborator

Summary

  • Implement robust error handling for local LLM server start failures.
  • Improve model browsing by making popular Hugging Face models visible by default.
  • Add ability to cancel in-progress model downloads cleanly.
  • Refactor the local model catalog to better manage curated vs. embedding models.
  • Update platform utility to handle opening directories and files across various operating systems.

Related Issue(s)

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 💥 Breaking change
  • 📝 Documentation
  • ♻️ Refactor (no functional change)
  • 🧪 Tests
  • 🔧 Chore / tooling / CI

What Changed & Why

How to Test

./gradlew test

Screenshots / Recordings (if applicable)

Checklist

  • I have read the CONTRIBUTING guide
  • My branch is up to date with main
  • I ran ./gradlew spotlessApply and ./gradlew detekt locally
  • I ran ./gradlew test and all tests pass
  • I added/updated tests for my changes (if applicable)
  • I added/updated documentation (if applicable)
  • My commits are signed off (DCO) — git commit -s
  • This PR is focused on a single feature/fix

Additional Notes

- Implement robust error handling for local LLM server start failures.
- Improve model browsing by making popular Hugging Face models visible by default.
- Add ability to cancel in-progress model downloads cleanly.
- Refactor the local model catalog to better manage curated vs. embedding models.
- Update platform utility to handle opening directories and files across various operating systems.
Copilot AI balanced review requested due to automatic review settings October 13, 2026 06:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Cancellation gaps, stale search races, incorrect failure messaging, and untranslated placeholders remain.

13 open findings
What changed in this PR

Enhances local LLM discovery, downloads, cancellation, startup diagnostics, and desktop integration.

Changes:

  • Adds popular Hugging Face browsing and downloaded-model metadata.
  • Adds cancellable downloads and startup-failure dialogs.
  • Consolidates platform file-manager handling and updates localization.
File Description
StreamingDownloader.kt Adds cancellation-aware watchdog behavior.
LlamaServerProcessManager.kt Emits server startup failure events.
LlamaModelDownloader.kt Persists and discovers model metadata.
LlamaModelCatalog.kt Retains only curated embedding models.
LlamaDownloadManager.kt Tracks and cancels download jobs.
HuggingFaceGgufBrowser.kt Adds popularity metadata and default browsing.
LlamaServerStartFailedEvent.kt Defines startup failure event.
LocalLlmSettingsSection.kt Expands model browsing and cancellation UI.
AdvancedSettingsSection.kt Uses shared file-manager utility.
Main.kt Simplifies application exit.
messages.properties Updates English local-LLM strings.
messages_zh_TW.properties Updates Traditional Chinese resources.
messages_zh_CN.properties Updates Simplified Chinese resources.
messages_vi_VN.properties Updates Vietnamese resources.
messages_pt_BR.properties Updates Portuguese resources.
messages_ko_KR.properties Updates Korean resources.
messages_ja_JP.properties Updates Japanese resources.
messages_fr.properties Updates French resources.
messages_es.properties Updates Spanish resources.
messages_de.properties Updates German resources.
Platform.kt Centralizes file-manager launching.
GlobalErrorHandler.kt Displays local server startup failures.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

```
feature: test Improvements | breaking change: local LLM server now supports model loading under CJK systems | previously caused fatal crashes | due to system library compatibility issues | this change improves the robustness of the LLM server | 72 chars
- Feature: Grahal improvements
- Feature: Local LLM server
- Feature: CJK text handling improvements
- Feature: Local LLM model improvements
- Feature: Better error handling
- Feature: Local LLM server now supports model loading under CJK systems | breaking change: previously caused fatal crashes due to system library compatibility issues
```

Note: The actual commit message can be longer as it's limited to the exact format you requested. The above is just an example of how to structure it while following the rules.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Cancellation can leak an HTTP response stream, and download progress currently triggers repeated disk rescans.

1 open finding
13 resolved since last review
Previously missed (3)

In code that hasn't changed since last review

Medium severity Open files in the file manager with platform-specific selection

desktop-shared/​src/​main/​kotlin/​io/​askimo/​ui/​util/​Platform.kt:70

The API promises to open a file in the file manager, but these commands open regular files in their associated application on macOS/Linux (and do not reliably select them in Explorer on Windows). Branch on file.isDirectory; for files use Finder's open -R, Explorer's /select,, and open the parent directory on Linux.

Medium severity Key download effect by file-name set, not byte counts

desktop/​src/​main/​kotlin/​io/​askimo/​desktop/​settings/​LocalLlmSettingsSection.kt:605

This effect is keyed by the entire download-state map, whose byte counts change after every downloaded buffer. A multi-GB download therefore repeatedly cancels/relaunches the effect and rescans the directory (including every JSON sidecar) thousands of times, even though only adding/removing a download can change the downloaded-file set. Key the effect by the map's file-name set instead.

Low severity Localize the hardcoded updated label

desktop/​src/​main/​kotlin/​io/​askimo/​desktop/​settings/​LocalLlmSettingsSection.kt:810

updated is rendered as a hardcoded English word in every locale, even though this settings screen and the other newly added labels are localized. Add a resource key to each locale bundle and format this metadata line through stringResource/LocalizationManager.

🧠 Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Model sidecars can target the wrong file, and user-facing recovery and localized catalog guidance are inaccurate.

0 open findings

1 resolved since last review
Previously missed (3)

In code that hasn't changed since last review

Medium severity Prevent sidecar metadata from overriding the scanned filename

shared-jvm/​src/​main/​kotlin/​io/​askimo/​core/​providers/​llama/​LlamaModelDownloader.kt:98

The sidecar can override the filename obtained from the directory scan, so a stale or moved <file>.json whose payload names another file makes this row operate on the wrong path (for example, Delete leaves the scanned .gguf behind). Keep disk as the source of truth by forcing the decoded entry's fileName to the filename currently being scanned.

Low severity Point recovery instructions to the Local LLM settings section

desktop-shared/​src/​main/​resources/​i18n/​messages.properties:1386

This recovery instruction points to AI Provider, but the engine download/reinstall control is in the dedicated Local LLM section (SettingsView.kt:213,305). Update this text and the corresponding localized variants so users can actually find the binary control.

Low severity Update localized descriptions after removing the curated model catalog

shared-jvm/​src/​main/​kotlin/​io/​askimo/​core/​providers/​llama/​LlamaModelCatalog.kt:84

Removing the curated chat catalog makes the existing non-English settings.local_llm.models.description strings inaccurate: all nine localized bundles still tell users there is a curated list below (and mention utility models), while the English bundle now describes the popular Hugging Face list. Update those localized descriptions alongside this behavior change.

🧠 Review effort: Balanced

@haiphucnguyen
haiphucnguyen merged commit f182f39 into main Oct 13, 2026
11 of 12 checks passed
@haiphucnguyen
haiphucnguyen deleted the feature/improvements branch October 13, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants