Update main. #6

Merged
serversdown merged 70 commits from dev into main 2026-07-10 15:17:09 -04:00
Showing only changes of commit abac42c344 - Show all commits
+9 -5
View File
@@ -129,16 +129,20 @@ def maybe_summarize_async(session_id: str, backend: Backend | None = None) -> No
def summarize_all( def summarize_all(
backend: Backend | None = None, limit: int | None = None, workers: int = 8 backend: Backend | None = None, limit: int | None = None, workers: int | None = None
) -> dict: ) -> dict:
"""Summarize every session that needs it. Idempotent and resumable. """Summarize every session that needs it. Idempotent and resumable.
LLM summarization runs concurrently across `workers` threads (great for a Concurrency is backend-aware: the cloud API parallelizes happily, but the
cloud backend). DB reads (loading transcripts) and writes (store_summary, local/MI50 GPU servers run a single slot (llama.cpp --parallel 1) — firing N
which also embeds) happen on the main thread, so the single SQLite requests at them just queues, blows the client timeout, and thrashes the KV
connection is never touched from multiple threads. cache (wasted compute + heat). So GPU backends run serially unless overridden.
DB reads/writes (store_summary embeds) stay on the main thread, so the single
SQLite connection is never touched from multiple threads.
""" """
backend = backend or config.load().summary_backend backend = backend or config.load().summary_backend
if workers is None:
workers = 8 if backend == "cloud" else 1
# Main thread: collect the work (transcripts) for sessions needing a summary. # Main thread: collect the work (transcripts) for sessions needing a summary.
todo: list[tuple[str, str, int]] = [] todo: list[tuple[str, str, int]] = []