Skip to content

feat(offline-ai): proofread long texts in parts - #1077

Merged
LeanBitLab merged 1 commit into
mainfrom
feat/ai-long-text
Dec 4, 2026
Merged

LeanBitLab merged 1 commit into
mainfrom
feat/ai-long-text

Conversation

@LeanBitLab

Copy link
Copy Markdown
Owner

On-device models have little room for input and answer, and small ones stop early on multi-line text.

  • Proofreading goes line by line; long lines are split after sentences. List markers, blank lines and indentation are not sent to the model.
  • Translation goes in larger parts and only succeeds as a whole.
  • A line the model can't correct keeps its original text, with a message.
  • Progress is shown per part, and cancel stops between parts.
  • The limit is 30000 characters (was 12000). Phones with more than 7 GB of memory get bigger parts. Custom AI keys are unchanged.

Tests

New TextPiecesTest; it and AiResultChecksTest pass, the offline debug build succeeds.

On Waydroid (plugin 1.0.1, Gemma 3 1B): a four line list that was rejected before is corrected with its list markers kept, and cancel leaves the text unchanged. It is slow with that plugin, which keeps generating after each answer.

Not checked on a device: translation, texts over 12000 characters, the bigger part size.

- proofread line by line, long lines split after sentences; list markers, blank
  lines and indentation are not sent to the model
- translate in larger parts, only succeeding as a whole
- keep a line's original text when the model can't correct it
- raise the limit from 12000 to 30000 characters; bigger parts on phones with
  more than 7 GB of memory
@LeanBitLab
LeanBitLab merged commit cbf930c into main Dec 4, 2026
1 check passed
@LeanBitLab
LeanBitLab deleted the feat/ai-long-text branch December 4, 2026 20:20
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