Skip to content

feat(core): in-process mistral.rs local runtime for qwen3.5-1b#46

Merged
senamakel merged 9 commits into
mainfrom
feat/local-llm
Mar 27, 2026
Merged

feat(core): in-process mistral.rs local runtime for qwen3.5-1b#46
senamakel merged 9 commits into
mainfrom
feat/local-llm

Conversation

@senamakel
Copy link
Copy Markdown
Member

Summary

  • Added a new core-owned local AI runtime in rust-core using mistral.rs with qwen3.5-1b defaults.
  • Implemented background bootstrap, model download/checksum handling, warmup, status tracking, and resident in-memory inference.
  • Added core RPC methods for local AI status/download/summarization/suggested questions.
  • Wired Tauri commands and frontend wrappers to expose local AI debug/interaction controls.
  • Switched Tauri thread suggestion generation and context compaction summarization to use the local core runtime (with fallback behavior).

Problem

  • Prior flow relied on external local-model orchestration assumptions (e.g., Ollama-style separation), which does not satisfy the requirement that LLM logic run inside rust-core for background execution.
  • We needed an in-process local model path that can be initialized once, reused cheaply, and exposed through Tauri only as control/debug endpoints.

Solution

  • Introduced local_ai configuration schema and module in rust-core.
  • Implemented LocalAiService to:
    • load GGUF via mistralrs::GgufModelBuilder
    • keep Model resident in memory
    • run one warmup request after load
    • provide summarize + suggest APIs
    • download model artifacts when configured
  • Added JSON-RPC handlers:
    • openhuman.local_ai_status
    • openhuman.local_ai_download
    • openhuman.local_ai_summarize
    • openhuman.local_ai_suggest_questions
  • Triggered background bootstrap at core startup and integrated local summarization into compaction flow.
  • Added Tauri command proxies and frontend usage in Settings/Home/thread suggestion paths.

Testing

  • yarn -s compile
  • cargo check --manifest-path src-tauri/Cargo.toml
  • Other checks run (list commands)
    • cargo fmt --all
    • cargo check -p openhuman-core
    • cargo check -p OpenHuman
    • yarn -s tsc --noEmit
    • pre-push hooks (yarn format:check, yarn lint, yarn compile) during push
  • Manual validation completed (list scenarios)

Impact

  • Desktop/Tauri path now supports an in-process core local model runtime for background summarization/suggestion tasks.
  • First-time setup has heavier dependency/build and model artifact requirements (GGUF artifact path/download config).
  • No new external model service requirement for this path.

Breaking Changes

  • None
  • Yes (describe clearly, including migration steps)

Related

  • Issue(s): N/A
  • Follow-up PR(s)/TODOs:
    • Add explicit model source/bootstrap UX for qwen3.5-1b GGUF download/configuration.
    • Add integration tests for local AI RPC methods and fallback behavior.

- Introduced a new Local Model panel for managing local AI runtime, including status monitoring and download options.
- Updated settings navigation to include 'local-model' route.
- Enhanced AIPanel and Home components to integrate local model management features.
- Improved error handling in Tauri commands for local AI operations.
- Updated subproject reference in skills.
- Improved error handling mechanisms in the Local Model panel to provide clearer feedback during AI runtime operations.
- Updated relevant components to ensure consistent error reporting and user notifications.
- Refactored code to streamline error management processes across local model features.
- Added CoreRunMode enum to support in-process and child process execution modes.
- Updated CoreProcessHandle to manage tasks and child processes based on the selected run mode.
- Enhanced process spawning logic to differentiate between in-process server and dedicated core binary execution.
- Improved error handling for process readiness checks in both run modes.
- Removed unused HashMap import from runtime.rs to enhance code clarity.
- Updated runtime module exports to only include necessary components, simplifying the interface for consumers.
- Changed variable name in llm_generator.rs for clarity without altering functionality.
@senamakel senamakel marked this pull request as ready for review March 27, 2026 23:44
@senamakel senamakel merged commit 0f2530b into main Mar 27, 2026
8 of 14 checks passed
@senamakel senamakel deleted the feat/local-llm branch March 28, 2026 17: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.

1 participant