From ec3853a78ab3e5221d16cf2591625a9dd7474443 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Sun, 12 Apr 2026 15:38:00 -0400 Subject: [PATCH] fix(projects): route auto-summary through main model MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Project auto-summaries were using the 3B background model, but the task — synthesizing a coherent paragraph over ~10 notes — is well past what 3B can do reliably. Evidence on dev: "doging conversation hygiene", "MCPview). MCP).", trailing stray quotes, and hallucinated topics ("AI regulation"). Route through the user's default chat model instead. Project summary regeneration is rare (only when a project changes) so the KV cache eviction cost on the main model is negligible. Title generation, tag suggestions, and RSS classification continue to use the background model — those tasks are within what 3B handles. Co-Authored-By: Claude Opus 4.6 --- src/fabledassistant/services/projects.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/fabledassistant/services/projects.py b/src/fabledassistant/services/projects.py index d3e1e38..c9e6735 100644 --- a/src/fabledassistant/services/projects.py +++ b/src/fabledassistant/services/projects.py @@ -119,12 +119,17 @@ async def generate_project_summary(user_id: int, project_id: int) -> None: f"Recent notes:\n{note_snippets}" ) + # Project summarization is synthesis over ~10 notes — too hard for the + # 3B background model, which produces incoherent, repetitive output + # (misspellings, broken parens, cliché filler). Route through the main + # chat model instead. These are rare events (only when a project + # changes), so the main model's KV cache eviction cost is negligible. from fabledassistant.services.llm import generate_completion from fabledassistant.config import Config from fabledassistant.services.settings import get_setting messages = [{"role": "user", "content": prompt}] - bg_model = await get_setting(user_id, "background_model", Config.OLLAMA_BACKGROUND_MODEL) - summary = await generate_completion(messages, model=bg_model, max_tokens=400, num_ctx=2048) + main_model = await get_setting(user_id, "default_model", Config.OLLAMA_MODEL) + summary = await generate_completion(messages, model=main_model, max_tokens=400, num_ctx=2048) if not summary: return