Skip to content

light-ocr 0.3.0

Choose a tag to compare

@eric8810 eric8810 released this 20 Jul 00:25
· 151 commits to main since this release
7665b15

Hardware acceleration is now automatic across macOS, Linux, and Windows, while OCR remains fully local and offline.

light-ocr 0.3.0 performance

npm install @arcships/light-ocr@0.3.0

Highlights

  • createEngine() now selects the platform execution path automatically: Core ML on Apple Silicon, Native WebGPU on qualified Linux and Windows systems, then CPU when needed.
  • macOS 15+ on Apple Silicon gains a Direct Core ML FP16 path using the Neural Engine and GPU.
  • Linux x64 with Vulkan and Windows x64 with D3D12 gain self-contained Native WebGPU FP32 execution.
  • The npm package still installs the matching runtime and PP-OCRv6 Small model with no runtime download or Python process.
  • engine.info.execution now reports the selected provider, device, precision, runtime identity, qualification identity, and Auto selection trace.

API changes

  • Node.js ExecutionProvider adds auto, apple, and webgpu.
  • The C++ provider enum adds automatic, apple, and webgpu.
  • Explicit providers are strict requests. Only Auto may continue to another provider during engine creation.
  • The legacy sessionFallback: "cpu" value now returns invalid_argument; omit it or keep sessionFallback: "error".
  • WebGPU accepts precision: "auto" | "fp32"; FP16 remains specific to Apple/Core ML in this release.

Real-device results

All results compare the accelerated path with the CPU path on the same machine.

Device Execution End-to-end speedup OCR process CPU time
Apple M4 Max Core ML 2.30×–2.85× 95.91%–97.67% less
NVIDIA RTX 5060 Ti on Linux WebGPU / Vulkan 5.70× across 14 fixtures 69.97% less
AMD Radeon 780M on Windows WebGPU / D3D12 2.44× across 14 fixtures 46.33% less

The two WebGPU reports passed 164/164 gates and produced byte-identical OCR output to CPU FP32 across all 14 fixtures. The Apple FP16 route passed its locked CPU-parity thresholds.

Requirements

  • Node.js 22 or 24
  • macOS arm64/x64, Linux x64 with glibc, or Windows x64
  • Apple acceleration: macOS 15+ on Apple Silicon

More information

The npm registry remains the authoritative distribution channel for the six published packages. GitHub automatically provides source archives for this tag.