Changelog#
All notable changes to this project are documented in this file.
The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.
The workspace crates (puffinparse-core, puffinparse-cli, puffinparse-python, …) and the
Python package puffinparse share a single version. Entries before the rename say LiteOCR.
Unreleased#
Added#
- Find the best model for your own documents:
puffinparse eval(scan,recommend,run,analyze,review,view,anonymize) and ten matching MCP tools with afind_best_modelprompt that walks a coding agent through it.recommendshortlists models from the newest combined benchmark run, list prices and each provider's documented data handling, filtered by volume, budget, error tolerance, zero data retention and document needs.runsaves every output to<dataset>/.puffinparse/runs/<id>/, needs a spending cap for priced models, shows progress, and resumes; it pays with your own provider keys or, with--gateway, through one gateway key whose budget caps the spend.analyzereports failures, cross-model agreement, latency, cost, monthly cost at your volume, reviews and reference-transcript scores, and queues the documents worth checking by hand.viewis a local viewer (127.0.0.1, random link) with each document next to every model's output, a diff and a review form.anonymizewrites image-only redacted copies using Tesseract on your machine.bench evidence/make evidenceregenerate the benchmark scoresrecommenduses. See ADR-27. Local engines (Tesseract, Docling, PaddleOCR, vLLM) count as ready only when they can be reached, and a run refuses to start when one cannot; a scan counts PDF pages from the page tree, so files saved with incremental updates are not over-counted. puffinparse eval viewnow serves the benchmark site's own viewer, compiled into the CLI: the same model table, document list and inspector as puffinparse.com, with the page rendered by a bundled pdf.js (nothing is fetched from the network), layout boxes from each model's saved response (eval runnow saves<doc>.jsonnext to<doc>.md), a diff against another model, side-by-side comparison and the verdict form. The website viewer gains a Rendered / Markdown switch for model output. See ADR-28.- Release wheels carry the
puffinparseCLI, sopip install puffinparsegives the command anduvx puffinparse mcpstarts the MCP server with nothing installed. - Website
/playground/: pick a sample document (or, once a gateway is configured, upload a PDF or image) and compare up to three models' Markdown side by side, with latency, pages and cost. Samples are five redistributable documents from the newestcombined-v3run with their committed outputs, so showing them calls no provider. Live runs are off until the build getsPUFFINPARSE_PLAYGROUND_API; they offer a signed-in free tier (Supabase, Turnstile, daily model-page allowance) or your own provider keys, which are sent per request and never stored. Model output is rendered by an escaping Markdown renderer, and/playground/has a stricter Content-Security-Policy. The browser/gateway contract is indocs/SERVER.md("Playground API"), the free-tier counters ininfra/supabase/, and offline tests inwebsite/tests/. - Gateway playground API (
[playground], off by default):GET /v1/playground/configandPOST /v1/playground/runs, one async job per model, polled throughGET /v1/jobs/{id}by the same signed-in user or the same provider key only. The free tier verifies Supabase access tokens (JWKS, or HS256 with a legacy secret), requires Turnstile, reserves the user's daily model-pages (counted by the gateway, compressed PDF object streams included) and the run's estimated cost against the day's spend cap, both at submit time, and limits each job to the reserved pages; own keys arrive asx-provider-key-<provider>and are never stored or logged. Per-IP run limits, per-owner poll limits, CORS for the configured origins on those routes only, and error bodies may now carrydetails. A Cloud Run service and config are indeploy/cloudrun/.
Security#
- Real provider ids are gone from committed test data: the Extend run, parse-run and file ids and
the dashboard link, the LlamaParse extract/parse job, file and project ids, and the Reducto job
ids and studio links in the live-captured fixtures (and the matching samples in
docs/providers/extend.md/reducto.md) are now obviously fake ids of the same prefix and length. The 556studio.reducto.ai/job/<id>links in the saved raw responses of runsrun-20260924T211006Zandrun-20260925T090851Zpoint at a zero UUID; the scored.mdoutputs are untouched andbench rescorereproduces every score. Benchmark results keepprovider_job_idfor auditability, asSECURITY.mdnow states. - Document URLs are downloaded through one hardened path (
puffinparse_core::fetch). Providers without URL input (Tesseract, Docling, PaddleOCR, vLLM, Unstructured, Textract, Gemini, the OpenAI and Anthropic vision models, Upstage, Document AI, LlamaParse extract) fetcheddocument_urlin-process with no address filtering and reqwest's default 10 redirects, so a caller-chosen URL could reach169.254.169.254, localhost or the private network (SSRF). The download now accepts http(s) only, resolves the host itself and refuses loopback, private, link-local, CGNAT, unique-local, multicast, broadcast and reserved addresses (including IPv4-mapped and NAT64/6to4 forms), connects only to the vetted address (no DNS rebinding), ignores proxy variables, follows at most 5 redirects re-checking each hop, stops at 50 MiB (PUFFINPARSE_MAX_DOWNLOAD_MB) and the request deadline, and never echoes the response body in an error (Gemini, Upstage and Document AI used to include part of it). DocumentRequest'sDebugoutput no longer printsapi_keyorwebhook_url(which may carry a shared secret), nor the document bytes.- Gateway hardening (
docs/SERVER.md#hardening):document_urlis no longer downloaded inside the gateway by default; self-hosted engines are no longer open to every key; concurrency, a per-request time limit and a header read timeout are enforced;/metricsneeds a key; the gateway refuses to start unauthenticated on a public address;Debugof the gateway's config, deployments, virtual keys and state redacts every secret. The "do not expose yet" warning is gone.
Changed#
- Behaviour change for SDK and CLI users: a URL input to one of the providers above that
points at a private, loopback or link-local address now fails with
InputError. SetPUFFINPARSE_ALLOW_PRIVATE_URLS=1in a trusted setup to allow it (process-wide; there is no per-request switch). Downloads over 50 MiB fail unlessPUFFINPARSE_MAX_DOWNLOAD_MBis raised. - Breaking for gateway operators (
puffinparse serve): - The gateway refuses to start on a non-loopback
host(for example the Docker image's0.0.0.0) withoutmaster_keyor[[keys]]; setserver.allow_unauthenticated = trueif a proxy in front already authenticates every caller. document_urlwith a model whose provider cannot fetch URLs (Tesseract, Docling, PaddleOCR, vLLM, Unstructured, Textract, Gemini, OpenAI, Anthropic, Upstage, Document AI, LlamaParse extract) is rejected with400 input_error, also when only an alias target or a request fallback would download. Uploads and URL-capable providers (Reducto, Extend, LlamaParse parse, Mistral, Azure, Datalab, Mathpix, Landing AI, OpenDocRouter) are unaffected. Newserver.fetch_document_urls = truerestores it, with public addresses only (server.allow_private_document_urls,server.max_download_mb); the gateway ignoresPUFFINPARSE_ALLOW_PRIVATE_URLS.- Self-hosted engines named directly (
tesseract,docling/default, ...) get403 model_not_allowedunless the key'smodelsnames them ("*"or an empty list does not count), the master key calls, orserver.allow_local_engines = true. Aliases targeting them work as before.GET /v1/modelshides them from keys that cannot use them. GET /metricsneeds a gateway key (any virtual key or the master key) unlessserver.public_metrics = true; point the Prometheus scraper at it with a bearer token.- New limits:
server.max_concurrent_requests(default 64 document requests in flight, the rest wait),server.request_timeout_secs(defaultmax_timeout_secs+ 60; then504 timeout_error),server.header_read_timeout_secs(default 30). server.allow_direct_modelskeeps its default (true); give every key an explicitmodelslist.- Docling and PaddleOCR no longer forward a URL input to docling-serve / the PaddleOCR server
(which would fetch it from inside your network); PuffinParse downloads it through the same path
and sends the bytes. PaddleOCR's
fileTypenow always comes from the downloaded bytes. - CI (and
make lint) runsscripts/third_party_notices.py --check, which now also fails when a bundled crate has no licence text orlicenses/extra/holds an unused entry. pyproject.tomluses an SPDXlicense = "MIT"withlicense-files(core metadata 2.4) and requires maturin >= 1.9.3.
Added#
puffinparse bench report --by-dataset [--intro FILE]renders the whole leaderboard page: one section per dataset, the newest run's dataset first as the headline.make leaderboarduses it (the hand-written introduction lives inbenchmark/LEADERBOARD.intro.md), and a test fails whenbenchmark/LEADERBOARD.mdis out of date with the committed results.make leaderboardused to overwrite the page with one merged table.- Benchmark data API: the results viewer's static JSON (leaderboard index, full runs with
per-document scores, per-document model outputs, dataset manifests) is documented as a read-only
API at
/docs/benchmark/data-api/with curl examples, described by an OpenAPI 3.1 document at/openapi.json(schemas derived from the published files, examples taken from the newest run) and listed inllms.txt. /.well-known/api-catalog(RFC 9727 Linkset, served asapplication/linkset+jsonwith the RFC 9727 profile and aLink: rel="api-catalog"header) and RFC 8631service-desc/service-doclinks plusrel="api-catalog"in the head of every page, including the landing page and the results viewer.- Site QA in CI: a
sitejob builds the site with--checkand runswebsite/qa.py, which checks offline that every docs page has a Markdown negotiation route,llms.txtis well formed and its links resolve, JSON-LD parses on every page,robots.txtnames the AI crawlers and a sitemap,/openapi.jsonis valid, its example paths exist and the published JSON matches its schemas, and the API catalog is a valid Linkset. - The gateway image is multi-arch: linux/amd64 and linux/arm64, each built natively (GitHub's
ubuntu-24.04-armrunner for arm64, no QEMU) and joined into one manifest list, sodocker pull ghcr.io/ajinkyashejul/puffinparsegets a native image on Apple Silicon and Graviton. - Licence files in every release artifact: the CLI archives, the wheels and sdist (PEP 639
license-files, in.dist-info/licenses/), every npm package and the Docker image (/usr/share/doc/puffinparse/) carryLICENSE,THIRD_PARTY_NOTICES.mdandTHIRD_PARTY_LICENSES.txt(each bundled crate's full licence text). The 11 crates that publish no licence file have theirs underlicenses/extra/, fetched from the crate's repository at the published commit; r-efi's notices come from itsAUTHORSfile.scripts/check_release_licenses.pyfails a release build whose artifact lacks them. puffinparse mcp: a local Model Context Protocol server on stdio for coding agents (Claude Code, Cursor, Codex), withparse,ocr,extract,list_modelsandcomparetools.compareruns one document through up to eight models concurrently and reports each one's latency, cost, output length and an excerpt. Keys come from the server's environment and are never returned. Provider failures are tool errors that keep the error kind and the provider's message. Long output is truncated with a note. Optional--modelsallow-list and--rootdirectory confinement. Speaks MCP2026-07-28and theinitialize-based revisions back to2024-11-05. Setup snippets are on the agents page.
0.1.6 - 2026-10-08#
Changed#
- Benchmark scorer v3 (
SCORER_VERSION = 3): single*/_emphasis is stripped, inline HTML tags (<sup>,<i>, …) no longer split words, dot leaders collapse to a space, figure markup and markdown images are dropped from transcript predictions (the truths carry no figure content), andtable_cellrules can match a table's header row. The results viewer's in-browser rule checker mirrors all of it. Every committed run was re-scored offline:combined-v3is now led byllamaparse/cost_effective85.63 andllamaparse/agentic85.28 (a statistical tie), thenreducto/r-182.80,extend/parse_performance80.77,reducto/standard80.29,extend/parse_light79.89 andtesseract/default56.41. OmniDocBench's 40 documents keep their v2 scores (outputs not committed). Details indocs/benchmarks/findings.md.
0.1.5 - 2026-10-08#
Added#
- OpenDocRouter provider (
opendocrouter/<vendor>/<model>, 11 models,OPEN_DOC_ROUTER_API_KEY): LlamaIndex's hosted parsing router, docs-only. Layout elements become typed blocks with boxes,cost_usdis the response's actualcharge_usd, partial results keep the pages that worked and list the failed ones inmetadata.opendocrouter_failed_pages, files over ~3 MB go through the uploads flow, documents over 50 pages run async, andsubmit/retrievejobs are supported. - Gateway key allow-lists accept nested prefixes such as
opendocrouter/google/*. - Frontier vision models in the existing providers (docs-only, from each vendor's model and pricing
pages, checked 2026-10-08):
anthropic/claude-opus-5-5,anthropic/claude-haiku-5-5,gemini/3-flash-preview,gemini/3.8-flash-low(Gemini 3.8 Flash withthinkingLevel: "low") andopenai/gpt-6-luna, with per-page estimates inpricing.jsonand exact token prices (including Haiku 5.5's over-100k-token tier) in the providers. vllmprovider (self-hosted, $0): open document-parsing VLMs on your ownvllm serve/ OpenAI-compatible server (VLLM_BASE_URL, optionalVLLM_API_KEY). Presetsvllm/infinity-parser2-flashandvllm/dots.mocrsend each page image (PDFs rasterised withpdftoppm) with the model card's prompt and sampling, and turn the layout JSON into typed blocks with normalised boxes. Implemented from the model cards; not yet run against a server.paddleocr/vl: the PaddleOCR-VL pipeline (PaddleOCR-VL-1.6 by default) through its/layout-parsingserving API (PADDLEOCR_VL_BASE_URL);ocris derived fromparse.
Changed#
- Anthropic: models that reject a forced
tool_choice(Opus 5.5, Sonnet 5.5, Fable 5.1, Mythos 5.1) now gettool_choice: autowith a strict parse tool and an instruction to call it, decided from the model id actually sent (so aprovider_options.modeloverride is covered too). - The
pdftoppmrasterisation and local-tool runner moved from the Tesseract provider toproviders/local.rsso the vLLM provider shares them.
0.1.4 - 2026-10-08#
Security#
- Gateway:
provider_options.cmdandprovider_options.pdftoppm_cmdare rejected (400). They choose the program the Tesseract provider runs, so any key holder could run commands on the gateway host. Operators keepTESSERACT_CMD/PDFTOPPM_CMD. - Textract
regionand Google Document AIlocationmust be a single DNS label. Both are spliced into the provider hostname, so a crafted value could send the signed request (Textract) or the OAuth access token (Document AI) to another host.
0.1.3 - 2026-10-08#
Fixed#
- Tesseract: a corrupt PDF or a page range past the end is now an
InputError(not retryable), so aRouterno longer falls through to other models and hides the real cause; tool stderr in error messages is cut to its first lines (a corrupt PDF produced hundreds), and exit 127 in minimal containers is reported as a missing binary.
Added#
THIRD_PARTY_NOTICES.md(generated byscripts/third_party_notices.py, which also fails on a copyleft-only dependency and writes the full licence texts with--full), an Acknowledgements section in the README, BibTeX citations and licence files for the benchmark datasets, provenance notes for the test fixtures, and source credits for the TEDS, olmOCR and OmniDocBench logic the scorer and adapters mirror.
Changed#
- The results viewer build never copies documents tagged
fetch-required(OmniDocBench, research-only), nor provider outputs for them, even in a clone that fetched them locally.
0.1.2 - 2026-10-08#
Fixed#
- Release versions now match across all manifests (
js/package-lock.jsonstill said 0.1.0), so the release pipeline publishes again; 0.1.1 was tagged but never published.
Added#
- Agent-friendly website: docs URLs return their Markdown for
Accept: text/markdown(withVary: Accept, and a Markdown 404 for unknown docs paths); one schema.org JSON-LD block per page (SoftwareApplication,WebSitewith a docs-searchSearchActionbacked by/docs/?q=,TechArticle, and licensedDatasetentries on the benchmark viewer);robots.txtnames the major AI crawlers explicitly;llms.txtgains when-to-use guidance and the benchmark JSON endpoints; and a new/docs/agents/page, also served as/agents.md, with a copyable onboarding prompt.
0.1.1 - 2026-10-08 [not published]#
Fixed#
- The source distribution now includes the LICENSE file its metadata names; PyPI rejected the 0.1.0 sdist for this, so 0.1.0 shipped wheels only.
0.1.0 - 2026-10-08#
First public release (PyPI wheels, CLI binaries, gateway image).
Changed#
- Provider verification labels are consistent across the README, the provider reference, the landing page and the docs site: live-verified (Reducto, Extend, LlamaParse), verified locally (Tesseract, Docling) and docs-only (the rest, implemented from documentation and tested against fixtures, not yet run live; tracked in issue #10). Tesseract and Docling were previously counted as live-verified on the landing page.
-
README roadmap now lists the open GitHub issues; added issue templates for benchmark and dataset suggestions, a shorter pull-request template,
AGENTS.md, and private vulnerability reporting inSECURITY.md. -
Benchmark and docs tables use sentence-case headers, and a column's best value is bold only when it is unique as displayed (ties are no longer bolded).
-
Renamed to PuffinParse (ADR-23). Crates
puffinparse-*, Python packagepuffinparse(import puffinparse), Node package and CLI binarypuffinparse, environment variablesPUFFINPARSE_*(wasLITEOCR_*), metadata keyspuffinparse_*,PuffinParseError, andoutput_format="puffinparse"for the native shape. The site moves to puffinparse.vercel.app (liteocr.vercel.app still works). Old result files withliteocr_versionstill load.
Added#
-
Release pipeline (
docs/RELEASING.md). Av*tag publishes abi3 wheels and an sdist to PyPI,puffinparseplus five prebuilt platform packages to npm,puffinparse-core/-server/-clito crates.io, the gateway image toghcr.io/ajinkyashejul/puffinparse, and CLI archives withSHA256SUMSto GitHub Releases, all through trusted publishing (no stored registry tokens). npm and crates.io are switched on per repository variable once their one-time setup is done. -
Tesseract baseline in
combined-v3.tesseract/default(Tesseract 5.5.1, one OpenMP thread per process) was added to the 2026-09-25 run withbench run --resume: 199 documents, 0 failures, Overall 56.36 (dpbench 86.77, olmocr 41.67, omnidocbench 35.70, parsebench 20.73, synthetic 97.98). The six API rows are unchanged. Licence audit notes in the DP-Bench README (5 of the 40 vendored pages are Upstage's own documents, kept under its MIT declaration) and the olmOCR README (redistribution with attribution complies with ODC-BY and AI2's guidelines). -
Puffin brand (ADR-24,
docs/DESIGN.mdBrand): a puffin mark (favicon and header logo on the landing page, docs and benchmark viewer) and a waving puffin mascot with three pages in its beak, shown on the landing hero, the 404 page and the README. Every page now has an Open Graph / Twitter social card (website/assets/og.png). The landing demo shows a response on arrival instead of starting blank. -
First
combined-v3results (6 API models × 199 documents, adds a 40-page DP-Bench subset; 0 failures, $14.65): llamaparse/cost_effective leads (84.35) ahead of llamaparse/agentic (83.49) and reducto/r-1 (82.40). It is the new headline inbenchmark/LEADERBOARD.mdand the viewer;combined-v2keeps the Tesseract baseline row. -
Design language (
docs/DESIGN.md,website/assets/tokens.css): paper-and-ink neutrals, one scan accent, verdict and proof-mark colours, layout-box hues, a system-font type scale, the bounding-box and scan-line signatures; every text token passes WCAG AA in both themes. The docs, landing page and benchmark viewer all style through it. - Benchmark viewer redesign. Human document titles ("Headers & footers 3") with raw ids in Details; one primary number per view with secondary metrics, methodology and reproduce commands in disclosures; a compact leaderboard with per-source columns and an All metrics toggle; a calmer score-vs-cost chart with non-overlapping labels; plain-English check rows; a documents list with mean score and best model. PDF pages are rendered at build time with pypdfium2, so olmOCR-bench and ParseBench pages show without pdf.js.
- First
combined-v2results (7 models × 159 documents, 0 failures, $11.74): llamaparse/cost_effective leads (83.79) ahead of llamaparse/agentic (83.05) and reducto/r-1 (81.32);tesseract/defaultis the free baseline (48.68, 97.94 on synthetic).benchmark/LEADERBOARD.mdnow has one section per dataset withcombined-v2as the headline. The viewer shows research-only documents (OmniDocBench) as scores only, with the command to fetch the data, instead of broken links. - Jobs everywhere. Gateway:
POST /v1/jobs(parse body +webhook_url, 202 with a job id) andGET /v1/jobs/{id}(pending / succeeded / failed,output_formaton retrieval); job ids are bound to the submitting key, cost is charged once when the job first succeeds, handles persist instate_file(server.job_retention_hours), and an opt-inPOST /v1/webhooks/{provider}receiver ([webhooks] enabled, shared secret) settles jobs from provider webhook bodies. Newliteocr_jobs_totalmetric andjob_id/job_statuslog fields. Node SDK:submit,retrieve,handleWebhookwith a typedJob. - DP-Bench (Upstage, MIT) adapter: 40 committed single-page PDFs with reading-order transcript
truth (
python -m benchmark.adapters dpbench, pinned at24702c61), andcombined-v3= combined-v2 + DP-Bench (199 documents). Headers and footers stay in the DP-Bench truth because DP-Bench's own NID scores them; each source keeps its publisher's conventions. tesseract/defaultrunstesseractwithOMP_THREAD_LIMIT=1unless set, so parallel pages no longer oversubscribe the CPU (70 s → 0.7 s for a small page on 4 cores).- Benchmark results flag a successful call that returned no text as
empty_output: true(counted insummary.empty_outputs, shown as(+N empty)in the leaderboard), andbench rescore --keep-missingkeeps the recorded scores of documents whose outputs are not committed. - Scorer v2 (
scorer_version: 2in result JSON). HTML<table>output is scored like markdown tables (it used to score 0, which ranked Reducto r-1 last); a newteds_gridmetric (TEDS on the row/cell grid); rule matching ignores spaces next to punctuation (ParseBench rule text is tokenised);bag_of_sentencesmatches sentences fuzzily (0.8) and passes at 0.8 (1.0 was dead signal); olmOCRmax_diffstolerances are honoured; HTML entities are decoded; and results carry an explicitsummary.headlineand per-documentheadline, sochar_similaritymeans literal character similarity again. Python and NodeMetricsgainteds_grid/tedsGrid, and the viewer's rule checker follows the same rules. liteocr bench rescorere-scores a run from its saved outputs with the current scorer, no network calls, keeping measured latency and cost. Both committed runs are re-scored andbenchmark/LEADERBOARD.mdregenerated: on combined-v1, reducto/r-1 moves from last (87.19) to second (91.37); llamaparse/agentic stays first (93.08).docs/benchmarks/findings.md: why four models returned nothing forparsebench/text_multicolumns_2col(a Form XObject with a ±2^1023/BBoxthat 32-bit renderers clip to empty; fixing the file fixes both Reducto and Extend, no option does).- Self-hosted engines, no key, $0/page.
tesseract/default(localtesseractbinary, PDFs viapdftoppm; native OCR with word/line boxes and confidences),docling/default(docling-serve v1 async API; layout, tables, OCR) andpaddleocr/default(PaddleOCR/PaddleX serving:/ocrand PP-StructureV3/layout-parsing; docs-only). Tesseract and Docling are live-verified locally.liteocr providersshowslocalfor them;--jsonand Pythonproviders()includeself_hosted. - README, docs site and landing page cover the TypeScript SDK, the gateway, jobs/webhooks, self-hosted engines and the new benchmark sources; the docs navigation gains the gateway, the self-hosted provider pages, the academic-benchmark survey and the adapter notes.
- Async jobs API and webhooks. Split a parse into submit and retrieve so the caller owns the
waiting (long documents, batches, webhook-driven pipelines). Rust:
submit_parse,retrieve_parse/retrieve_parse_with,parse_webhook,resolve_webhook,JobHandle(serialisable, never holds a key),JobStatus, andDocumentRequest.webhook_url. Python:liteocr.submit/asubmit,retrieve/aretrieve,handle_webhook/ahandle_webhookandliteocr.Job. Covers Reducto, Extend and LlamaParse (live-verified);webhook_urlmaps to Reductoasync.webhookand the LlamaParsewebhook_urlfield, and is rejected for Extend, which only has workspace-level webhooks. SPEC §15. - Benchmark viewer: verify every claim. A per-document inspector at
#/<run>/<model>/<doc>shows the page itself (pdf.js for PDFs, pinned with SRI, PNG fallback), every model's output side by side, a word diff against the truth, and a pass/fail rule checklist for rules documents that is checked against the recorded score. Layout-box overlays by block type appear when a run saved unified responses. The leaderboard ranks bysummary.headlinewhen present and adds p90 latency, a score-vs-cost/latency scatter with the Pareto frontier, and per-source and source × category breakdowns. Every view is a shareable link, with keyboard navigation (j/k,m,1–4,d,o,?), the product site's design and theme switch, and a mobile layout. liteocr bench run --save-outputsalso writes the unified response as<doc>.jsonnext to<doc>.md, which the viewer uses for its layout overlay.- More public benchmarks in the combined dataset.
olmocr(40 AI2 olmOCR-bench PDFs, 205 rules, ODC-BY-1.0) andomnidocbench(40 pages across 10 document types, English and Chinese; index only — images and truth are fetched at a pinned revision bypython -m benchmark.adapters omnidocbenchbecause the data is research-only), joined with synthetic-v1 and ParseBench ascombined-v2(159 documents;combined-v1is unchanged). Upstream tests that cannot be expressed faithfully (math, baseline, positional absences, vertical table neighbours) are skipped and counted inconversion-stats.json, never dropped silently. A dataset self-check test proves every converted rule is satisfiable. Survey of academic benchmarks with licences at pinned revisions:docs/benchmarks/academic-benchmarks.md. - Gateway server:
liteocr serve(crates/liteocr-server). An HTTP gateway in front of every provider, the LiteOCR equivalent of the LiteLLM proxy:POST /v1/parse|ocr|extract(JSON or multipart,output_format,fallbacks),GET /v1/models,/v1/usage,/healthand Prometheus/metrics. Aliteocr.tomlconfig defines model aliases with ordered or round-robin fallback, provider keys asenv:references, and virtual keys with model allow-lists, monthly USD budgets and per-minute rate limits. Every request is logged as one JSON line (never document content, provider error text or secrets), and all errors share one JSON body. Clients cannot overrideapi_key/base_urlor read local files. Ships a multi-stage distrolessDockerfileandexamples/server/liteocr.toml; seedocs/SERVER.md. - Node.js / TypeScript SDK. The
liteocrnpm package injs/runs on a napi-rs addon over the same Rust core (crates/liteocr-node): asyncparse/ocr/extract(withfallbacks),Router, camelCase typed responses (index.d.ts),LiteOCRErrorsubclasses mapped from the coreErrorKind, and the pricing, model and scoring helpers. CI builds the addon and runs the typecheck andnode:testsuite; the release workflow builds prebuilt.nodebinaries as artifacts (npm publishing not wired yet, so build from source for now). Docs at/docs/typescript/. liteocr bench run --resume: every finished call is appended to<out>.partial.jsonl, so an interrupted or partly failed run continues where it stopped and only re-runs missing or failed (model, document) pairs.--dry-runprints the plan (calls, pages, list-price estimate) without calling any provider;--max-cost <usd>aborts before the first call when the estimate is higher;--retries Nre-issues documents after retryable errors (off by default, since a retried job may be billed twice). Result documents recordprovider_job_id,cache_hit,attempts,started_atanderror_kind, and the run ends with a summary line (calls, failures, cost, wall time).- Native-format compatibility (
output_format). A response can be rendered in a provider's own JSON shape instead of the unified one, so an integration already written against Reducto, Extend or LlamaParse can switch the underlying provider without rewriting its parsing code:ParseResponse::to_format("reducto")in Rust (liteocr_core::compat::{Format, render_parse, render_extract}), withDocumentRequest.output_formatcarrying and validating the choice. What is guaranteed is structural fidelity — key set, chunk/page and block counts, content strings, block-type vocabulary, coordinate units and billed pages — not byte equality; the always-null fields and the lossy type mappings are enumerated indocs/COMPAT.md, and each provider's fixture is round-tripped through its own renderer in the test suite. Extract-mode rendering is best effort. See ADR-13. output_formatin the Python SDK and the CLI.liteocr.parse(..., output_format="reducto")(andaparse,extract,aextract, plus the matchingRoutermethods) returns the vendor's own JSON as adictinstead of the dataclass;output_format=None(the default) or"liteocr"keeps the unified shape. The value is validated in the core before any network call — an unknown name raisesBadRequestErrorlistingliteocr | reducto | extend | llamaparse— the rendering happens in Rust (liteocr._core.render_parse/render_extract), and success callbacks still receive the dataclass. Overloads type the return (None→ dataclass,str→dict),liteocr.output_formats()lists the accepted values, andexamples/switch_provider_keep_format.pyshows a provider swap with the parsing code untouched. The CLI gains--output-format <vendor>onparse(with--format json; ignored with a warning on stderr otherwise) and onextract, andliteocr providers --jsonnow emits{"providers": [...], "output_formats": [...]}instead of a bare array.
Changed#
- Internal: the vision-LLM providers (Gemini, OpenAI, Anthropic) share
providers/vlm.rs; behaviour and request bodies are unchanged. - Adapter HTML→markdown table conversion no longer doubles backslashes, so LaTeX in table cells reaches the scorer as a parser would print it.
- Modes. Every call now names a mode —
parse(markdown + typed blocks),ocr(plain text with line/word boxes) orextract(a JSON object from a schema, with per-field confidence and citations) — and providers can only be swapped within a mode. The Python SDK exposesparse/aparse,ocr/aocr(now plain text, not markdown) andextract/aextract, the newTextResponse/ExtractResponsedataclasses, a mode-boundRouter(models, mode=...), and mode arguments onlist_models,resolve_model,set_pricingandestimate_cost; pricing is now per page per mode. The CLI gainsliteocr ocrandliteocr extract, andliteocr providersshows modes, per-mode prices and a--modefilter. The oldliteocr.ocr(which returned markdown) is nowliteocr.parse, andOcrResponseis nowParseResponse. Which models serve which mode is reported byliteocr.list_models(mode)andliteocr providers --mode <mode>. - README model table. The "Model names" section is regenerated from the registry and
pricing.json: every provider group carries its env var and verification status (live-verified vs docs-only), every model its modes, the default per mode and the list price per page forparse · ocr · extract.
Fixed#
- Extend
provider_options={"responseType": "url"}is now sent as theGET /parse_runs/{id}query parameter; it used to go in the request body, so the presigned-output path never triggered. Reducto and Extend url-typed results are now covered by live-captured fixtures and loopback tests.
Initial development - 2026-09-11#
Initial release.
Added#
- Rust core (
liteocr-core) — a unified request/response contract for document parsing:OcrRequestaccepting a path, bytes or URL, and anOcrResponsewithpages,blocks(normalised block types and 0..1 bounding boxes), document-levelmarkdown/text,usage,cost_usdandlatency_ms, identical across every provider.#![forbid(unsafe_code)]. - Providers — Reducto, Extend and LlamaParse, each talked to over plain
HTTPS with no vendored SDK, addressed by
"<provider>/<model>"model strings (reducto/standard,extend/parse_performance,llamaparse/cost_effective, …) with a per-provider default and aprovider_optionspass-through escape hatch. - Router — ordered fallbacks and round-robin load balancing across models, with per-model success/failure and latency stats; only provider, rate-limit and timeout errors trigger fallback.
- Pricing and cost tracking — an embedded, overridable
pricing.jsonprice table mapping model → per-page (or per-credit) USD, used to computecost_usdon every response. - Reliability primitives — retries with exponential backoff on 429/5xx and network errors, per-call timeouts, and whole-call deadlines that cover upload plus polling.
- Benchmark metrics — character similarity (the primary score), CER, WER, word-level F1/recall, reading-order agreement and a table-restricted score, all computed in Rust over NFKC-normalised text.
- CLI (
liteocr) —parse(markdown/text/json output, optional raw provider payload),providers(models, pricing and API-key status), andbench run/bench report/bench scorefor running the benchmark, scoring results and generating the leaderboard. - Python SDK (
liteocr) —ocr(), the asyncaocr(),Router, typed dataclasses (OcrResponse,Page,Block,BBox,Usage), the full error hierarchy,set_pricing(),list_models(), and success/failure callbacks. Fully typed, shipspy.typed, distributed as abi3 wheels for CPython 3.9+. synthetic-v1benchmark dataset (v1.1.0) — 39 deterministically generated documents across 13 categories (plain, headings, invoice, table, two-column, noisy scan, low resolution, multi-page PDF, skewed, dense, faded, receipt, complex table) with exact markdown ground truth, plus the generator that produces them byte-for-byte.- First leaderboard (
benchmark/LEADERBOARD.md) from a run over seven models across the three providers;bench rundisables provider result caches by default (--allow-cacheto opt out) so latency reflects real work.