Module 1 · Lesson 6 of 6

Images and PDFs as input

How the contract is sent
Contract PDF, 10 pagesContract PDF10 pagesApp, prepares the file, NOWAppprepares the filetext + a tableNOWModel, reads text and imagesModelreads text and images
  • Contract PDF — 10 pages — healthy
  • App — prepares the file — healthy — NOW — text + a table
  • Model — reads text and images — healthy
  • File or prompt
  • Answer
Step 1 of 4

Step 1 of 4 · App

Done: A 10-page contract arrives as a PDF

What happens
Each page holds about 500 words. Page 7 also holds a signed table.
Why
A PDF can hold real text, pictures of pages, or both.
What changes
The app decides how to send it.
Next
Each page becomes an image of 1,000 × 1,400 pixels

Event log

3 more to go. Press a line to go back to that step.

Tokens for the file
–
Cost of the file
–
example price
Signed table on page 7
–

Tokens for each page

The app has not prepared the pages yet.

Step 1 of 4: App. A 10-page contract arrives as a PDF. Each page holds about 500 words. Page 7 also holds a signed table.

What this simplifies. The page sizes, words and price are examples. Image tokens use one provider's published rule of thumb, about width × height ÷ 750; others count differently, and most shrink very large images first.

Many models read images as well as text. An image is cut into small patches, and the patches are counted as , like words. So a bigger picture costs more tokens, takes more of the , and takes longer to read.

A PDF can hold real text, pictures of pages, or both. Text pulled from it is the cheapest way to send words, but it loses layout: a table becomes loose numbers, and a signature disappears.

A scanned PDF has no text at all, only pictures of text. It must go as images, or through OCR first: a step that reads the text out of the pictures.

The usual plan is text where words are enough. Add an image only where the layout matters, such as a table, a chart or a signature. Shrink images to the size the question needs.

Example. In the picture, a 10-page contract costs 18,670 tokens as page images and 6,670 as text. Text plus one image of the signed page costs 7,870.

In system design: Count image tokens before you send them, send text where words are enough, and add images only where the layout matters.

Check yourself

A model must check that a 30-page lease is signed on its last page. Sending all 30 pages as images is slow and costly. What is better?