Skip to content

fix(archivist): cap the length of every AI answer - #177

Merged
arthware-dev merged 1 commit into
mainfrom
fix/archivist-llm-output-caps
Oct 6, 2026
Merged

arthware-dev merged 1 commit into
mainfrom
fix/archivist-llm-output-caps

Conversation

@arthware-dev

Copy link
Copy Markdown
Contributor

Summary

  • The archivist sent its classify, capture, reformat and recall requests without max_tokens. A model that repeats itself then runs until the client timeout, and a server that sizes its memory for the requested output plans for its own default. oMLX before 0.7.0 refused such requests when page images were attached, and the document was filed unclassified.
  • Every archivist call now carries a cap that fits the largest correct answer: 4096 tokens for classify and capture, a cap that follows the OCR text length for reformat, 2048 for recall answers, and 16 for the vision probe.

The archivist sent its classify, capture, reformat and recall requests
without `max_tokens`. A model that repeats itself then generates until
the client timeout and holds the AI server for that time. A server that
sizes its memory for the requested output uses its own default instead,
which on oMLX is the whole context window: oMLX releases before 0.7.0
refused such requests with page images attached, and the document was
filed unclassified with a message to set up AI.

Every call now carries a cap that fits the largest correct answer:

- classify and capture: 4096 tokens, room for a receipt with more than
  150 line items or a 400-word article summary
- reformat: follows the length of the OCR text, with room for Markdown
- recall answer: 2048 tokens
- the vision probe: 16 tokens, for its one-word answer

An answer cut off at the cap is logged as such by the AI client.
@arthware-dev
arthware-dev merged commit 1ead144 into main Oct 6, 2026
1 check passed
@arthware-dev
arthware-dev deleted the fix/archivist-llm-output-caps branch October 7, 2026 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant