Jev directory
CommunityJev Cookbooks
OCR Confidence and Bounding Boxes Cookbook
Official Jev cookbook that checks OCR-extracted invoice values: it boxes each value on the photo, scores it against the whole page and against a crop of its box, and flags anything below 0.25 for human review. Runs keyless from saved answers.
- Reading time
- 2 min
- Published by
- Community
- Added
- Nov 23, 2026
Highlights
- Boxes each extracted invoice value on the photo and flags low scores for review.
- Scores every value twice: against the whole page and against a crop of its box.
- A score below 0.25 on either check sends the field to a human reviewer.
- On two supplier invoices the extractor got three values wrong and Jev flagged all three.
- Runs as published without an API key by replaying saved answers from a cache.
Questions about this entry
Short answers drawn from the linked project or page.
The code replays saved answers from a downloaded cache, so it runs as published with no key. To change a request, set TYPESAFE_API_KEY, set DOWNLOAD_CACHE to False, and delete the cache file so the run goes live.
Each extracted value is scored twice: once against the whole page and once against a crop of its bounding box. A value scoring below 0.25 on either check is flagged for review.
It uses jev-1.14.0, and every request needs the TypeSafe-Danger-Zone-Images: true header, which the client sets. The published numbers came from jev-1.14.0 on 2026-10-15.
Jev accepts PNG and JPEG files up to 16 MiB, and each side of an image must be between 280 and 1568 pixels, so a high-resolution scan has to be scaled down before sending.
Install ipython, pillow, typesafe-sdk[pil]>=0.7.5, and cooksafe>=0.3.0,<0.4.0. The page is also available as a single .py file and as a Colab notebook.
No. Images and Box questions are dreamer-ready, meaning they are not yet ready for production, and their request format and answers can change between releases.
It starts from extractions.json, the values the OCR and LLM steps produced, and leaves those two steps out. You can build that file with Tesseract and an LLM of your choice.
From the Jev guides
Original write-ups on what this entry is for.
From the Jev AI model community
Posts from builders shipping with Jev right now.