LocalContextRouter – stop paying vision-token prices for text PDF pages
LocalContextRouter is a tool that detects whether a PDF page is text-based or image-based, routing text pages through a cheaper text-only LLM instead of an expensive vision model to reduce costs.
Background
- Many AI services (OpenAI, Anthropic, Gemini) charge per token, and image tokens (used when you upload a PDF page as a screenshot) cost far more than text tokens — sometimes 100× more — even when the image is just a scanned page of plain text.<br>- LocalContextRouter is an open-source tool that runs locally on your own machine. It intercepts PDFs before they reach a cloud AI, converts each page to text using a local OCR engine (Tesseract or something similar), and then sends only the extracted text to the API. This avoids paying the image-token penalty for documents that contain nothing but text.<br>- It works as a proxy: you configure your AI chat client (e.g., a browser extension or desktop app) to route PDF file uploads through LocalContextRouter, which strips the images and forwards plain text instead.<br>- The project targets cost-conscious developers, researchers, and power users who frequently feed PDFs into LLMs for summarization or question-answering and want to avoid needless expense. It does not help with image-heavy PDFs (scanned photos, diagrams, charts) where the visual content actually matters.