GitHub - xberg-io/xberg: A polyglot document intelligence framework with a Rust core. Extract text, metadata, images, and structured data from 101 formats (115 file extensions) plus code intelligence for 371 code languages. 15 language bindings — Rust, Python, Ruby, Java, Go, PHP, Elixir, C#, TypeScript — plus CLI, REST API, and MCP server.

Open original

Xberg is a single engine for detecting, reading, OCR’ing, and extracting text, tables, metadata, and structured data from over 100 document formats and 115 file extensions. It offers transcription, embeddings, layout reconstruction, schema-driven JSON extraction, and code intelligence via language bindings in Rust, Python, Go, Java, and more. You can run it as a library, CLI, REST API, or MCP server with configurable Cargo features.

  • One Rust-core engine handles 101 document formats (115 extensions) plus 371 programming languages for code intelligence
  • Ships as 15 language bindings (Python, Go, Java, Ruby, PHP, Elixir, C#, TypeScript, etc.) plus CLI, REST API, and MCP server
  • Combines OCR (Tesseract/PaddleOCR/VLM), layout reconstruction (PP-DocLayout-V3, RT-DETR), and table extraction (TATR, SLANet) with schema-driven JSON output via local or hosted LLMs
  • Runs GPU-free with multi-GB streaming support and safeguards against zip bombs and excessive nesting/compression

Xberg lets you feed any digital asset—a PDF, scanned image, spreadsheet, audio or video file, URL, archive or entire source tree—into one engine and get back clean text, tables, metadata and structured data. It handles format detection, OCR, transcription and content extraction in one shot. Under the hood it supports 101 document formats across 115 file extensions, 371 programming languages, six output formats (plain text, Markdown, Djot, HTML, JSON tree, or structured JSON with OCR metadata) and optional features like URL crawling, audio transcription via Whisper ONNX, embeddings, NER, summarization and schema-driven JSON extraction. You can call Xberg as a Rust, Python, Node.js, Go, Java, C#, Ruby, PHP, Elixir, Dart, Swift, Zig or Kotlin library; run it via CLI (12 commands from extract and batch to serve and mcp); deploy a REST API server with “xberg serve”; or spin up an MCP server for tool chaining. Cargo feature flags control extra capabilities—layout, URL ingestion, transcription, reranker—while prebuilt language packages and Docker images bundle common sets. The engine works without GPU, supports multi-GB streaming and guards against zip bombs, excessive compression or nesting depth. Integration guides cover Go (“go get …/packages/go@latest”), Java (Maven Central io.xberg:xberg), Elixir, Kotlin Android, Swift (SPM), Zig, C/C++ FFI and more. The CLI installs via brew or Docker (“ghcr.io/xberg-io/xberg:latest”) and exposes commands like extract, detect, cache_stats, serve and api. For each format it extracts text, tables, images, styles and metadata; OCR uses Tesseract, PaddleOCR or VLM backends with fallback chains; layout models PP-DocLayout-V3 and RT-DETR rebuild reading order; table models TATR and SLANet produce clean Markdown. Under “Full feature list,” Xberg breaks formats into categories—Word (.docx, .odt, .pages), spreadsheets (.xlsx, .ods), presentations (.pptx, .odp), e-books (.epub), scientific publications, images (.png, .tiff), advanced raster and vector formats, audio (.mp3, .wav) and video tracks (.mp4, .webm). It pulls in code intelligence (functions, imports, docstrings), embeddings (local ONNX or 165 provider-hosted), enrichment (keyword extraction, translation, redaction) and structured extraction via local or hosted LLMs—no manual prompt engineering needed.

Ask about this article