ฮ™ฮ›ฮ™ฮŸฮฃ

Cleanse Dark Data for the AI Age

View on GitHub

What is Ilios?

Ilios (แผผฮปฮนฮฟฯ‚), ancient Greek for "to cleanse", is a high-performance document-to-markdown conversion API that unlocks dark data trapped in documents.

Most organizational data sits inaccessible in PDFs, images, and legacy formats โ€” invisible to modern AI systems. Before you can leverage vector databases, knowledge graphs, or RAG systems, your documents must be transformed into clean, structured markdown suitable for embeddings and ontological analysis.

Ilios v2 solves this with a fully local, zero-data-retention pipeline: documents are converted entirely in-memory by anydoc, a pure-Rust engine (~4ms median per document). No files are stored, no content is persisted, and no bytes ever leave your server โ€” all on the Bun runtime with native APIs.

v1 โ†’ v2: What Changed

v1 (Mistral + S3)v2 (Local Engine)
ConversionMistral OCR API (network)anydoc local Rust engine (in-process)
p50 latency~6.1 s~40 ms (150x faster)
Data retentionContent in DB + originals in S3None โ€” nothing stored
Third-party data sharingFiles uploaded to MistralNone โ€” bytes never leave the process
Per-page cost$0.01/page$0.00
StorageS3 (Tigris) + SQLite content blobsIn-memory only; ephemeral cache wiped per request
DatabaseSQLite/Turso with documents, batches, job queuePure Bun SQLite โ€” anonymous usage analytics only
Processing modelAsync worker threads polling a queueSynchronous in-process (faster than dispatch)
API frameworkHonooRPC with generated OpenAPI
Scanned/image PDFsSupported via OCRRejected (HTTP 415) โ€” by design, zero retention

Features

Installation

Deploy your own Ilios instance in under 60 seconds:

git clone https://github.com/tobalo/ilios.git
cd ilios
bun install
bun run db:push
bun run dev

Configure environment variables in .env based on .env.example. The API will be available at http://localhost:1337.

Why Ilios Matters

Modern AI infrastructure demands clean, structured data. Yet 80% of enterprise data remains trapped in unstructured formats โ€” PDFs, scanned documents, legacy archives.

The Dark Data Problem

Before you can:

...you must first cleanse your documents into machine-readable formats.

How Ilios Enables AI Readiness

1. Document Ingestion โ†’ Upload PDFs, Office docs, OpenDocument files, e-books, spreadsheets, or legacy formats
2. Local Conversion โ†’ anydoc parses bytes in-memory (~4ms) โ€” nothing touches disk
3. Markdown Output โ†’ Clean GitHub-Flavored Markdown returned directly in the response
4. Ephemeral Wipe โ†’ Request completes; no content retained anywhere
5. Vector Pipeline โ†’ Feed to embedding models, chunk for RAG, or enrich for knowledge graphs

Supported Formats

Powered by the anydoc engine, Ilios converts a wide range of document formats entirely locally and in-memory. Format detection is content-based (magic-byte signatures) with filename-extension fallback, so mislabeled files still convert correctly.

CategoryFormats
PDFpdf (text-based)
Word Processingdocx, docm, doc, odt, rtf
Presentationspptx, ppt, ppsx, odp
Spreadsheetsxlsx, xlsm, xls, ods, csv
E-Booksepub

Note: Image-only/scanned PDFs and image files require OCR and are rejected (HTTP 415) by design โ€” the local engine performs no network OCR, keeping zero data retention intact.

Authentication

API key authentication is optional but strongly recommended for production. When enabled via the API_KEY environment variable, all endpoints require authentication except public paths (/health, /docs, /openapi.json).

Using API Keys

Include your API key in the Authorization header with Bearer scheme:

Authorization: Bearer YOUR_API_KEY

Multi-Tenant ACL Support

Set multiple API keys (comma-separated) to support different teams or clients with isolated usage tracking:

API_KEY=team-alpha-key,team-beta-key,admin-master-key

Each key's operations are tracked independently in the database for billing and auditing. Usage endpoints automatically filter results to the authenticated key.

API Usage

Ilios v2 exposes a single synchronous conversion endpoint โ€” no queues, no status polling, no storage:

Convert Document

POST /v1/convert

Synchronous in-memory conversion via the local anydoc engine. Returns JSON with markdown content and metadata in milliseconds. Zero data retention โ€” content is never stored. Supports files up to 1GB (staged through an ephemeral cache that is wiped immediately). Accepts PDF, Word, PowerPoint, Excel, OpenDocument, RTF, EPUB, CSV, and more โ€” see Supported Formats.

Usage Summary

GET /api/usage/summary

Anonymous usage analytics: request counts, pages processed, bytes converted, and average processing time โ€” filtered to your API key.

Usage Breakdown

GET /api/usage/breakdown

Per-operation breakdown of conversion volume, latency, and cost.

Health Check

GET /health

Service health including database connectivity and engine status. No authentication required.

Quick Examples

Convert a Document

curl -X POST https://ilios.sh/v1/convert \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "[email protected]"

Response (zero retention)

{
  "id": "a54d311a-68ad-4641-a8c1-a84e3e1dd170",
  "content": "| name | role |\n| --- | --- |\n...",
  "metadata": {
    "model": "anydoc-local",
    "engine": "anydoc",
    "processingTimeMs": 5,
    "extractedPages": 38,
    "fileName": "data.csv",
    "fileSize": 102400
  },
  "retention": "none"
}

Note: v1's async endpoints (/api/documents/*, /v1/batch/*) were removed in v2 โ€” they required server-side document storage, which is incompatible with zero-data retention. For bulk workloads, convert files in parallel against /v1/convert; at ~40ms per document, batching is unnecessary.

Performance Benchmarks

v2 benchmark results: local anydoc engine and full HTTP endpoint (concurrent x5) across small/medium/large documents in CSV, RTF, DOCX, and PDF formats. For reference, the v1 Mistral-based pipeline measured p50 โ‰ˆ 6.1s on the same endpoint.

Full results โ€” latency percentiles, throughput, per-document breakdowns, and size analysis โ€” are available on the dedicated benchmarks page.

View Full Benchmark Results โ†’