Instructions to use inclusionAI/ArmorOCR-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use inclusionAI/ArmorOCR-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf inclusionAI/ArmorOCR-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf inclusionAI/ArmorOCR-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf inclusionAI/ArmorOCR-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf inclusionAI/ArmorOCR-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf inclusionAI/ArmorOCR-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf inclusionAI/ArmorOCR-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf inclusionAI/ArmorOCR-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf inclusionAI/ArmorOCR-GGUF:Q4_K_M
Use Docker
docker model run hf.co/inclusionAI/ArmorOCR-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use inclusionAI/ArmorOCR-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "inclusionAI/ArmorOCR-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "inclusionAI/ArmorOCR-GGUF", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/inclusionAI/ArmorOCR-GGUF:Q4_K_M
- Ollama
How to use inclusionAI/ArmorOCR-GGUF with Ollama:
ollama run hf.co/inclusionAI/ArmorOCR-GGUF:Q4_K_M
- Unsloth Desktop
- Pi
How to use inclusionAI/ArmorOCR-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf inclusionAI/ArmorOCR-GGUF:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "inclusionAI/ArmorOCR-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use inclusionAI/ArmorOCR-GGUF with Docker Model Runner:
docker model run hf.co/inclusionAI/ArmorOCR-GGUF:Q4_K_M
- Lemonade
How to use inclusionAI/ArmorOCR-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull inclusionAI/ArmorOCR-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.ArmorOCR-GGUF-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use inclusionAI/ArmorOCR-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf inclusionAI/ArmorOCR-GGUF:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default inclusionAI/ArmorOCR-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use inclusionAI/ArmorOCR-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf inclusionAI/ArmorOCR-GGUF:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "inclusionAI/ArmorOCR-GGUF:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
ArmorOCR-GGUF
This is the GGUF quantized release of ArmorOCR — a two-stage framework for grounded adversarial OCR perception built on Qwen3-VL-8B-Instruct. It provides two quantization tiers, Q8_0 and Q4_K_M, for both the main model and its vision projector (mmproj), intended to be served with llama.cpp.
📖 For training details, the AdvSpot benchmark, and the full evaluation pipeline, please visit the GitHub repo.
Quickstart
Build llama.cpp with CUDA support, then serve a tier with llama-server + --mmproj:
# 1) Build llama.cpp (CUDA)
git clone https://github.com/ggml-org/llama.cpp && cd llama.cpp
cmake -B build -DGGML_CUDA=ON && cmake --build build --config Release
export LLAMA_BIN=$(pwd)/build/bin
pip install requests tqdm
# 2) Start the OpenAI-compatible server (Q8_0 here; use Q4_K_M likewise)
bash serve_gguf.sh Q8_0 8080
# 3) Run inference against the local server (mirrors the ArmorOCR quickstart)
import base64, requests
with open("path/to/image.png", "rb") as f:
img_url = f"data:image/jpeg;base64,{base64.b64encode(f.read()).decode()}"
resp = requests.post("http://127.0.0.1:8080/v1/chat/completions", json={
"model": "ArmorOCR-GGUF",
"messages": [{"role": "user", "content": [
{"type": "image_url", "image_url": {"url": img_url}},
{"type": "text", "text": ("Please identify the text in the image. "
"Put your reasoning inside <analyze></analyze> "
"and your final recognized text inside <answer></answer>.")},
]}],
"temperature": 0.0,
"max_tokens": 1024,
}, timeout=600)
print(resp.json()["choices"][0]["message"]["content"])
serve_gguf.sh is included in this repo for convenience.
Evaluation on AdvSpot
Region-grounded VQA accuracy and IoU on the AdvSpot benchmark. The two GGUF tiers were evaluated on a single A100 GPU with llama-server; the base column reports the original ArmorOCR results from the paper (evaluated on PPU, same data).
| Category | Sub-type | base | Q8_0 | Q4_K_M |
|---|---|---|---|---|
| Spatial Manipulation | Rotated Text | 56.7 | 60.0 | 56.7 |
| Mirrored Text | 60.0 | 56.7 | 50.0 | |
| Tiny Text | 56.7 | 63.3 | 63.3 | |
| Glyph Variation | Stylized Text | 30.0 | 20.0 | 20.0 |
| Handwritten Text | 63.3 | 60.0 | 53.3 | |
| Imaging Degradation | Capture Artifacts | 60.0 | 60.0 | 56.7 |
| Post-processing | 56.7 | 63.3 | 66.7 | |
| Contextual Blending | Low Contrast | 51.4 | 54.3 | 48.6 |
| AIGC Fusion | 75.0 | 77.5 | 72.5 | |
| Pattern Overlay | 48.6 | 45.7 | 42.9 | |
| Visual Encoding | Symbol Encoding | 52.5 | 52.5 | 52.5 |
| Dot Encoding | 53.3 | 56.7 | 50.0 | |
| Line Encoding | 60.0 | 66.7 | 66.7 | |
| Avg. Acc. | 55.7 | 56.9 | 54.2 | |
| Avg. IoU | 63.3 | 58.6 | 57.2 |
The quantized checkpoints retain accuracy close to the original ArmorOCR (Q8_0 is marginally higher on Acc), with a slight drop in IoU — consistent with quantizing the vision encoder/projector.
License
Released under the Apache License 2.0. Use is additionally subject to the license and acceptable-use policy of the base model Qwen/Qwen3-VL-8B-Instruct.
Citation
@misc{cao2026armorocrgroundedadversarialvisual,
title={ArmorOCR: Grounded Adversarial Visual Perception via Observation-Transferred Self-Distillation},
author={Linhan Cao and Siyuan Li and Jun Lan and Liangbo He and Guannan Li and Xiaolei Huang and Jun Jia and Shuheng Zhou and Huijia Zhu and Weiqiang Wang and Wei Sun},
year={2026},
eprint={2608.20122},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2608.20122},
}
- Downloads last month
- -
4-bit
8-bit