hanji-dev/hanji-parse-4b
Hanji Parse 4B is a 4 billion parameter vision-language model developed by hanji-dev, fine-tuned from Qwen3-VL-4B-Instruct. It specializes in document parsing, extracting layout-grounded content blocks from page images and emitting them as a JSON array. This model excels at segmenting semantic sections like paragraphs, headings, key-value panels, and tables, providing bounding boxes and transcribed text for each.
Loading preview...
Hanji Parse 4B: Document Parsing VL Model
Hanji Parse 4B is a specialized 4 billion parameter vision-language model, fine-tuned from Qwen3-VL-4B-Instruct, designed for robust document parsing. Its core function is to take a page image and output a JSON array of layout-grounded content blocks. Each block represents a semantic section of the page, such as a paragraph, a heading with its associated content, a key-value panel, or an entire table, complete with a bounding box and transcribed text.
Key Capabilities and Output Contract
- JSON-only Output: The model consistently returns a JSON array of records, each containing
bbox_2d(normalized 0-1000 page coordinates) andtext_content. - Semantic Block Grouping: It groups content into semantic sections (typically 5-30 per page), rather than individual lines, cells, or fields, ensuring meaningful data extraction.
- Table Handling: Tables are transcribed as a single block containing GitHub-Flavored Markdown, preserving cell content and structure.
- Image Recognition: Non-text graphics like photos, charts, and signatures are identified as image blocks with
text_contentset to "". - Checkbox Transcription: Checkboxes are transcribed inline as
[x]for marked and[ ]for unmarked. - Meaning-Focused Transcription: The model prioritizes transcribing meaning over layout glyphs, omitting decorative elements and blank lines, and merging labels with values.
Usage and Optimization
- Image Preprocessing: Requires specific image downscaling (max 2MP) and dimension flooring to multiples of 32 for optimal performance.
- Strict Prompt Adherence: Users must use an exact, predefined prompt to guide the model's parsing behavior.
- Decoding Recommendations: Recommends greedy decoding (
temperature 0.0,top_p 1.0) and strongly advises JSON-schema-constrained decoding for reliable output. - Performance: Optimized for serving with SGLang, leveraging N-gram speculative decoding for significant speedups on its structured JSON output.