Doc Intake
Pinewick Business Credit
Demo build. The lender, applicants, and documents are synthetic. Every model response shown is a real, recorded call.

How it works

A small, complete slice of a document-processing service: classify, extract, check, route, and record everything.
Pipeline (Python 3.11, in pipeline/)
ReceivePython service

Packet lands with its page images. Each image is hashed (SHA-256) so every later record points at exact bytes.

ClassifyClaude

One call per page returns the document type, a confidence, and an image-quality rating, validated against a Pydantic schema.

ExtractClaude

A second call with the schema for that type. Every field comes back with the model's own confidence. Values are transcribed, never computed.

CheckPython rules

Arithmetic, required fields, dates, confidence thresholds, and cross-document checks (same business on every page, required documents present).

RoutePython rules

All checks pass: auto-approve. Any failure: the review queue, with the exact rule and field that stopped it.

Audit record on every step: model id and version, prompt version and hash, image hash, request id, tokens, latency, cost, rules version, and for people, who decided what and when.
The provider seam

The steps never import a vendor SDK. They call one interface, and the backend is configuration.

class ModelProvider(Protocol):
    name: str
    model: str

    def run_tool(self, *, system: str, image: bytes, media_type: str,
                 instruction: str, tool: ToolSpec, max_tokens: int) -> ModelCall: ...

def get_provider(name: str, **kw) -> ModelProvider:
    # PIPELINE_PROVIDER=openrouter | anthropic | bedrock
    ...
Anthropic via OpenRouterImplemented. Recorded this demo's calls.
Anthropic APIImplemented with the official SDK. Same contract.
Amazon BedrockStub behind the same interface. Swapping it in changes no step, check, or audit code.
Running it on AWS
  • Intake: uploads to S3 (KMS-encrypted), one SQS message per packet.
  • Workers: the same Python package in a container on ECS, scaled on queue depth. Pages in a packet run in parallel.
  • Model: Claude on Bedrock through a VPC endpoint, IAM role auth, no static keys.
  • Data: PostgreSQL (RDS) for packets, fields, checks, and an append-only audit table. CloudTrail alongside it.
  • Review: this queue behind SSO, with role-based access and the reviewer's identity on every decision.
  • Spend: a hard cap enforced in code before each call, plus per-call cost in the audit record.
Design choices
  • The model reads; Python decides. Arithmetic, dates, and routing are plain rules that can be unit-tested and explained to an auditor.
  • Extraction transcribes what is printed, even when it is wrong. A bad total is a finding, not something to silently fix.
  • Model confidence is self-reported, so it is one signal among several. In production it would be calibrated against reviewer outcomes over time, and the thresholds tuned per field.
  • Every check that fails names a field, so the reviewer lands on the exact spot on the page instead of re-reading the document.
What is real here, and what is not
Real
  • 36 calls to anthropic/claude-sonnet-5.5 on 11/29/2026, served by Anthropic. Total cost $0.39.
  • The responses, latencies, and token counts shown are exactly what those calls returned.
  • The Python pipeline that made the calls, validated the output, ran the checks, and routed each packet.
Synthetic
  • Pinewick Business Credit, every applicant, bank, and insurer. All documents were rendered from HTML for this demo. Tax IDs use the 00- prefix, which is never issued.
  • About a third of the documents have problems planted on purpose. One flag (a low-confidence date on a clean invoice) was not planted; the model raised it.
  • Playback: this site makes no live model calls. Review decisions stay in your browser. Field highlight boxes come from the renderer's layout map; in production they come from OCR word positions.