--- license: apache-2.0 pipeline_tag: image-text-to-text library_name: llama.cpp tags: [paddleocr-vl, spacemit, k1, k3, gguf, onnxruntime, ocr] --- # PaddleOCR-VL-0.9B for SpacemiT K1/K3 This package is a SpacemiT deployment of [PaddlePaddle/PaddleOCR-VL](https://huggingface.co/PaddlePaddle/PaddleOCR-VL), an Apache-2.0 ultra-compact vision-language model for multilingual document parsing (text, tables, formulas, charts and reading order). It uses a NaViT-style dynamic-resolution vision encoder with ERNIE-4.5-0.3B. See the [PaddleOCR repository](https://github.com/PaddlePaddle/PaddleOCR) and the [technical report](https://arxiv.org/abs/2510.14528). ```bibtex @misc{cui2025paddleocrvlboostingmultilingualdocument, title={PaddleOCR-VL: Boosting Multilingual Document Parsing via a 0.9B Ultra-Compact Vision-Language Model}, author={Cheng Cui and Ting Sun and Suyin Liang and Tingquan Gao and Zelun Zhang and Jiaxuan Liu and Xueqing Wang and Changda Zhou and Hongen Liu and Manhui Lin and Yue Zhang and Yubo Zhang and Handong Zheng and Jing Zhang and Jun Zhang and Yi Liu and Dianhai Yu and Yanjun Ma}, year={2025}, eprint={2510.14528}, archivePrefix={arXiv}, primaryClass={cs.CV}, url={https://arxiv.org/abs/2510.14528}} ``` Files are `paddleocr_vision.float.onnx`, `paddleocr-vl-text-q41.gguf`, and `configs/K1` / `configs/K3`. The vision input is fixed at 784×784, NCHW, with rescale `1/255`, mean `[0.5,0.5,0.5]`, and std `[0.5,0.5,0.5]`. Install [SpacemiT ONNX Runtime](https://github.com/spacemit-com/onnxruntime/releases) and SMT-enabled [llama.cpp](https://github.com/spacemit-com/llama.cpp). ORT 2.0.6 and llama.cpp v0.1.7 prebuilt archives are supported. A source build uses `git clone --recursive`, sets `RISCV_ROOT_PATH` and `SPACEMIT_ORT_DIR`, then runs `bash build_spacemit.sh glibc`. K1 uses AI cores 0–3, `configs/K1`, `-t 4`; K3 uses AI cores 8–15, `configs/K3`, `-t 8`. The platform configs set the matching `ep_config` affinity. ```bash export MODEL_DIR=/path/to/PaddleOCR-VL-0.9B-SpacemiT LLAMA_DIR=/path/to/llama.cpp-installed ORT_DIR=/path/to/spacemit-ort.riscv64.2.0.6 export LD_LIBRARY_PATH="$LLAMA_DIR/lib:$ORT_DIR/lib:${LD_LIBRARY_PATH:-}" "$LLAMA_DIR/bin/llama-server" -m "$MODEL_DIR/paddleocr-vl-text-q41.gguf" --media-backend smt --smt-config-dir "$MODEL_DIR/configs/K1" -t 4 --host 0.0.0.0 --port 8080 --warmup ``` For K3 change `K1` to `K3` and `-t 4` to `-t 8`. POST an image data URL and `Read the text and describe the document content in the image.` to `/v1/chat/completions`, with thinking disabled. Smoke tests using `humanspeech.jpg` returned HTTP 200 on K1 (output began `The following image is a picture of a building...`) and K3 (began `The following image is a picture of a building. The text is not clear...`). Use a text-heavy document image for OCR accuracy evaluation. The model and upstream dependencies retain their respective Apache-2.0/project licenses.