GravityOCR GGUF + GLM-SigLiT V4.0
Quantized GGUF + BF16 vision projector runtime bundle for trillionlabs/GravityOCR (general multilingual OCR backbone) paired with the unified V4.0 Qntology/GravityOCR-KO-GLM-SigLiT head (siglit_head.safetensors, 5.86 MB).
GGUF Files & Quantization Verification (zorogravity-gguf)
| File | Role | Size | Tensor / Error Audit |
|---|---|---|---|
GravityOCR-q8.gguf | Active (Q8_0) LM Decoder | 715,315,552 B | 510/510 tensors · linear out rel err mean 0.539%, max 0.572% (PASS) |
GravityOCR-q4.gguf | Compact (Q4_K) LM Decoder | 378,890,080 B | 510/510 tensors · linear out rel err mean 7.472%, max 7.882% |
mmproj-GravityOCR-bf16.gguf | Vision Projector (BF16) | 868,268,224 B | 347/347 exact (0 changed) |
siglit_head.safetensors | V4.0 GLM-SigLiT Head | 5,859,736 B | Shared dual-backbone head (14 domains × 8 languages × clean/rough) |
Pyramid (vision-q8+head) & Ternary Bonsai (bonsai-text+head) Variants
| File | Variant | Size | Empirical RX 6600 ROCm Verification | Role |
|---|---|---|---|---|
GravityOCR-pyramid.gguf + mmproj-GravityOCR-pyramid.gguf | vision-q8+head | 715,417,152 B + 462,764,352 B | Lossless Q8_0 vision + trimmed Q8 decoder (59,200 rows, zero domain token loss) | Lossless default (pyramid) |
GravityOCR-bonsai.gguf + mmproj-GravityOCR-bonsai.gguf + GravityOCR-sidecar-bf16.safetensors | bonsai-text+head (recipe: 5) | 399,564,704 B + 462,764,448 B + 86,138,064 B | Distilled on 104 balanced 13-language crops (Stage 1 0.3330 -> 0.2293, blk.15 top32_kl 0.05756 -> 0.00571). SigLiT smooth3x3 AUC 0.987-0.996 identical to Q8/BF16. Held-out 12-lang ml_ocr_eval (72 crops): overall CER 0.0703 (277/3940, 45/72 exact) vs Q8 0.0957 (377/3940, 42/72 exact) — lower CER on 11/12 languages (fr 0.000, de 0.003, ja 0.038, zh 0.075, ar 0.519). | Verified compact Bonsai (bonsai, bonsai_pass: true) |
NVIDIA Opt-In Tiers (nvfp8 / nvfp4)
Default runtime loading (load_active_on) remains on the lossless pyramid (vision-q8+head) bundle. NVIDIA nvfp8 and nvfp4 tiers are explicit opt-ins via ZOROGRAVITY_NV_TIER=nvfp8 or ZOROGRAVITY_NV_TIER=nvfp4 (ada/hopper alias nvfp8, blackwell aliases nvfp4). Both tiers encode text weights single-pass from BF16 with token_embd.weight / trimmed output.weight kept Q8_0 in GGUF and share the lossless Q8_0 CogViT vision projector (mmproj-GravityOCR-pyramid.gguf) so multilingual OCR & SigLiT fidelity stay intact.
GravityOCR-pyramid(vision-q8+head): Out-of-sampleimatrix-calibrated losslessQ8_0decoder (GravityOCR-pyramid.gguf) + losslessQ8_0CogViT vision projector (mmproj-GravityOCR-pyramid.gguf).GravityOCR-nvfp8(gocr-nvfp8): All 96 decoder projection matrices calibrated withimatrix+BlockHessianCholesky GPTQ (B <= 256) inNVFP8(GravityOCR-nvfp8.safetensors,469.02 MiB), paired withGravityOCR-nvfp8.gguf(185.02 MiB) andmmproj-GravityOCR-pyramid.gguf(441.33 MiB).GravityOCR-nvfp4(gocr-nvfp4):blk.1..=14.{ffn_gate_up,ffn_down}inNVFP4with attention + boundaryblk.0/blk.15protected inNVFP8(GravityOCR-nvfp4.safetensors,344.99 MiB), paired withGravityOCR-nvfp4.gguf(185.02 MiB) andmmproj-GravityOCR-pyramid.gguf(441.33 MiB) (existing HF weights retained as optimal on multilingual/form eval).- CUDA Execution Path:
M <= 8decode uses fused single-rounding branchless ALU-decodedNVFP8/NVFP4/BonsaiQ2matvec + fused SwiGLU kernels;8 < M <= 16uses exact F32 on-chiptile16;M > 16prefills runW8A16/W4A16BF16 Tensor Core cuBLAS GEMM (CUDA_R_16BFonsm_80+,F16onsm_75,CUBLAS_COMPUTE_32F). CogViT +GLM-SigLiTexecute GPU-native Chan-Welford LayerNorm + fused 2D RoPE + L2 norm viavis_ops.
RTX 3050 Laptop CUDA Multilingual / Forms Benchmark (218 Crops TF / 64 Greedy vs GravityOCR-q8 + mmproj-bf16 Reference — Before vs After)
Measured head-to-head on 218 stratified out/forms_test crops (ref NLL = 0.06708, Greedy 64 crops), comparing prior HF weights on the new runtime ("Before") against out-of-sample imatrix + BlockHessian GPTQ rebuilds ("After"):
| Tier / Variant | Plan | Sizes (GGUF + mmproj + sidecar) | Resident Weights | SigLiT cos (min / mean / patch) | NLL (ΔNLL Before → After) | TF Agree (Before → After) | Greedy 64 (Before → After) |
|---|---|---|---|---|---|---|---|
Reference (Q8_0 + BF16) | q8 | 682.18 + 828.05 MiB | — | 1.00000 / 1.00000 / 1.00000 | 0.06708 (+0.00000) | 100.00% | 64/64 |
pyramid (Default) | vision-q8+head (imatrix) | 682.27 + 441.33 MiB | 589.77 MiB | 0.99742 / 0.99994 / 0.99914 | +0.00106 → +0.00066 | 99.48% → 99.60% | 62/64 → 62/64 (70.21s) |
nvfp8 (ZOROGRAVITY_NV_TIER=nvfp8) | gocr-nvfp8 (BlockHessian GPTQ) | 185.02 + 441.33 + 469.02 MiB | 561.52 MiB | 0.99742 / 0.99994 / 0.99914 | +0.00326 → +0.00222 | 98.90% → 99.25% | 60/64 → 64/64 (66.08s) |
nvfp4 (ZOROGRAVITY_NV_TIER=nvfp4) | gocr-nvfp4 (HF retained) | 185.02 + 441.33 + 344.99 MiB | 437.49 MiB | 0.99765 / 0.99996 / 0.99907 | +0.00585 | 98.21% | 60/64 (65.54s) |
bonsai (GravityOCR-sidecar-bf16) | bonsai-text+head (F32 rescue/highway runtime) | 381.05 + 441.33 + 82.15 MiB | 377.51 MiB | 0.99765 / 0.99996 / 0.99907 | 0.34300 (+0.27591) | 89.08% | 28/64 (69.08s) |
[!NOTE] Previous README reported the earlier baseline (
ref_nll=0.09853:pyramid +0.00065 59/64,nvfp8 +0.00341 56/64,nvfp4 +0.01199 52/64,bonsai +0.42798 36/64). Both Before (prior HF artifacts on current runtime) and After rows above were measured on the same 218 extractedout/forms_testcrops;nvfp4GPTQ candidate (ΔNLL +0.00658,58/64) did not strictly improve bothΔNLLand Greedy so the existing HFGravityOCR-nvfp4weights were retained unchanged.
Vision Encoder Benchmark (CogViT + GPU GLM-SigLiT, RTX 3050 sm_86, 16 Crops out/diverse_eval)
| Path | Total (16 crops) | Per-Crop Latency | SigLiT GPU↔CPU max_abs_diff | vis_ops=0 vs 1 Parity (6,144 floats) |
|---|---|---|---|---|
Before (ZOROGRAVITY_VIS_OPS=0 + GPU SiglitHead) | 3640.77 ms | 227.55 ms/crop | 3.20e-6 | — |
After (ZOROGRAVITY_VIS_OPS=1 + GPU SiglitHead) | 3540.46 ms | 221.28 ms/crop | 3.92e-6 | max_abs_diff = 6.00e-7 · cos = 1.0000000 |
Usage in blueprint-sandbox & zoro-gravity
Select GravityOCR alongside GravityOCR-KO (gocr):
set BLUEPRINT_OCR_MODEL=GravityOCR
:: or for zoro-gravity:
set ZOROGRAVITY_OCR_MODEL=GravityOCR
Benchmark Summary (V4.0 on GravityOCR)
| Suite | GravityOCR-KO V3.2 | GravityOCR-KO V4.0 | GravityOCR V3.2 | GravityOCR V4.0 |
|---|---|---|---|---|
| Suite 1 Forms CV (LOO AUC) | 0.9689 | 0.9875 | 0.9678 | 0.9866 |
| Suite 1 Forms Held-out 64 AUC | 0.9758 | 0.9895 | 0.9751 | 0.9889 |
| Suite 2 P&ID Master Acc (KO) | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| Suite 2 P&ID Master Margin (KO) | 0.0546 | 0.1111 | 0.0542 | 0.1153 |
| Suite 2b P&ID Master Acc (EN) | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| Suite 2b P&ID Master Margin (EN) | 0.1208 | 0.1407 | 0.1199 | 0.1394 |
| Suite 3 Symbols Clean Acc | 0.9900 | 0.9950 | 0.9950 | 0.9950 |
| Suite 3 Symbols Neg FAR | 0.0000 | 0.0000 | 0.0000 | 0.0000 |
| Suite 4a FUNSD Test AUC (EN) | 0.8880 | 0.8818 | 0.8881 | 0.8803 |
| Suite 4b DocLayNet Val AUC (EN) | 0.9174 | 0.9286 | 0.9174 | 0.9331 |
| Suite 5 Diverse Mix (KO+EN) | 0.9746 | 0.9907 | 0.9738 | 0.9910 |
| Suite 5b Diverse Pure EN | 0.9790 | 0.9935 | 0.9793 | 0.9943 |
| Suite 6 Education/Exam | 0.9451 | 0.9831 | 0.9492 | 0.9836 |
| Suite 7 Ranked Industrial | 0.9856 | 0.9955 | 0.9848 | 0.9952 |
| Suite 8 Med/Biz/Legal | 0.9834 | 0.9962 | 0.9829 | 0.9963 |
| Suite 9 V4 New Ind (Semicon/Water) | 0.9769 | 0.9946 | 0.9769 | 0.9946 |
| Suite 10 V4 New Doc (Legal/Log/Fin) | 0.9852 | 0.9980 | 0.9842 | 0.9980 |
| Suite 11 V4 14-Dom x 8-Lang | 0.9665 | 0.9970 | 0.9664 | 0.9968 |
| Suite 12 V4 Rough/Handwritten | 0.9643 | 0.9939 | 0.9635 | 0.9940 |
Per-Language AUC (Suites 11 & 12)
| Lang | KO Suite 11 Clean | KO Suite 12 Rough | Base Suite 11 Clean | Base Suite 12 Rough |
|---|---|---|---|---|
zh | 0.9960 | 0.9935 | 0.9954 | 0.9936 |
en | 0.9979 | 0.9939 | 0.9971 | 0.9943 |
fr | 0.9977 | 0.9952 | 0.9974 | 0.9954 |
es | 0.9977 | 0.9943 | 0.9977 | 0.9939 |
ru | 0.9974 | 0.9948 | 0.9971 | 0.9945 |
de | 0.9976 | 0.9952 | 0.9975 | 0.9954 |
ja | 0.9957 | 0.9926 | 0.9959 | 0.9931 |
ko | 0.9966 | 0.9923 | 0.9970 | 0.9923 |
Showcases & Production Usage
- Qntology/blueprint-sandbox: On-device 7-domain industrial engineering control console (
BuildingMep,Electrical,FireSafety,PowerPlant,AiDataCenter,SemiconductorFab,WaterPlant) across 8 UI/OCR languages (ko,en,zh,ja,fr,es,de,ru) with P&ID delta reading (delta_probe), KKS/DCIM/SEMI/ISA extraction, and symbol dictionary matching (symbol_dict.bin). - Qntology/zoro-gravity: On-device 7-domain 5-Gate document & grievance review engine (
Civil,Education,Healthcare,Enterprise,Legal,Logistics,Finance) across 8 languages, using CogViT + GLM-SigLiT V4.0 for layout crop planning and OCR. - Qntology/candle-rocm-vulkan: Rust Candle fork providing Windows/Linux AMD ROCm (HIP SDK 7.2) and cross-platform Vulkan compute kernels.
Hardware Performance Verification (AMD Radeon RX 6600, gfx1032)
| Probe / Workload | ROCm (GravityOCR-KO) | ROCm (GravityOCR) | Vulkan (GravityOCR-KO) | Vulkan (GravityOCR) |
|---|---|---|---|---|
delta_probe --no-scans --no-a0 Model Open | 1.5 s | 2.1 s | 1.5 s | 1.8 s |
delta_probe 5-Sheet Master Index (735 KB int8, 384x384) | 1.1 s | 1.4 s | 3.0 s | 3.2 s |
symbol_probe 64p / 256p per crop (520 train + 260 test) | 13.5 ms / 59.5 ms | — | 70.0 ms / 300.1 ms | — |
Kernel Self-Tests (rms_norm, rope, flash_attn_d64, decoder_ops) | PASS (<= 2.0e-7) | PASS (<= 2.0e-7) | PASS (<= 1.9e-7) | PASS (<= 1.9e-7) |
Hardware Performance Verification (NVIDIA GeForce RTX 3050 Laptop, sm_86, CUDA 13.3 — Before vs After)
Kernel / Quant Format (blk.*.ffn_gate_up.weight [9216x1536]) | CUDA ↔ CPU Rel Err (M=1 / M=64) | CUDA Latency Before (M=1 / M=64) | CUDA Latency After (M=1 / M=64) | Speedup (M=1 / M=64) | Status |
|---|---|---|---|---|---|
Q8_0 (GravityOCR-q8 / GravityOCR-bonsai blk.0) | 1.6e-7 / 2.2e-4 | 0.092 ms / 0.238 ms | 0.091 ms / 0.236 ms | 1.01x / 1.01x | PASS (<= 1e-2) |
NVFP8 (GravityOCR-nvfp8 blk.0, M>16 via BF16 TC W8A16) | 1.9e-7 / 2.3e-3 | 0.105 ms / 0.540 ms | 0.104 ms / 0.549 ms | 1.01x / 0.98x | PASS (<= 1e-2) |
NVFP4 (GravityOCR-nvfp4 blk.1, M>16 via BF16 TC W4A16) | 1.6e-7 / 2.4e-3 | 0.126 ms / 0.498 ms | 0.106 ms / 7.901 ms | 1.19x / 0.06x | PASS (<= 1e-2) |
BonsaiQ2 (GravityOCR-bonsai blk.1, F32 tile16 M<=16, BF16 TC M>16) | 1.8e-7 / 2.3e-3 | 0.173 ms / 2.950 ms | 0.158 ms / 0.669 ms | 1.10x / 4.41x | PASS (<= 1e-2) |
CUDA Kernel Self-Tests (rms_norm, rope, flash_attn_d48/d64, decoder_ops, layer_norm, vis_ops, rope_i, flash_attn_causal_d128, lm_head_argmax_cs) | 0.0e0 .. 1.6e-5 (layer_norm: 5.2e-8, vis_ops: 1.6e-5) | — | — | — | ALL PASS on CUDA (zero CPU fallback) |
License & Attribution
- Apache License 2.0 (
LICENSE): Copyright 2026 Qntology — covers Qntology's GLM-SigLiT V4.0 head, crop probes, symbol dictionary, GGUF conversions, and synthetic datasets. - MIT License (
LICENSE-UPSTREAM-MIT): Preserves upstreamtrillionlabs/GravityOCR-KO,trillionlabs/GravityOCR, andzai-org/GLM-OCRcopyright and permission notices. - Distillation Notice (
NOTICE): Apache-2.0 Section 4(d) attribution forgoogle/siglip2-so400m-patch16-naflex(Apache-2.0) used solely as an offline training-time relational distillation teacher (zero SigLIP 2 weights bundled).