$ open‑source · self‑hosted · MIT license

Compile any document into clean, LLM‑ready text.

DocCompiler is a self-hosted REST API that turns PDFs, Word docs, spreadsheets and CSVs into normalized, token-efficient text — so you stop paying to ship raw files to your models, and stop trusting a third party with your documents.

  • Laravel + MySQL
  • Docker-ready
  • Runs on your own hardware
doccompiler — compile
output 0 tokens saved

// what it does

Built to sit quietly inside your stack.

// self-hosted

Your infrastructure, your data

Install it on your own server. Documents are processed and discarded on hardware you control — nothing is sent to a third-party extraction API.

// format coverage

PDF, DOCX, XLSX, CSV, MD, TXT

One endpoint, every common document type. Legacy .doc and .xls are normalized automatically before extraction.

// ocr fallback

Scanned pages, handled

Each PDF page is checked for a real text layer. Pages without one are routed through OCR automatically — no flag to set, no job to babysit.

// queue-based

Never blocks your API

Built on Laravel Horizon. Large files, OCR jobs and spreadsheet parsing all run off the request/response cycle.

// mime verified

Extensions are never trusted

Every upload is checked against its real file signature before processing — the same defense-in-depth you'd want in your own code.

// production ready

Observability included

Health checks, queue monitoring and metrics ship with the project — point your existing Grafana or Filament panel at it and go.

// the pipeline

Five steps, one shape, every time.

  1. 01

    Upload

    Send any supported file to the REST API, with a bearer token issued from your own dashboard.

  2. 02

    Detect

    The real MIME type is sniffed from the file's contents and cross-checked against its extension.

  3. 03

    Extract

    The matching engine runs — native text extraction, spreadsheet parsing, or page-level OCR when needed.

  4. 04

    Normalize

    Headings, tables and structure are rebuilt into clean, consistent Markdown — regardless of source format.

  5. 05

    Respond

    You get back plain, structured text — ready to drop straight into a prompt, no file handling on your side.

// quickstart

Running in about a minute.

Clone the repo, bring up the stack, and issue yourself an API key from the included admin panel. No accounts, no external services, no per-page pricing.

terminal
git clone https://github.com/procodigo/doccompiler.git
cd doccompiler
cp .env.example .env
docker compose up -d
curl
curl -X POST http://localhost/api/v1/documents \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -F "[email protected]"