OCR for Documents
Read the text in images, scans, and complex documents when files are added to a conversation or an agent as text.
OCR lets LibreChat read text that is only present as pixels: a photo of a receipt, a scanned contract, a PDF made from screenshots. When your admin has set up an OCR service, files added as text go through it first, so the model gets the words instead of an empty result.
Where OCR applies
OCR runs on files whose text is put into the model's context:
- Upload as Text in chat, on deployments that show the explicit upload menu. See Upload as Text.
- File Context in the Agent Builder, where the extracted text is included in the agent's context on every message.
The file types it handles by default are images (JPEG, PNG, GIF, WebP, HEIC, HEIF), PDF, Word, PowerPoint, Excel, EPUB, and OpenDocument files. Other files skip OCR and use the normal text extraction.
With the default From Local Computer entry, what happens depends on where the file is routed. Images and PDFs the provider accepts are sent to the model directly and skip OCR. A file routed to text instead (a Word document, for example, or a PDF your admin routes to text) is extracted the same way as Upload as Text, so it goes through OCR when OCR handles its type.
Without OCR
Text extraction still works without an OCR service. LibreChat's built-in parser reads PDF, DOCX, XLS and XLSX, ODT, and ODS files up to 15 MB that have a real text layer, which covers most documents exported from an editor. Legacy .doc, PowerPoint, and EPUB files need OCR. Nor can the parser read an image: a scanned PDF or a photo of a page fails with a message that the document may be image-based and needs an OCR service.
If OCR is configured but the service errors on a document, LibreChat falls back to the built-in parser for that file.
OCR services
Admins choose one strategy:
- Mistral OCR through Mistral's API. This is the default strategy.
- Mistral OCR deployed on Azure AI Foundry.
- Mistral OCR deployed on Google Cloud Vertex AI.
- The local document parser only, with no external service. This reads text layers but not images.
With any of the Mistral options, file contents are sent to that service for processing, so its data handling terms apply.
Upload to Provider instead
Many models can read images and PDFs themselves. Sent to the provider as an attachment, the file is parsed by the provider, which keeps layout and images that text extraction loses. The default uploader does this automatically for images and PDFs when the provider supports them; with the older upload menu, choose Upload to Provider in the composer.
Providers that accept files this way: OpenAI, Anthropic, Google and Vertex AI, AWS Bedrock, Mistral, DeepSeek, Moonshot, OpenRouter, xAI, and custom endpoints. Azure OpenAI accepts PDFs this way only when the Responses API is turned on in the conversation parameters; with Chat Completions it takes images only.
What each provider accepts differs:
- All of them take images and PDFs.
- Google, Vertex AI, and OpenRouter also take audio and video.
- AWS Bedrock also takes CSV, DOC, DOCX, XLS, XLSX, HTML, TXT, and Markdown, up to 4.5 MB per document. PDFs for Claude 4 and later, and PDFs and DOCX for Nova, can go up to 32 MB unless your admin set a lower file size limit. See AWS Bedrock.
Setup
OCR is off until an admin adds an ocr section to librechat.yaml; the strategies, keys, and endpoints are described in the OCR config reference. Which file types are sent to OCR is set with fileConfig.ocr.supportedMimeTypes in fileConfig. Agents also need the ocr capability, which is on by default.
How is this guide?
Upload Files as Text
Put the full text of a file into your message so the model reads all of it, with any model and no file search setup.
Image Generation & Editing
Generate and edit images by chatting with an agent that has an image tool, using OpenAI, Gemini, Flux, or a local Stable Diffusion server.