ifURI examples
← all examples

42 — host compute for node OCR

Use the stronger host/NVIDIA machine for OCR while the documents stay on a weaker node such as Lenovo.

Pattern

Lenovo node          URI transfer             Host/NVIDIA compute
fs://file/blob  ->   bytes_b64 + sha256  ->   ocr://document/text

The node only needs sandboxed filesystem reads:

The host runs OCR:

Run

cd /home/tom/github/if-uri/examples/42-host-compute-node-ocr
./host_compute_ocr.py \
  --node-url http://192.168.188.201:8765 \
  --start-path . \
  --max-files 25 \
  --output-dir .state

Outputs:

This example does not move, delete or rename files.

Why this is useful

Lenovo does not need tesseract, imgl, img2nl, wronai/ocr, ollama or GPU packages. It only exposes files through fs:// under IFURI_FS_ROOT. The host can then use its local OCR/LLM stack and write reports locally.

Files

README.mdhost-compute-node-ocr.flow.yamlhost_compute_ocr.pytest_host_compute_ocr.py.state/

View on GitHub →