An Express server that exposes @llamaindex/liteparse as an HTTP parsing backend. It supports single-file parsing, page screenshotting, and document complexity estimation.
For a full production setup with built-in rate limiting (Redis), distributed tracing (OpenTelemetry → Jaeger), and metrics (OpenTelemetry → Prometheus → Grafana), see the Docker Compose example.
Prefer gRPC? This repo also ships
@llamaindex/liteparse-grpc— a gRPC server (and matching client) exposing the same LiteParse capabilities. See its README for details.
- Installation
- Quick start
- Docker
- Full server setup
- API specification
- Testing with the test script
- Related packages
npm install -g @llamaindex/liteparse-rest
# or
pnpm add -g @llamaindex/liteparse-restYou can also invoke it directly without installing:
npx @llamaindex/liteparse-restOnce installed, launch the server with:
liteparse-rest-serverThe server listens on port 5707 by default. Point a client at http://localhost:5707 and start hitting the API.
The published binary is the slim build — it removes built-in Redis caching, rate limiting and OpenTelemetry observability so it has no external dependencies. If you need those features, use the full server setup.
The repo ships a slim.Dockerfile that produces a self-contained image with no observability dependencies:
# Build the image
docker build -f slim.Dockerfile -t liteparse-rest .
# Run exposing port 5707
docker run -p 5707:5707 liteparse-restThe API is then available at http://localhost:5707.
If you want an all-in-one deployment with built-in observability, caching, and rate-limiting, follow the guide in examples/docker-compose.
The server exposes three endpoints:
| Method | Path | Description |
|---|---|---|
POST |
/parse |
Parse a file into JSON pages, text, or markdown |
POST |
/screenshots |
Render document pages as PNG images (NDJSON stream) |
POST |
/is-complex |
Estimate document complexity / need for OCR |
The full specification — request fields, query parameters, response shapes and error codes — is available in API_SPEC.md.
scripts/server-test.py is a self-contained script that uses uv to manage its own dependencies (httpx). Make sure the server is running before using it.
python scripts/server-test.py <command> <path> [options]Or, if uv is available, run it directly:
./scripts/server-test.py <command> <path> [options]./scripts/server-test.py file path/to/document.pdf# plain text
./scripts/server-test.py file path/to/document.pdf text
# markdown
./scripts/server-test.py file path/to/document.pdf markdown# Screenshot all pages — images saved to the current directory
./scripts/server-test.py screen path/to/document.pdf
# Screenshot specific pages (comma-separated, 1-based)
./scripts/server-test.py screen path/to/document.pdf pages=1,2,3Screenshots are saved as page_0.png, page_1.png, etc. in the current working directory.
./scripts/server-test.py is-complex path/to/document.pdfThis repository is a pnpm workspace containing:
| Package | Description |
|---|---|
@llamaindex/liteparse-rest |
This package — an Express HTTP server wrapping LiteParse |
@llamaindex/liteparse-grpc |
A gRPC server + client for the same LiteParse capabilities, with a bundled .proto schema |
MIT