**The fast, precise document-intelligence engine β for every language.**
Point Xberg at anything β a PDF, a scanned image, a spreadsheet, an audio file, a URL, a whole archive, or a source tree β and get back clean text, tables, metadata, and structured data. One engine handles format detection, reading, OCR, and extraction, so you never stitch a pipeline together from a dozen libraries.
**101 formats Β· 115 file extensions** Β· **371 code languages** Β· **15 language bindings** Β· **6 output formats** Β· OCR Β· transcription Β· embeddings
The fastest, most precise open-source document and PDF-to-Markdown engine β [see the benchmarks](https://xberg.io/benchmarks).
[Install](#installation) Β· [What you get](#what-you-get) Β· [Capabilities](#capabilities) Β· [CLI](#cli-reference) Β· [Docs](https://docs.xberg.io)
Xberg is the next iteration of Kreuzberg. Same document-intelligence engine, rebuilt and rebranded under a fresh v1 line.
What you get
Point Xberg at anything β a PDF, a spreadsheet, a scanned image, an audio file, a URL, an archive, a source tree β and get back clean, structured content you can use right away. One core does the format detection, reading, and extraction, so you don't assemble a pipeline yourself. Call it from Rust, Python, Node.js, Go, Java, C#, Ruby, PHP, Elixir, Dart, Swift, Zig, WASM, Kotlin, or C FFI, and run it as a library, CLI tool, REST API, or MCP server.
Capability
What you get
101 document formats
PDFs, Office, images, HTML, email, e-books, scientific publications, structured data across 115 file extensions β intelligent MIME detection, streaming for multi-GB files.
URLs & the web
Point Xberg at an http(s) URL β it fetches and extracts a single document, or crawls and follows links (Auto / Document / Crawl modes via the crawlberg engine). Requires the url-ingestion feature.
Audio & video transcription
Speech-to-text from MP3, M4A, WAV, WebM, and MP4 tracks via Whisper ONNX (tiny β large-v3). Requires the transcription feature.
Archives, traversed
List and recursively extract nested .zip, .tar, .gz, .7z β documents inside documents β guarded by zip-bomb, compression-ratio, and nesting-depth limits.
OCR on demand
Tesseract, PaddleOCR, Sceptre, Candle, or VLM backends β fallback chains, confidence scores, language auto-detection, extensible via plugins.
Layout & tables
ML layout models (PP-DocLayout-V3, RT-DETR) and table structure (TATR, SLANet) reconstruct reading order and cell grids for clean Markdown.
Code intelligence
Functions, classes, imports, symbols, docstrings from 371 programming languages. Syntax-aware chunking for RAG pipelines.
Embeddings & search
Local (ONNX) or provider-hosted embeddings (165 providers via liter-llm), sparse and late-interaction, cross-encoder reranking.
Enrichment
NER, keyword extraction (YAKE/RAKE), summarization, translation, redaction, page classification, QR detection, language detection, token reduction (TOON).
Structured extraction
Schema-driven JSON straight from any document via local (Ollama, LM Studio, vLLM) or hosted LLMs β no prompt engineering.
6 output formats
Plain text, Markdown, Djot, HTML, JSON tree, or Structured (JSON with OCR metadata and bounding boxes).
Capabilities marked requires a feature are Cargo feature flags on the core crate (url-ingestion, transcription, reranker, layout/ORT). Prebuilt language packages and the Docker image bundle the common set; a from-source build enables only what you select.
Installation
Language Packages
Python
pip install xberg
See [Python README](https://github.com/xberg-io/xberg/tree/main/packages/python) for full documentation.
Node.js / TypeScript
npm install @xberg-io/xberg
See [Node.js README](https://github.com/xberg-io/xberg/tree/main/crates/xberg-node) for full documentation.
Rust
cargo add xberg
See [Rust README](https://github.com/xberg-io/xberg/tree/main/crates/xberg) for full documentation.
Go
go get github.com/xberg-io/xberg/packages/go@latest
> β οΈ The repository root is not a Go module β `go get github.com/xberg-io/xberg` will fail.
> Always target the `/packages/go` subdirectory as shown above.
See [Go README](https://github.com/xberg-io/xberg/tree/main/packages/go) for full documentation.
Java
Available on Maven Central as `io.xberg:xberg`. See [Java README](https://github.com/xberg-io/xberg/tree/main/packages/java) for the dependency snippet.
C#
dotnet add package Xberg
See [C# README](https://github.com/xberg-io/xberg/tree/main/packages/csharp) for full documentation.
Ruby
gem install xberg
See [Ruby README](https://github.com/xberg-io/xberg/tree/main/packages/ruby) for full documentation.
PHP
composer require xberg-io/xberg
See [PHP README](https://github.com/xberg-io/xberg/tree/main/packages/php) for full documentation.
Elixir
Add `{:xberg, "~> 1.0"}` to your `mix.exs` dependencies. See [Elixir README](https://github.com/xberg-io/xberg/tree/main/packages/elixir) for full documentation.
WebAssembly
npm install @xberg-io/xberg-wasm
See [WebAssembly README](https://github.com/xberg-io/xberg/tree/main/crates/xberg-wasm) for full documentation.
Kotlin (Android)
Available on Maven Central as `io.xberg:xberg-android`. See [Kotlin README](https://github.com/xberg-io/xberg/tree/main/packages/kotlin-android) for the dependency snippet.
Swift
Add via Swift Package Manager. See [Swift README](https://github.com/xberg-io/xberg/tree/main/packages/swift) for full documentation.
Dart / Flutter
dart pub add xberg
See [Dart README](https://github.com/xberg-io/xberg/tree/main/packages/dart) for full documentation.
Zig
Add via `zig fetch`. See [Zig README](https://github.com/xberg-io/xberg/tree/main/packages/zig) for full documentation.
C/C++ (FFI)
Build from source as part of this workspace. See [C (FFI) README](https://github.com/xberg-io/xberg/tree/main/crates/xberg-ffi) for full documentation.
Run in API, CLI, or MCP modes. See [Docker guide](https://docs.xberg.io/guides/docker/) for examples.
REST API Server
xberg serve --host 0.0.0.0 --port 8000
One POST endpoint handles all formats. Returns JSON or Markdown. Stream large files. See [API server guide](https://docs.xberg.io/guides/api-server/).
MCP Server
xberg mcp --transport stdio
9 tools (extract, extract_batch, detect_mime_type, cache_stats, list_formats, cache_clear, get_version, cache_manifest, cache_warm). 3 prompts (extract_document, extract_with_ocr, semantic_search). 4 resources (formats, models, OCR languages, embedding presets).
Add to Claude Desktop or Cursor: