Local OCR and translation for your browser. Visibabel captures images from web pages, runs OCR through GLM-OCR, and optionally augments results with layout data from a companion Python service.
| Module | Path | Role |
|---|---|---|
| Browser extension | extension/ |
MV3 Chrome extension for capture, OCR, translation, and results UI |
| GLM-OCR service | glm-ocr/ |
FastAPI service for layout-aware OCR augmentation |
Shared dev tooling lives in ollama/ (launcher scripts and endpoint smoke tests).
flowchart TD
subgraph Browser extension
pipeline[Request OCR]
translat[Request translation]
final[Final text]
end
subgraph "GLM-OCR SDK server (optional)"
glmsdk[PP-DocLayoutV3 model]
end
subgraph Ollama server
glmmodel[GLM-OCR model]
transmodel[Translation model]
end
pipeline -->|requests OCR| glmmodel
pipeline -->|"requests layout data"| glmsdk
glmsdk -->|augments output| glmmodel
glmmodel -->|provides captured text| translat
translat -->|requests translation| transmodel
transmodel -->|provides translated text| final
- LLM server API running
glm-ocr:latest - Node.js 20+
- Python 3.12+
- Google Chrome for extension development
Requires Docker with Compose.
docker compose up -d --buildThis starts Ollama (localhost:11434) and the GLM-OCR layout service (localhost:5002) using the official ollama/ollama image. Models are pulled automatically:
glm-ocr:latest— OCR (Z.ai GLM-OCR))kaelri/hy-mt2:1.8b— translation (Tencent Hy-MT2-1.8B)
Verify:
curl http://localhost:5002/health
curl http://localhost:11434/api/tagsThe extension defaults (http://localhost:11434/, layout on port 5002) work without changes. The glm-ocr container reaches Ollama via Docker service DNS using GLMOCR_OLLAMA_ENDPOINT=http://ollama:11434 (set in docker-compose.yml). The first layout OCR request may download the Hugging Face layout model into the glm_ocr_models Docker volume.
ollama pull glm-ocr:latest
ollama pull kaelri/hy-mt2:1.8bWindows:
npm --prefix ./ollama run start:ollamaLinux/macOS:
./ollama/start-ollama.shWindows:
cd glm-ocr
.\run-service.ps1Linux/macOS:
cd glm-ocr
./run-service.shService health: http://localhost:5002/health
cd extension
npm install
npm run build:extensionLoad the unpacked extension from the extension/ folder in Chrome. Set the Ollama endpoint in the options page (default: http://localhost:11434/).
See README.TESTS.md for the full test matrix.
Quick checks:
npm --prefix ./extension run test:unit
npm --prefix ./ollama run test:negative
pytest glm-ocrdocs/ENDPOINT_API_REFERENCE.md— HTTP API for Ollama and GLM-OCR endpointsextension/README.md— extension developmentglm-ocr/README.md— Python service setupollama/README.md— Ollama dev tooling
MIT