Skip to content
Trending storyDeveloping

OpenRouter guide: extracting PDF tables with an LLM and strict JSON schemas

1 article1 sourcesince Oct 28Last article 2h ago ·

Overview

AISummary of 1 article

OpenRouter's blog describes extracting tables from PDFs by sending the file to a model that can read files, along with a strict JSON schema for one table row.

Field descriptions handle cleanup, such as turning negative values in parentheses into negative numbers. OpenRouter says every model that read the PDF directly got all 644 cells right across five test PDFs, including two scans.

The failures came from the parsing route. OpenRouter says a scan sent through the free cloudflare-ai parser returned zero rows with no error, and that long tables can stop at the output token limit. The guide therefore says to reject empty results and any response with finish_reason "length".

Written by AI from the articles below · updated Oct 28, 9:16 PM ET

Check the sources:

Latest developmentOct 28, 8:00 PM ET
How to extract tables from a PDF with an LLM

Article timeline

The articles in this story. Times are ET.

Oct 28
  1. OpenRouter BlogOfficial
    How to extract tables from a PDF with an LLM

    AIOpenRouter says a strict JSON schema for one table row turns PDF tables into typed rows, with field descriptions handling cleanup such as negative values in parentheses. Its tests on five PDFs, including two scans, found every model that read the PDF directly got all 644 cells right. Failures came from the parsing route: a free cloudflare-ai parser returned zero rows with no error on a scan, and long tables can stop at the output token limit, so the guide says to reject empty results and any response with finish_reason "length".

Heat Trend

Not enough continuous observations to show a trend yet.