Instructions to use deAPI-ai/lightonocr-3-4b-q8 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 deAPI-ai/lightonocr-3-4b-q8 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 deAPI-ai/lightonocr-3-4b-q8 # Run inference directly in the terminal: llama cli -hf deAPI-ai/lightonocr-3-4b-q8
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf deAPI-ai/lightonocr-3-4b-q8 # Run inference directly in the terminal: llama cli -hf deAPI-ai/lightonocr-3-4b-q8
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf deAPI-ai/lightonocr-3-4b-q8 # Run inference directly in the terminal: ./build/bin/llama cli -hf deAPI-ai/lightonocr-3-4b-q8
Use Docker
docker model run hf.co/deAPI-ai/lightonocr-3-4b-q8
- Llama new
- LM Studio
- Jan
- vLLM
How to use deAPI-ai/lightonocr-3-4b-q8 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "deAPI-ai/lightonocr-3-4b-q8" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "deAPI-ai/lightonocr-3-4b-q8", "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/deAPI-ai/lightonocr-3-4b-q8
- Ollama
How to use deAPI-ai/lightonocr-3-4b-q8 with Ollama:
ollama run hf.co/deAPI-ai/lightonocr-3-4b-q8
- Unsloth Desktop
- Pi
How to use deAPI-ai/lightonocr-3-4b-q8 with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf deAPI-ai/lightonocr-3-4b-q8
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": "deAPI-ai/lightonocr-3-4b-q8" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use deAPI-ai/lightonocr-3-4b-q8 with Docker Model Runner:
docker model run hf.co/deAPI-ai/lightonocr-3-4b-q8
- Lemonade
How to use deAPI-ai/lightonocr-3-4b-q8 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull deAPI-ai/lightonocr-3-4b-q8
Run and chat with the model
lemonade run user.lightonocr-3-4b-q8-{{QUANT_TAG}}List all available models
lemonade list
- Hermes Agent
How to use deAPI-ai/lightonocr-3-4b-q8 with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf deAPI-ai/lightonocr-3-4b-q8
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 deAPI-ai/lightonocr-3-4b-q8
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use deAPI-ai/lightonocr-3-4b-q8 with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf deAPI-ai/lightonocr-3-4b-q8
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 "deAPI-ai/lightonocr-3-4b-q8" \ --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"
|
Download README.md from deAPI-ai/lightonocr-3-4b-q8: direct link, hf CLI and curl.
- Browser
- Download file 3.5 kB
-
https://huggingface.co/deAPI-ai/lightonocr-3-4b-q8/resolve/main/README.md
- Command line
-
hf download hf://deAPI-ai/lightonocr-3-4b-q8/README.md
-
curl -L -o README.md https://huggingface.co/deAPI-ai/lightonocr-3-4b-q8/resolve/main/README.md
3.5 kB
| license: apache-2.0 | |
| base_model: lightonai/LightOnOCR-3-4B | |
| base_model_relation: quantized | |
| pipeline_tag: image-text-to-text | |
| tags: | |
| - gguf | |
| - llama.cpp | |
| - ocr | |
| - document-understanding | |
| - vision-language | |
| # LightOnOCR-3-4B GGUF (Q8_0) | |
| GGUF conversion of [LightOnOCR-3-4B](https://huggingface.co/lightonai/LightOnOCR-3-4B) for [llama.cpp](https://github.com/ggml-org/llama.cpp). LightOnOCR-3-4B is an end-to-end OCR vision-language model that turns a document page image into Markdown, with tables as HTML. | |
| ## Files | |
| | File | Contents | Precision | Size | SHA256 | | |
| |---|---|---|---|---| | |
| | `model.gguf` | Language model | Q8_0 | 4.48 GB | `39af92d0e22c262fdd1e611b0062c33961ad69c5166562172097c17cfdd4cfec` | | |
| | `mmproj.gguf` | Vision encoder and projector | F16 | 0.67 GB | `486a4675f31a9b6d741c95e4605632c95d9b151c25eca22bcf1eddfee6cf901f` | | |
| ## Original model | |
| - **Model:** [lightonai/LightOnOCR-3-4B](https://huggingface.co/lightonai/LightOnOCR-3-4B) | |
| - **Author:** [LightOn](https://lighton.ai) | |
| - **Architecture:** Qwen3.5 vision-language (4B) | |
| - **Paper:** [LightOnOCR: A 1B End-to-End Multilingual Vision-Language Model for State-of-the-Art OCR](https://arxiv.org/abs/2601.14251) | |
| - **Code:** [github.com/lightonai/LightOnOCR](https://github.com/lightonai/LightOnOCR) | |
| ## Conversion | |
| Converted from the official `model.safetensors` with llama.cpp's `convert_hf_to_gguf.py`: | |
| - language model exported directly as Q8_0; | |
| - vision encoder and projector exported as F16 (`--mmproj`); | |
| - `--no-mtp`, because the upstream checkpoint ships without the multi-token-prediction head (`mtp_num_hidden_layers: 0`). | |
| No other changes were made to the weights. The upstream chat template is embedded in `model.gguf`. | |
| ## Usage with llama.cpp | |
| ```bash | |
| llama-server -m model.gguf --mmproj mmproj.gguf --reasoning off | |
| ``` | |
| - **`--reasoning off` is required.** Without it llama-server enables the Qwen3.5 thinking mode, and the transcription ends up in `reasoning_content` while `content` is empty. | |
| - **Send the image only.** As described in the [upstream model card](https://huggingface.co/lightonai/LightOnOCR-3-4B), transcription mode takes the page image with an empty prompt. Other instructions are out of distribution for the model. | |
| - **Image size:** the upstream card recommends rendering PDF pages at 400 DPI and resizing so the longest side is 2048 px. | |
| Example request body for `/v1/chat/completions`: | |
| ```json | |
| { | |
| "messages": [ | |
| { | |
| "role": "user", | |
| "content": [ | |
| { "type": "image_url", "image_url": { "url": "data:image/png;base64,..." } } | |
| ] | |
| } | |
| ], | |
| "temperature": 0 | |
| } | |
| ``` | |
| ## License | |
| LightOnOCR-3-4B is released by LightOn under the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0), for research and commercial use. Its base architecture, Qwen3.5, is also released under the Apache License 2.0. | |
| This repository redistributes the model under the same license. The files are a modified form of the original weights: they were converted to the GGUF format and the language model was quantized to Q8_0. | |
| ## Citation | |
| ```bibtex | |
| @misc{lightonocr2_2026, | |
| title = {LightOnOCR: A 1B End-to-End Multilingual Vision-Language Model for State-of-the-Art OCR}, | |
| author = {Said Taghadouini and Adrien Cavaill\`{e}s and Baptiste Aubertin}, | |
| year = {2026}, | |
| howpublished = {\url{https://arxiv.org/abs/2601.14251}} | |
| } | |
| ``` | |
| --- | |
| *Hosted by [deAPI-ai](https://huggingface.co/deAPI-ai) for use with [GamerHash AI](https://gamerhash.com)* | |