doc-parsing / library
GLM-OCR
Capability: GLM-OCR
Use it when
- Scanned business documents with complex tables, seals, or code blocks come out garbled through conventional OCR and you need layout-aware markdown plus JSON output
- You need a small self-hostable OCR model (0.9B parameters) that serves through vLLM, SGLang, or Ollama for high-concurrency or edge document parsing without a large VLM
What it solves
Not the fit when
- Cloud mode when documents cannot be sent to Zhipu: the MaaS SDK forwards document content to the hosted API
- Assuming local use is included in the base install; the self-hosted layout pipeline requires the selfhosted extra and a separately running model service
- Publicly exposing the self-hosted SDK server without an external authentication and TLS layer; its api_key field is not validated
- Multiple independent documents in one request; a list is treated as pages of one document
- Treating the project-reported OmniDocBench result as a guarantee for a different document distribution
- digital-native pdf text extraction where ocr is overkill
- handwriting-free plain screenshots needing only lightweight ocr
- audio or video transcription
Install
pip install glmocr (cloud API mode); pip install "glmocr[selfhosted]" plus vllm serve zai-org/GLM-OCR --port 8080 for local GPU serving; model weights on Hugging Face zai-org/GLM-OCR under MIT
Invoke
glmocr parse examples/source/code.png --output ./results/ after configuring config.yaml with either maas.enabled plus an API key from open.bigmodel.cn or ocr_api pointing at your vLLM/SGLang server; Python: from glmocr import parse; parse("image.png").save()Alternatives
No reviewed alternatives recorded yet.