# Conversion recipe Source: Reza2kn/Bina-0.4-Rizeh, revision51b8c314b0552b1884c1f0e28016cb12a143f637. components.json records the five exact native checkpoint paths and SHA256 values. Verify the checkpoint hash before converting. All five readers have the same architecture and unchanged vocabulary IDs. Body weights matched the previously exported body graph and were reused only after identity verification; every runtime was retested with fresh source baselines. The recipe/source/recognizer.py file comes from that release. portable_model.py algebraically replaces pointwise Conv1d with Linear, preserving masked squeeze-excitation, true widths and CTC lengths. build_recognizer.py checks FP32 logit/argmax equivalence on varied synthetic shapes before exporting. Compact outputs contain tokens, frame confidence and lengths; callers do not need to transfer full logits. Use separate environments for Mac and Linux LiteRT. The requirements files list the measured key converter versions, not complete dependency locks. Python3.11 was used on Mac; LiteRT was built in its existing Linux Python3.10.20 environment. No upstream training environment was changed. ```sh # Mac: repeat for each source checkpoint listed in components.json. python -m pip install -r recipe/requirements-macos.txt python recipe/build_recognizer.py --checkpoint /absolute/path/to/checkpoint.pt --onnx --hqq --coreml --blocks 16 # Separate Linux environment; same source checkpoint. python -m pip install -r recipe/requirements-litert.txt python recipe/export_litert.py --checkpoint /absolute/path/to/checkpoint.pt ``` The LiteRT script's reader branch is portable; its legacy --detector branch requires additional detector helpers and the original Stallion checkout, and is not a standalone detector recipe. ONNX: opset18, dynamic batch/width, ORT1.31 MatMulNBits RTN symmetric4-bit group16, accuracy_level4; HQQ4 group32 is an additional CPU alternative. Eighty-one pointwise linear layers are packed. The stem, depthwise convolutions, biases and other unsupported values stay floating. Graph inputs are float32; accuracy_level4 permits lower internal precision in runtime kernels. HQQ does not require image calibration. The tract importer tested here supports RTN group16 but rejects HQQ floating zero points. Core ML: coremltools9 ML Program, FLOAT32 compute request, iOS18/macOS15 minimum, batch1..8, width8..8192. Apply linear_symmetric int4 per_block16 with weight_threshold512. Validate CPU_AND_GPU on Mac. Quantization storage does not guarantee a particular GPU/ANE placement. LiteRT: litert-torch0.10 converts five static batch-one signatures, widths512/1024/2048/4096/8192. True-width masks remain dynamic inputs. ai-edge-quantizer0.10 recipe.dynamic_wi4b32_afp32 is the accepted reader candidate. recipe.weight_only_wi4_afp32 is produced as an experiment, not the qualified reader artifact shipped here. Keep the dynamic4-block32 file and audit real INT4 buffers; about95.5% of stored constant elements are INT4. This denominator is not a trainable-parameter fraction. Qualification uses the same frozen300 development crops per reader,50 in each of six buckets. Compare every target to a freshly run uncompressed checkpoint without text normalization, requiring character parity>=0.98 in every bucket; report exact-line agreement separately. The frozen private manifest SHA256 is7e7049a3b56323588ae1f6bd38b1753afc2b1149d275c6f0f07c6993be991978. Private images and predictions are deliberately not included. Reproducing this exact canary requires authorized access to those frozen inputs; new public tests do not replace it. The successful recipes above do not use image calibration. A separate GPTQ experiment used144 frozen training-only calibration crops, did not recover the full-page target, and was not promoted or shipped. No public page was used to fit weights. Full-page pure-W4 qualification failed on a handwritten-table diagnostic; see the model card and VALIDATION.json. All original recognizer/code and Surya-derived model licensing and attribution still apply.