[PR #7628] [MERGED] chore: implement local ai config #8005

Closed
opened 2026-03-23 23:22:11 +00:00 by mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/7628
Author: @appflowy
Created: 3/26/2025
Status: Merged
Merged: 3/26/2025
Merged by: @appflowy

Base: mainHead: local_ai_global_config


📝 Commits (2)

  • 815bb11 chore: implement local ai config
  • 10048da Merge branch 'main' into local_ai_global_config

📊 Changes

17 files changed (+173 additions, -188 deletions)

View changed files

📝 frontend/appflowy_flutter/lib/ai/service/ai_input_control.dart (+1 -1)
📝 frontend/appflowy_flutter/lib/mobile/presentation/home/mobile_home_setting_page.dart (+0 -1)
📝 frontend/appflowy_flutter/lib/mobile/presentation/setting/ai/ai_settings_group.dart (+11 -13)
📝 frontend/appflowy_flutter/lib/plugins/ai_chat/application/ai_model_switch_listener.dart (+3 -3)
📝 frontend/appflowy_flutter/lib/workspace/application/settings/ai/settings_ai_bloc.dart (+27 -86)
📝 frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/setting_ai_view/model_selection.dart (+10 -5)
📝 frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/setting_ai_view/settings_ai_view.dart (+2 -3)
📝 frontend/rust-lib/Cargo.lock (+2 -2)
📝 frontend/rust-lib/Cargo.toml (+2 -2)
📝 frontend/rust-lib/build-tool/flowy-codegen/src/ts_event/mod.rs (+0 -1)
📝 frontend/rust-lib/flowy-ai-pub/src/cloud.rs (+17 -1)
📝 frontend/rust-lib/flowy-ai/src/ai_manager.rs (+67 -54)
📝 frontend/rust-lib/flowy-ai/src/entities.rs (+18 -2)
📝 frontend/rust-lib/flowy-ai/src/event_handler.rs (+11 -11)
📝 frontend/rust-lib/flowy-ai/src/event_map.rs (+1 -1)
📝 frontend/rust-lib/flowy-ai/src/local_ai/controller.rs (+0 -1)
📝 frontend/rust-lib/flowy-ai/src/util.rs (+1 -1)

📄 Description

Model Selection Process

  1. Collect Available Models:

    • Retrieve server models (marked as non-local).
    • Add the local AI model if it’s enabled.
  2. Determine the Active Model:

    • Get the global active model from workspace settings.
    • Retrieve the user-selected model from stored preferences using a key derived from the source.
      • If no preference is found and a local model is available, choose the local model.
      • Otherwise, use the stored user preference.
    • If the chosen model isn’t in the available list, fall back to the global active model.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AppFlowy-IO/AppFlowy/pull/7628 **Author:** [@appflowy](https://github.com/appflowy) **Created:** 3/26/2025 **Status:** ✅ Merged **Merged:** 3/26/2025 **Merged by:** [@appflowy](https://github.com/appflowy) **Base:** `main` ← **Head:** `local_ai_global_config` --- ### 📝 Commits (2) - [`815bb11`](https://github.com/AppFlowy-IO/AppFlowy/commit/815bb11cde82e28bd2795e88ae8ace075a06561b) chore: implement local ai config - [`10048da`](https://github.com/AppFlowy-IO/AppFlowy/commit/10048dadec36a12b201d0021cdfc8341e2e9ffaa) Merge branch 'main' into local_ai_global_config ### 📊 Changes **17 files changed** (+173 additions, -188 deletions) <details> <summary>View changed files</summary> 📝 `frontend/appflowy_flutter/lib/ai/service/ai_input_control.dart` (+1 -1) 📝 `frontend/appflowy_flutter/lib/mobile/presentation/home/mobile_home_setting_page.dart` (+0 -1) 📝 `frontend/appflowy_flutter/lib/mobile/presentation/setting/ai/ai_settings_group.dart` (+11 -13) 📝 `frontend/appflowy_flutter/lib/plugins/ai_chat/application/ai_model_switch_listener.dart` (+3 -3) 📝 `frontend/appflowy_flutter/lib/workspace/application/settings/ai/settings_ai_bloc.dart` (+27 -86) 📝 `frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/setting_ai_view/model_selection.dart` (+10 -5) 📝 `frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/setting_ai_view/settings_ai_view.dart` (+2 -3) 📝 `frontend/rust-lib/Cargo.lock` (+2 -2) 📝 `frontend/rust-lib/Cargo.toml` (+2 -2) 📝 `frontend/rust-lib/build-tool/flowy-codegen/src/ts_event/mod.rs` (+0 -1) 📝 `frontend/rust-lib/flowy-ai-pub/src/cloud.rs` (+17 -1) 📝 `frontend/rust-lib/flowy-ai/src/ai_manager.rs` (+67 -54) 📝 `frontend/rust-lib/flowy-ai/src/entities.rs` (+18 -2) 📝 `frontend/rust-lib/flowy-ai/src/event_handler.rs` (+11 -11) 📝 `frontend/rust-lib/flowy-ai/src/event_map.rs` (+1 -1) 📝 `frontend/rust-lib/flowy-ai/src/local_ai/controller.rs` (+0 -1) 📝 `frontend/rust-lib/flowy-ai/src/util.rs` (+1 -1) </details> ### 📄 Description # Model Selection Process 1. **Collect Available Models:** - Retrieve server models (marked as non-local). - Add the local AI model if it’s enabled. 2. **Determine the Active Model:** - Get the global active model from workspace settings. - Retrieve the user-selected model from stored preferences using a key derived from the source. - If no preference is found and a local model is available, choose the local model. - Otherwise, use the stored user preference. - If the chosen model isn’t in the available list, fall back to the global active model. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
mirror 2026-03-23 23:22:11 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#8005
No description provided.