Repolode
CatchTheTornado

CatchTheTornado/text-extract-api

Self-hosted FastAPI service that converts PDFs, images and Office documents to Markdown or structured JSON, with OCR, local LLMs via Ollama and PII removal.

Open-source alternative to:Adobe AcrobatABBYY FineReader

Stars
3,184
Forks
279
Open issues
49
Last commit
11 months ago

What is it?

text-extract-api is a document extraction service that turns images, PDFs and Office files into Markdown text or structured JSON. It is built on FastAPI with Celery for asynchronous task processing and Redis for caching OCR results. Several OCR strategies are available, including EasyOCR, MiniCPM-V and Llama 3.2 Vision run through Ollama, and a remote strategy that calls an external marker-pdf server.

The pipeline can pass OCR output to an Ollama-hosted LLM with a custom prompt, for example to produce JSON or to remove personally identifiable information from invoices and reports. Results can be saved through pluggable storage profiles such as the local file system, Google Drive or Amazon S3. Docker Compose files are provided for CPU and GPU setups, and a CLI and a TypeScript client are included.

The project is aimed at teams that need document processing without sending files to outside cloud services. Data stays on the machine or server running the stack, though the remote marker strategy and cloud storage backends send data to the endpoints you configure.

Key features

  • 01Converts images, PDFs and Office documents to Markdown or JSON.
  • 02Offers EasyOCR, MiniCPM-V, Llama 3.2 Vision and remote marker-pdf OCR strategies.
  • 03Uses Ollama-hosted models to post-process OCR text and extract structured data.
  • 04Removes personally identifiable information through prompts.
  • 05Runs tasks asynchronously with Celery and caches OCR results in Redis.
  • 06Saves results to local disk, Google Drive or Amazon S3 via storage profiles.

Use cases

  • Turning scanned invoices or reports into structured JSON for downstream systems.
  • Redacting personal data from documents before sharing or archiving them.
  • Running document OCR on-premises where files cannot leave the network.
  • Building a document-ingestion API that feeds text into RAG or search pipelines.

Quick start

  1. 1

    Clone the repository

    git clone https://github.com/CatchTheTornado/text-extract-api.git
  2. 2

    Enter the project directory

    cd text-extract-api
  3. 3

    Start all services with Docker Compose

    docker-compose up --build

Things to know

  • Local OCR models and Ollama LLMs need substantial hardware, and the llama_vision strategy is very slow due to its 90B parameters.
  • The marker-pdf remote strategy is GPL3 and is not bundled, and its model weights have non-commercial restrictions.

Topics

FAQ

What is text-extract-api?
Self-hosted FastAPI service that converts PDFs, images and Office documents to Markdown or structured JSON, with OCR, local LLMs via Ollama and PII removal. text-extract-api is a document extraction service that turns images, PDFs and Office files into Markdown text or structured JSON. It is built on FastAPI with Celery for asynchronous task processing and Redis for caching OCR results. Several OCR strategies are available, including EasyOCR, MiniCPM-V and Llama 3.2 Vision run through Ollama, and a remote strategy that calls an external marker-pdf server.
Is text-extract-api free to use? What license does it have?
text-extract-api is open source under the MIT license. Check the license terms before using it in commercial products.
Is text-extract-api still maintained?
No commits for 6+ months. The last commit to text-extract-api was on Dec 8, 2025.
What can I use text-extract-api for?
Turning scanned invoices or reports into structured JSON for downstream systems. Redacting personal data from documents before sharing or archiving them. Running document OCR on-premises where files cannot leave the network. Building a document-ingestion API that feeds text into RAG or search pipelines.
How do I install text-extract-api?
Clone the repository: git clone https://github.com/CatchTheTornado/text-extract-api.git Enter the project directory: cd text-extract-api Start all services with Docker Compose: docker-compose up --build
Where can I get text-extract-api?
The source code and installation instructions are on GitHub: https://github.com/CatchTheTornado/text-extract-api

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects