Instructions to use iamkushagratomar/glm-ocr-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 iamkushagratomar/glm-ocr-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 iamkushagratomar/glm-ocr-gguf:Q4_K_M # Run inference directly in the terminal: llama cli -hf iamkushagratomar/glm-ocr-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 iamkushagratomar/glm-ocr-gguf:Q4_K_M # Run inference directly in the terminal: llama cli -hf iamkushagratomar/glm-ocr-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 iamkushagratomar/glm-ocr-gguf:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf iamkushagratomar/glm-ocr-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 iamkushagratomar/glm-ocr-gguf:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf iamkushagratomar/glm-ocr-gguf:Q4_K_M
Use Docker
docker model run hf.co/iamkushagratomar/glm-ocr-gguf:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use iamkushagratomar/glm-ocr-gguf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "iamkushagratomar/glm-ocr-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": "iamkushagratomar/glm-ocr-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/iamkushagratomar/glm-ocr-gguf:Q4_K_M
- Ollama
How to use iamkushagratomar/glm-ocr-gguf with Ollama:
ollama run hf.co/iamkushagratomar/glm-ocr-gguf:Q4_K_M
- Unsloth Desktop
- Pi
How to use iamkushagratomar/glm-ocr-gguf with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf iamkushagratomar/glm-ocr-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": "iamkushagratomar/glm-ocr-gguf:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use iamkushagratomar/glm-ocr-gguf with Docker Model Runner:
docker model run hf.co/iamkushagratomar/glm-ocr-gguf:Q4_K_M
- Lemonade
How to use iamkushagratomar/glm-ocr-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull iamkushagratomar/glm-ocr-gguf:Q4_K_M
Run and chat with the model
lemonade run user.glm-ocr-gguf-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use iamkushagratomar/glm-ocr-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 iamkushagratomar/glm-ocr-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 iamkushagratomar/glm-ocr-gguf:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use iamkushagratomar/glm-ocr-gguf with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf iamkushagratomar/glm-ocr-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 "iamkushagratomar/glm-ocr-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"
GLM-OCR GGUF
GGUF conversions of GLM-OCR for use with llama.cpp and compatible runtimes. The repo contains an F16 conversion plus several quantized variants so you can pick the size/quality trade-off that suits your hardware.
Note: These are unofficial community conversions. All credit for the model goes to the original authors. Please refer to the original model card for the architecture, training details, intended use, and license terms.
Available files
| File | Quant | Approx. size | Notes |
|---|---|---|---|
glm-ocr-f16.gguf |
F16 | ~1.9 GB | Full 16-bit precision, reference quality |
glm-ocr-Q8_0.gguf |
Q8_0 | ~1.0 GB | Near-lossless, recommended for OCR |
glm-ocr-Q5_K_M.gguf |
Q5_K_M | ~0.7 GB | Very good quality |
glm-ocr-Q5_K_S.gguf |
Q5_K_S | ~0.66 GB | Slightly smaller than Q5_K_M |
glm-ocr-Q4_K_M.gguf |
Q4_K_M | ~0.6 GB | Good balance of size and quality |
glm-ocr-Q4_K_S.gguf |
Q4_K_S | ~0.57 GB | Slightly smaller than Q4_K_M |
glm-ocr-Q3_K_M.gguf |
Q3_K_M | ~0.5 GB | Noticeable quality loss |
glm-ocr-Q3_K_S.gguf |
Q3_K_S | ~0.47 GB | Smallest, lowest quality |
Sizes are approximate. See the Files and versions tab for exact sizes.
Which file should I use?
OCR is unusually sensitive to quantization. A single wrong character counts as an error, and small models lose accuracy faster than large ones at low bit widths. Since this model is under 1B parameters, the size savings from aggressive quantization are small in absolute terms.
- Best accuracy:
Q8_0(orf16if you have the memory). - Good compromise:
Q5_K_MorQ4_K_M. - Q3 variants: only if you are very tight on memory. Expect more character errors, repeated tokens, and garbled output on dense or small text.
If OCR quality looks off with a low-bit quant, try Q8_0 on the same image before drawing conclusions.
Usage
Build llama.cpp
git clone https://github.com/ggml-org/llama.cpp
cd llama.cpp
cmake -B build -DGGML_CUDA=ON # omit the flag for CPU-only
cmake --build build --config Release -j$(nproc)
Use a recent llama.cpp build. Support for this architecture is new, so older builds may fail to load the model.
Download
hf download YOUR_USERNAME/glm-ocr-gguf glm-ocr-Q8_0.gguf --local-dir .
Text-only sanity check
./build/bin/llama-cli -m glm-ocr-Q8_0.gguf -ngl 99 -c 4096 -p "Hello"
This only exercises the text decoder. It does not process images.
Image OCR
GLM-OCR is a vision-language model. To process images you need the vision projector (mmproj) file in addition to the language model GGUF, and a llama.cpp build that supports this architecture's vision tower:
./build/bin/llama-mtmd-cli \
-m glm-ocr-Q8_0.gguf \
--mmproj mmproj-glm-ocr-F16.gguf \
--image page.png \
-p "Extract all text from this image." \
-ngl 99
Or serve it over an OpenAI-compatible API:
./build/bin/llama-server -m glm-ocr-Q8_0.gguf --mmproj mmproj-glm-ocr-F16.gguf -ngl 99 -c 8192
Status of vision support: the
mmprojfilename above is a placeholder. If anmmprojfile is not listed in this repo's files, the vision encoder has not been converted here, and the GGUFs in this repo can only be used as text decoders. Check the llama.cpp release notes for current GLM-OCR multimodal support.
Memory notes
- Image inputs produce many tokens, so the KV cache grows quickly. If you hit out-of-memory errors, lower the context (
-c 4096) or offload fewer layers (-ngl). - A 4 GB GPU is enough for
Q8_0with a modest context length.
Conversion details
- Converted from the original Hugging Face checkpoint with llama.cpp's
convert_hf_to_gguf.py(--outtype f16). - Quantized from the F16 file with
llama-quantize, no importance matrix. - No fine-tuning or other modification of the weights was performed.
To reproduce:
python convert_hf_to_gguf.py /path/to/GLM-OCR --outfile glm-ocr-f16.gguf --outtype f16
./build/bin/llama-quantize glm-ocr-f16.gguf glm-ocr-Q8_0.gguf Q8_0
./build/bin/llama-quantize glm-ocr-f16.gguf glm-ocr-Q4_K_M.gguf Q4_K_M
Limitations
- Quantization introduces small numerical differences from the original model. Outputs will not be identical to the full-precision checkpoint, and lower-bit files are more likely to make character-level mistakes.
- Accuracy on handwriting, low-resolution scans, dense tables, and complex layouts depends heavily on the original model and the prompt you use.
- Always verify OCR output before using it for anything where errors matter (financial, legal, medical, etc.).
License
These files are derived from the original model and are distributed under the same license as the base model. Please check the original repository for the authoritative license text, and make sure the license field in this card's metadata matches it.
Acknowledgements
- The original GLM-OCR authors for the model.
- llama.cpp and the GGUF format by Georgi Gerganov and contributors.
- Downloads last month
- 251
3-bit
4-bit
5-bit
8-bit
16-bit
Model tree for iamkushagratomar/glm-ocr-gguf
Base model
zai-org/GLM-OCR