beam-logo
← All use cases
Batch Processing

Run OCR and document extraction at scale

Run parallelized OCR and document-extraction jobs on the cloud.

Why Beam

Run document processing pipelines

Bring your models, we'll run the infra.

How it works

Build the pipeline in three steps

01

Write the per-document function

OCR, layout parsing, entity extraction — whatever your stack does to one document, wrapped in a decorator.

02

Fan out or enqueue

Use .map() for backlogs and one-off batches, or deploy a task queue for documents that arrive continuously.

03

Collect structured results

Return JSON directly, persist artifacts with Output, or receive a webhook per completed document.

terminal
# For a steady stream of documents, deploy a queue
from beam import task_queue, Output

@task_queue(
    gpu="A10G",
    callback_url="https://api.your-app.com/extracted",
)
def handler(doc_url: str):
    result = extract_structured_data(doc_url)
    Output(path=result).save()

$ beam deploy pipeline.py:handler

# Each upload enqueues instantly with a task ID
$ curl -X POST https://your-queue.app.beam.cloud \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -d '{"doc_url": "https://example.com/invoice-4821.pdf"}'
FAQ

Frequently asked questions

How do you handle confidential documents?

Workloads are isolated from one another and run in non-root containers. For stricter requirements, Beam offers a self-hosted product that runs entirely in your own environment, so no data leaves your VPC.

Which models can I use?

Any OCR or vision model you can run in Python — TrOCR, docTR, layout-aware transformers, or vision LLMs for extraction with reasoning.

How do PDFs get handled?

Use any Python library to split PDFs into page images inside the container, then run your model per page. The whole toolchain is just your code.

What about documents that arrive continuously?

Deploy the same function as a managed task queue — every upload enqueues instantly, and containers scale with the backlog. Add a cron schedule for nightly sweeps.

How do I get results back into my system?

Return values stream back from .map() calls, files persist via Output, and callback URLs POST to your API as each document completes.

$30 free creditrefreshed monthly

Start shipping on infra
you won’t outgrow.

Run sandboxes and GPU workloads on your cloud, and scale out to ours when you need to. No infra to manage.