@stabrise/scaledp
Process a document without sending it anywhere.
Document pipelines that run in the browser. PDF rendering, text detection, OCR and entity recognition compose into one pipeline and run on WebAssembly or WebGPU — in the tab. The file never leaves the machine, which is the point for anything sensitive.
npm install @stabrise/scaledp
Read
Render PDF pages at any DPI, or lift the existing text layer and skip OCR entirely. Word-level boxes throughout.
StagesDetect
PaddleOCR and the DBNet ONNX model ScaleDP uses server-side, plus YOLO for signatures and faces.
StagesRecognise
PaddleOCR across thirteen language presets, or Tesseract over exactly the regions a detector found.
StagesUnderstand
GLiNER zero-shot NER: entity types are plain-language labels given at call time, and every entity carries the boxes it came from.
StagesThe same pipeline, minus the cluster
It mirrors the ScaleDP Python library — same stages, same parameter names, same schemas — so a pipeline reads the same in both. What differs is the runtime: no Spark, no server.
Porting from Python ScaleDPimport { Pipeline, configure } from '@stabrise/scaledp'
import { PdfToImage } from '@stabrise/scaledp/pdf'
import { PaddleTextRecognizer } from '@stabrise/scaledp/ocr'
import { GlinerNer } from '@stabrise/scaledp/ner'
configure({ cache: 'indexeddb', pdf: { workerSrc: '/pdf.worker.min.mjs' } })
const pipeline = new Pipeline([
new PdfToImage({ resolution: 300 }),
new PaddleTextRecognizer({ preset: 'v6-small', keepFormatting: true }),
new GlinerNer({ labels: ['person', 'organization', 'email', 'phone'] }),
])
const rows = await pipeline.transform(file)Choosing an OCR engine
| Engine | Box level | Models fetched | WebGPU | Notes |
|---|---|---|---|---|
| PaddleOCR | word | ~6 MB | yes | 13 language presets, best all-rounder |
| DBNet ONNX | word | ~5 MB | yes | Detection only; mirrors ScaleDP server-side |
| Tesseract | word | ~15 MB / lang | no | No ONNX; good for clean Latin scans |
One bad page is one bad page
Every output schema carries an exception field. A stage that fails records the message there and the pipeline continues, so one unreadable scan does not lose the other forty. Pass propagateError: true to opt into throwing.