Document the attachment size limits and a roadmap for larger ones #83

Merged
svc-agent-writer merged 1 commit from docs/attachment-size into main 2026-11-01 03:03:21 +00:00

Follows #82 (#73). Docs and one docstring; no behaviour change.

Summary

 README.md
   ### Attachment text
-    limits in one bullet
+    #### Attachment size          # each limit, its value, who sets it, the status past it
+                                  # IMAP counts base64: the 10 MB default admits about a 7.5 MB file
+                                  # measured memory per attachment shape
+    #### Larger attachments (roadmap)
+      1. [attachments] memory_mib + a larger sync container limit
+      2. streaming DOCX/PPTX readers (defusedxml iterparse, as XLSX)
+      3. max_bytes above 50 MB, with bytes streamed into the child
 extract.py _engine docstring, SECURITY.md  # Magika's model is 3 MB; the cost is onnxruntime
 config.py, config.example.toml             # the 50 MB ceiling and the base64 count

Evidence

Before: #82 said MarkItDown "loads Magika's ONNX model", and that this cost about 800 MiB. That was wrong about the cause.
After: measured on the arm64 image:

Step Address space Resident Threads
python -c pass 16 MiB 12 MiB 1
import onnxruntime 731 MiB 45 MiB 17
magika.Magika() 2.1 GiB 62 MiB 32

The model directory magika/models/standard_v3_3 is 3.1 MB. The onnxruntime package is 59 MB.

New measurements for the size table, at the real limits (512 MiB):

Attachment Status Address space Resident
DOCX with a 15.6 MB image text 268 MiB 240 MiB
PPTX with a 15.6 MB image text 150 MiB 109 MiB
PDF, 10 MB, one image text 95 MiB 70 MiB
PDF, 45 MB, one image text 189 MiB 170 MiB

make check: lint, mypy --strict, 251 unit tests, pip-audit clean.

Merge Danger

Door: two-way

Blast Radius: docs

🤖 Generated with Claude Code

Follows #82 (#73). Docs and one docstring; no behaviour change. ## Summary ```diff README.md ### Attachment text - limits in one bullet + #### Attachment size # each limit, its value, who sets it, the status past it + # IMAP counts base64: the 10 MB default admits about a 7.5 MB file + # measured memory per attachment shape + #### Larger attachments (roadmap) + 1. [attachments] memory_mib + a larger sync container limit + 2. streaming DOCX/PPTX readers (defusedxml iterparse, as XLSX) + 3. max_bytes above 50 MB, with bytes streamed into the child extract.py _engine docstring, SECURITY.md # Magika's model is 3 MB; the cost is onnxruntime config.py, config.example.toml # the 50 MB ceiling and the base64 count ``` ## Evidence **Before:** #82 said MarkItDown "loads Magika's ONNX model", and that this cost about 800 MiB. That was wrong about the cause. **After:** measured on the arm64 image: | Step | Address space | Resident | Threads | |---|---|---|---| | `python -c pass` | 16 MiB | 12 MiB | 1 | | `import onnxruntime` | 731 MiB | 45 MiB | 17 | | `magika.Magika()` | 2.1 GiB | 62 MiB | 32 | The model directory `magika/models/standard_v3_3` is 3.1 MB. The onnxruntime package is 59 MB. New measurements for the size table, at the real limits (512 MiB): | Attachment | Status | Address space | Resident | |---|---|---|---| | DOCX with a 15.6 MB image | text | 268 MiB | 240 MiB | | PPTX with a 15.6 MB image | text | 150 MiB | 109 MiB | | PDF, 10 MB, one image | text | 95 MiB | 70 MiB | | PDF, 45 MB, one image | text | 189 MiB | 170 MiB | `make check`: lint, `mypy --strict`, 251 unit tests, pip-audit clean. ## Merge Danger **Door:** two-way **Blast Radius:** docs 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The README gains an "Attachment size" section: every limit, its status, the IMAP base64 count, and measured memory per attachment shape. A roadmap section names three options for larger attachments.

Correct the Magika reasoning: its model is 3 MB. The address space goes to onnxruntime, which reserves 731 MiB at import and 2.1 GiB with a session.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign in to join this conversation.
No description provided.