# Vision and Document Understanding

> Send images, screenshots and PDFs to models for description, extraction, charts and visual question answering. Free notes, key concepts, resources and a mini...

Canonical: https://www.internhack.in/roadmaps/tracks/ai-engineer/vision-inputs
Last updated: 2026-11-28

Send images, screenshots and PDFs to models for description, extraction, charts and visual question answering.

Intermediate · about 4 hours · difficulty 3/5

Learn first: [Structured Outputs and JSON Schema](https://www.internhack.in/roadmaps/tracks/ai-engineer/structured-outputs)

Most frontier models accept **images and PDFs** as input alongside text. This unlocks invoice extraction, screenshot debugging, chart reading, form processing and visual search.

### How it works in the API

You attach an image as base64 data or a URL in a content block next to your text prompt. PDFs can often be sent directly; the provider renders pages and may also extract text. Images are converted into tokens, so **resolution affects cost and latency**. Resize large images to what the task actually needs.

### Good practices

- Put the image before the question and say exactly what to extract.
- Combine vision with **structured outputs** for extraction: a schema for invoice number, date, totals and line items.
- For multi-page documents, process page by page or chunk, then merge.
- Validate extracted numbers with code (do line items sum to the total?).

### Limitations

Models can misread small text, count objects poorly, confuse spatial relationships and hallucinate details in blurry images. For high-accuracy OCR at scale, a dedicated OCR or document parsing service may still be cheaper and more reliable, with the model handling interpretation.

### Multimodal embeddings

Models such as CLIP-style embeddings place images and text in one vector space, enabling "search photos by description" and multimodal RAG.

### Good enough to move on

You can extract structured data from a batch of receipts or invoices with a vision model, validate it with code, and report accuracy against hand-labelled ground truth.

## Key concepts

- **Image and PDF content blocks**
- **Resolution, tokens and cost**
- **Structured extraction from images**
- **Multi-page document processing**
- **Vision limitations**
- **Multimodal embeddings**

## Mini project

Build a receipt scanner: upload photos, extract merchant, date, total and line items into a Pydantic or Zod schema, check that the line items sum to the total, and flag mismatches for review.

## Check yourself

Why should you verify a vision model's extracted invoice total with code instead of trusting it?

## Free resources

- [Anthropic docs: vision](https://docs.anthropic.com/en/docs/build-with-claude/vision) (Anthropic)
- [OpenAI docs: images and vision](https://platform.openai.com/docs/guides/images-vision) (OpenAI)
- [Gemini API: image understanding](https://ai.google.dev/gemini-api/docs/image-understanding) (Google)

Previous: [Distillation and Small Models](https://www.internhack.in/roadmaps/tracks/ai-engineer/distillation) · Next: [Speech, Voice Agents and Realtime Audio](https://www.internhack.in/roadmaps/tracks/ai-engineer/speech-voice)

## More in Multimodal AI

- [Vision and Document Understanding](https://www.internhack.in/roadmaps/tracks/ai-engineer/vision-inputs)
- [Speech, Voice Agents and Realtime Audio](https://www.internhack.in/roadmaps/tracks/ai-engineer/speech-voice)
- [Image and Media Generation](https://www.internhack.in/roadmaps/tracks/ai-engineer/image-generation)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [AI Engineer Roadmap](https://www.internhack.in/roadmaps/tracks/ai-engineer)
