mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-11-24 14:17:44 +00:00
The chat response synthesizer packed the retrieved chunks using the embedding chunk size as its limit, so nothing merged and each question took 3 to 6 sequential LLM calls. Use the configured context size as the limit instead, so the chunks share one prompt. If the server rejects the larger prompt with a 400, log a warning naming PAPERLESS_AI_LLM_CONTEXT_SIZE and retry once with the embedding chunk size, as before. The retry only happens before anything has streamed.