Instructions to use aenawi/MonkeyOCRv2-B-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 aenawi/MonkeyOCRv2-B-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 aenawi/MonkeyOCRv2-B-GGUF:F16 # Run inference directly in the terminal: llama cli -hf aenawi/MonkeyOCRv2-B-GGUF:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf aenawi/MonkeyOCRv2-B-GGUF:F16 # Run inference directly in the terminal: llama cli -hf aenawi/MonkeyOCRv2-B-GGUF:F16
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 aenawi/MonkeyOCRv2-B-GGUF:F16 # Run inference directly in the terminal: ./llama-cli -hf aenawi/MonkeyOCRv2-B-GGUF:F16
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 aenawi/MonkeyOCRv2-B-GGUF:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf aenawi/MonkeyOCRv2-B-GGUF:F16
Use Docker
docker model run hf.co/aenawi/MonkeyOCRv2-B-GGUF:F16
- LM Studio
- Jan
- vLLM
How to use aenawi/MonkeyOCRv2-B-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "aenawi/MonkeyOCRv2-B-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": "aenawi/MonkeyOCRv2-B-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/aenawi/MonkeyOCRv2-B-GGUF:F16
- Ollama
How to use aenawi/MonkeyOCRv2-B-GGUF with Ollama:
ollama run hf.co/aenawi/MonkeyOCRv2-B-GGUF:F16
- Unsloth Desktop
- Pi
How to use aenawi/MonkeyOCRv2-B-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf aenawi/MonkeyOCRv2-B-GGUF:F16
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": "aenawi/MonkeyOCRv2-B-GGUF:F16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use aenawi/MonkeyOCRv2-B-GGUF with Docker Model Runner:
docker model run hf.co/aenawi/MonkeyOCRv2-B-GGUF:F16
- Lemonade
How to use aenawi/MonkeyOCRv2-B-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull aenawi/MonkeyOCRv2-B-GGUF:F16
Run and chat with the model
lemonade run user.MonkeyOCRv2-B-GGUF-F16
List all available models
lemonade list
- Hermes Agent
How to use aenawi/MonkeyOCRv2-B-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 aenawi/MonkeyOCRv2-B-GGUF:F16
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 aenawi/MonkeyOCRv2-B-GGUF:F16
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use aenawi/MonkeyOCRv2-B-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf aenawi/MonkeyOCRv2-B-GGUF:F16
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 "aenawi/MonkeyOCRv2-B-GGUF:F16" \ --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"
MonkeyOCRv2-B-Parsing, GGUF for llama.cpp
MonkeyOCRv2-B-Parsing (Apache-2.0), converted to GGUF so that
an unmodified llama-server can run it.
| File | What | Size | sha256 |
|---|---|---|---|
MonkeyOCRv2-B.q8_0.gguf |
the text model (Qwen3, 0.6B), Q8_0 | 805 MB | 4ad745d04e5c268c9dda399a25d22761ccdce1ea4f8d4092fcb75eac6256b718 |
MonkeyOCRv2-B.mmproj-f16.gguf |
the vision part, F16 | 253 MB | f2fb03e3a0b631c86ece0caea58682e1d980258eade67339c7cac4465e42e569 |
Made from zenosai/MonkeyOCRv2-B-Parsing at commit e8871a0057c98378219b369f924a25ba10f392bf, with llama.cpp's own
converter at build b11382. Tested with llama-server b11382 on Metal (Apple M2 Max), Vulkan (Intel Iris Xe) and CPU.
How it was converted
llama.cpp has no MonkeyOCRv2 architecture, but it has both of its parts:
- The text model is a plain Qwen3. Converted as one.
- The vision part is dots.ocr's vision encoder, line for line, except for the order of its 2D rotary table: MonkeyOCRv2 interleaves the height and width frequencies (h, w, h, w, …), dots.ocr puts all the height ones first. The rows of Q and K are reordered to dots.ocr's order, which leaves every attention score unchanged, and the part is converted as dots.ocr's vision encoder.
- llama.cpp wraps a dots.ocr image in
<|img|>…<|endofimg|>. MonkeyOCRv2's own tokens for that are<|vision_start|>and<|vision_end|>(ids 151652, 151653), so those two are renamed in the GGUF's vocabulary.
How to run it
llama-server -m MonkeyOCRv2-B.q8_0.gguf --mmproj MonkeyOCRv2-B.mmproj-f16.gguf -c 16384
Use it as upstream's pipeline does: the system line You are a helpful assistant., greedy decoding, and every image
scaled to at most ~1 megapixel (upstream's MOCR2_MAX_PIXELS, 1,003,520). First a layout pass over the page
(Please output the categories and coordinates of the document elements in reading order.), then each block cut out
and read with its label's prompt (text, table in OTSL, formula in LaTeX). See the
upstream repository for the prompts and the pipeline.
Results
On 10 hand-checked scanned pages, mostly Arabic, at 160 DPI: 2.5% character error rate on the GPU (Q8_0 and F16 the same), 4.0% on the CPU. About 6 s a page on an M2 Max GPU, 41 s on an Intel Iris Xe.
License
Apache-2.0, as the original model. All credit for the model to its authors: MonkeyOCRv2 (paper).
- Downloads last month
- 427
8-bit
Model tree for aenawi/MonkeyOCRv2-B-GGUF
Base model
zenosai/MonkeyOCRv2-B-Parsing