Skip to main content

LibreChat is joining ClickHouse. Learn more

LibreChat

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.

Upload as Text pulls the text out of a file and adds it to your message, so the model reads the whole document rather than searching it. Reach for it when a file is small enough to fit in context and you want every line considered: a contract, a log, a source file, a spreadsheet export.

Attaching a file

Click + in the message composer and choose From Local Computer under Attach (or From SharePoint, if your server has it). You can also drag files onto the composer. You do not pick a destination: LibreChat looks at each file and decides how the model gets it.

  • Text, code, Markdown, CSV, JSON, Word, and Excel files are sent as extracted text.
  • Images, audio, video, and PDFs go to the model directly when its provider accepts them. On a provider that cannot take a PDF, LibreChat extracts the PDF's text instead.

If you turned on File Search or Run Code in the palette, those tools get the file only when a run actually needs it.

If your admin has turned on the older destination menu, you choose explicitly: Upload as Text sits alongside Upload to Provider (or Upload Image) and Upload for File Search. Some of these sit behind More upload options. Dropping several files onto the chat in this mode opens Select Upload Type with the same choices.

The composer palette open below the message box, with From Local Computer under Attach and the Tools list below itThe composer palette open below the message box, with From Local Computer under Attach and the Tools list below it

When you attach several files at once, duplicates and files over the per-file size limit are skipped and named in a notice, and the rest upload. The file-count and total-size limits still apply to what remains; if the remaining batch breaks either, none of it is uploaded.

Pasting long text

Paste more than 2,500 characters into the message box and LibreChat turns the paste into a text file named pasted-text.txt (then pasted-text-2.txt and so on), attached as text, and shows Attached as text. Your message box stays readable and the model still gets the exact paste. Select the file chip to Edit pasted text, or use Move back into message to put it inline again.

Pastes into an agent's question form stay inline, and if the upload fails LibreChat puts the text back in the message box. To keep long pastes inline, turn off Paste long text as a file under Settings > Chat > Sending. The setting is stored in your browser.

How the text is extracted

LibreChat tries these in order and uses the first that applies:

  1. OCR, if your admin configured an OCR service and the file type is one OCR handles (images, PDFs, Office documents, EPUB, OpenDocument). See OCR.
  2. The built-in document parser for PDF, DOCX, XLS and XLSX, ODT, and ODS files up to 15 MB. It reads the text layer only.
  3. Speech-to-text for audio files, if your admin configured STT.
  4. Plain text reading for anything that is already text: source code, Markdown, CSV, JSON, YAML, HTML, and so on.

Legacy .doc, PowerPoint, and EPUB files are not covered by the built-in parser; they need OCR, or the RAG API's text extraction if your admin set it up.

A scanned PDF or a photo of a page has no text layer, so without OCR there is nothing to extract and the upload fails with a message saying an OCR service is needed. A vision model can read the image directly instead if you send it with Upload to Provider.

How much of the file the model sees

Each file's text is cut at the file token limit, 100,000 tokens by default. Anything past that is dropped without warning, so if answers seem to ignore the end of a long document, this is the likely reason. You can lower or raise the limit for a conversation with File Token Limit in the model parameters; a larger limit costs more tokens on every message that includes the file.

When LibreChat keeps only the extracted text of a file and not the original, downloading it gives you that text as a .txt file.

For large documents or many files, file search is usually the better fit: it retrieves the relevant passages instead of sending the whole file every turn.

Setup

Upload as Text works out of the box. The explicit Upload as Text option depends on the context agent capability, which is on by default; an admin who customizes the capabilities list has to keep it. Admins control extraction, the token limit, and the upload menu style in fileConfig, and OCR in the ocr config.

How is this guide?