Downloads · 30 days
241
39% of all-time downloads
iamkushagratomar/glm-ocr-gguf
glm-ocr-gguf is a image-text-to-text model from iamkushagratomar. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. It is set up for gguf. The card lists the license as mit.
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.
Downloads · 30 days
241
39% of all-time downloads
All-time downloads
613
Public
Repo size
6.2 GB
Likes
0
Public
Click a slice to open those files.
.gguf6.2 GB · 100%
From the Hugging Face model README
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.
| 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.
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.
Q8_0 (or f16 if you have the memory).Q5_K_M or Q4_K_M.If OCR quality looks off with a low-bit quant, try Q8_0 on the same image before drawing conclusions.
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.
hf download YOUR_USERNAME/glm-ocr-gguf glm-ocr-Q8_0.gguf --local-dir .
./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.
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.
-c 4096) or offload fewer layers (-ngl).Q8_0 with a modest context length.convert_hf_to_gguf.py (--outtype f16).llama-quantize, no importance matrix.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
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.