feat(settings): add background model picker with KV cache performance warning

Exposes OLLAMA_BACKGROUND_MODEL as a per-user setting in General settings,
alongside the Chat Model selector. Includes an inline warning when the same
model is selected for both, explaining the KV cache performance impact.

All background task callers (title generation, tag suggestions, project
summaries, RSS classification) now read background_model from user settings,
falling back to OLLAMA_BACKGROUND_MODEL env var.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-03 10:44:08 -04:00
parent fa38978745
commit 3bd0dc6879
6 changed files with 36 additions and 7 deletions
+3 -1
View File
@@ -121,8 +121,10 @@ async def generate_project_summary(user_id: int, project_id: int) -> None:
from fabledassistant.services.llm import generate_completion
from fabledassistant.config import Config
from fabledassistant.services.settings import get_setting
messages = [{"role": "user", "content": prompt}]
summary = await generate_completion(messages, model=Config.OLLAMA_BACKGROUND_MODEL, max_tokens=400)
bg_model = await get_setting(user_id, "background_model", Config.OLLAMA_BACKGROUND_MODEL)
summary = await generate_completion(messages, model=bg_model, max_tokens=400)
if not summary:
return