URL 抓取需启用 url-ingestion 特性,语音转写需启用 transcription 特性,默认不包含;Go 必须指向 /packages/go 子目录,直接 go get 仓库根路径会失败;Whisper 转写依赖 ONNX 模型(tiny 到 large-v3),需另行准备。
xberg
xberg-ioMIT活跃维护多语言文档智能解析引擎,能从 100 多种格式中提取文本、表格和元数据,并支持 OCR、语音转写和代码理解,适合为 RAG 流程准备高质量数据。
The fast, precise document-intelligence engine for every language: text, tables and metadata from 100+ formats, with OCR, transcription and code intelligence.
pip install xberg
brew install xberg-io/tap/xbergREADME 未说明显存或 GPU 要求;OCR 与 Whisper 转写为可选特性,需按需启用。
一个引擎搞定 100+ 格式的文档解析,直接输出干净文本、表格和元数据
多语言文档智能解析引擎,能从 100 多种格式中提取文本、表格和元数据,并支持 OCR、语音转写和代码理解,适合为 RAG 流程准备高质量数据。
核心能力
- 统一处理 PDF、Office、图片、HTML、邮件等 107 种格式
- 内置 OCR 与 Whisper 语音转写,无需另接管线
- 支持 http(s) URL 抓取,可单页提取或爬取跟随链接
- 提供 15 种语言绑定,可作库、CLI、REST API 或 MCP 服务
- 输出 JSON、Markdown 等 6 种结构化格式
容易踩的坑
- v1.3.10最新正式版2026-10-13 · 2026-10-13 19:39 UTC
Fixed
- (pdf): a margin-note column beside a justified main column is read as its own block. A main column set as one span per line and wider than 55% of the page (375 pt of 595 pt) had every line discarded as full-width furniture, so the two-column repair never saw a column beside the notes, and its bands were cut at every body line. The margin label was placed after the first body line and the following lines alternated between the columns. Spans that do not cross the split are no longer furniture; the same holds with the notes on the left. (GH#2109)
- (pdf): prose that runs across a table's inner gutter is no longer split between columns. A bordered two-column
table beside a margin note let the table's gutter become a page-level column cut, and the full-width paragraphs
above and below it were scattered over both groups, so the opening paragraph was read after a lower heading and a
short last line such as
2017):came before its own paragraph. A column cut is now refused when two or more continuous lines have at least 60 pt of ink on each side of it. (GH#2110) - (deps): the unmaintained
unsafe-libyamlis gone. YAML parsing moved fromserde_yaml_ngtoyaml_serde0.10.7, clearing RUSTSEC-2024-0449 without an ignore entry. (GH#2108) - (deps):
ortis pinned to exactly2.0.0-rc.13. The caret requirement let a fresh resolve pick rc.14, whose session builder needs anEnvironment, breaking downstream builds. - (swift): the iOS libraries build again. A workflow-wide
MACOSX_DEPLOYMENT_TARGETmade the Tesseract CMake build compile iOS objects as macOS, so linking failed;xberg-tesseractnow ignores the variable for iOS targets. - (elixir): the NIF load check accepts BEAM-provided
enif_*symbols. Release builds of the NIF no longer fail thedlopenprobe on symbols only the BEAM supplies. - (php): the Linux extension links ONNX Runtime dynamically. The statically linked runtime needed GCC 13 libstdc++
symbols that the zigbuild toolchain replaces with libc++, so
xberg.socould not load on Debian 12.libonnxruntimenow ships besidexberg.so, and the release gate fails on unversioned undefined C++ symbols. - (zig): trait-bridge callbacks no longer crash when they return a string. The generated vtable thunks declared
char **out-parameters as 16-byte optionals, so registering a post-processor segfaulted. Regenerated with alef 0.110.6. - (ci): lint and e2e jobs are green again. The ai-rulez generator is built with
GOWORK=off, governance uses ai-rulez 5.1.0, the integration npm lockfiles match vitest 5, the Ruby e2e lockfile matches the gemspec, and the bounded-read andstrict_parsetests followzip9.0.2 and the plain-text fallback.
Zig
Add to your
build.zig.zon:.dependencies = .{ .xberg-zig = .{ .url = "https://github.com/xberg-io/xberg/releases/download/v1.3.10/xberg-zig-v1.3.10.tar.gz", .hash = "xberg-1.3.10-iV1GruJBQxpms3lJnXWSngd-Ar6lftA1e3F5io7_jwah", }, }, - v1.3.92026-10-13 · 2026-10-13 04:04 UTC
查看更新说明
Added
- (config):
strict_parsecontrols what happens when a text-like document cannot be parsed in its own format. By default (false), a YAML, JSON, TOML or XML file that fails to parse, an XML or SVG file that tripssecurity_limits.max_entity_length, and a CSV or TSV file that tripssecurity_limits.max_table_cellsare extracted as plain text instead of failing, and the reason is recorded inprocessing_warnings(sourceparse-fallback). Plain-text recovery is truncated tosecurity_limits.max_content_sizewith a warning. Setstrict_parse = true(CLI--strict-parse true, environmentXBERG_STRICT_PARSE) to keep the error. The limits are not loosened, and limits aimed at hostile input (archive size, nesting, XML depth) still fail the extraction.
Changed
- Updated dependencies, including
tree-sitter-language-pack1.22.1 (25 refreshed grammars),zip9.0.2,biblib0.10,html-escape0.3 andunhwp0.19.ortstays at 2.0.0-rc.13 because rc.14 requires anEnvironmentfor every session builder.
Fixed
- (extraction): a Helm template or other unparseable YAML, JSON, TOML or XML file no longer fails the extraction.
The content is returned as plain text with a warning;
strict_parse = truerestores the error. (GH#2100) - (extraction): an oversized XML entity or table no longer discards a text file. A CSV over
security_limits.max_table_cellsor an XML or SVG file oversecurity_limits.max_entity_lengthis extracted as plain text with a warning naming the limit that tripped; both limits remain adjustable throughsecurity_limits. (GH#2101) - (release): the Helm chart is published even when the CLI image build fails. The chart publish was gated on the
aggregate result of the image manifest job, so a CLI image leg timing out skipped the chart for 1.3.6 to 1.3.8 while
the container images shipped. It is now gated on the
xbergandxberg:<version>-coremanifests resolving, the only images the chart references. (GH#2106) - (pdf): image bounding boxes are correct for images drawn inside a Form XObject with a
/Matrix. The form/Matrixwas applied after the page transform instead of before it, so the form's page translation was scaled by its own matrix andExtractedImage.bounding_boxlanded in the wrong place (a regression since 1.2.7). (GH#2103) - (pdf): a narrow margin-note column is read before the main text again. A column of notes set on its own leading beside the main text (no note line shares a baseline with a body line) gave the two-column repair too few gutter votes once a table's grid rows stopped voting, so the page was read line by line across both columns and the margin label was welded to the main heading. A page whose only whitespace corridor is a gutter narrower than the native XY-cut's 15 pt valley is now split at that corridor. (GH#2102)
- (rendering): a block with many inline annotations renders in linear time. Building the inline nodes of one paragraph rescanned every later annotation for each annotation, so Markdown or chunked extraction of a block dense with emphasis, code spans and links grew quadratically (1 MiB: 29 s, 4 MiB: over 400 s). The scan now stops at the end of the annotated span. The output does not change. (GH#2099)
- (pdf): two-column pages whose column baselines differ by up to 1pt are read in column order again. The XY-cut
line grouping measured gaps between spans in
yorder, so a right-column line set slightly higher sorted first and merged with the left column's line into one line, which the column split then sent to one side. Spans are now ordered byxbefore gaps are measured, and a gap is measured from the line's rightmost edge so far. A column cut that would separate short label/value rows whose baselines differ slightly is refused, so key-value rows and table rows read row by row. (GH#2097) - **(pptx, ocr): plain output of a PPTX file has the OCR text
- (config):
- v1.3.82026-10-11 · 2026-10-11 01:33 UTC
查看更新说明
Release v1.3.8
Zig
Add to your
build.zig.zon:.dependencies = .{ .xberg-zig = .{ .url = "https://github.com/xberg-io/xberg/releases/download/v1.3.8/xberg-zig-v1.3.8.tar.gz", .hash = "xberg-1.3.8-iV1GrlVmNRooXyYZFEm39J4IiCtnVuSo-Pv5WLe-btCe", }, }, - v1.3.72026-10-09 · 2026-10-09 07:58 UTC
查看更新说明
Added
- (pdf): pre-extracted spans can use canonical page reading order.
order_page_spansapplies tagged structure, article-thread, and geometric ordering without parsing page content a second time, including for layer-filtered text. - (ocr): failed PDF OCR pages are reported as a typed list in every binding.
ExtractedDocumenthas a newocr_page_failuresfield. It is absent (None) when no page failed. EachOcrPageFailuregives the 1-basedpage, the backenderrortext, andrecovered, which istruewhen the page still has content from native text or from its embedded images. When an automatic OCR run of selected pages fails as a whole, each selected page has a record. The records were a JSON array undermetadata.additional["ocr_page_failures"]; that key is no longer set. The warnings do not change. (GH#2064)
Changed
- (benchmarks): cold-process and warm in-process latency are reported as separate regimes. Opt-in steady-state Xberg runs retain model sessions across iterations, publish a separate cold-start probe, and remain excluded from cross-framework rankings until competitors expose equivalent persistent-process adapters.
- (batch): default in-memory extraction avoids no-op cache work. Engines without an injected cache backend no longer hash every byte input or serialize completed results for a cache that discards them, reducing CPU time and transient allocations without changing extractor or OCR cache behavior.
Fixed
-
(node): extraction works with
AsyncLocalStorageand async hooks enabled. Node bindings heap-pin extraction futures before creating their JavaScript promises, avoiding a synchronous stack overflow on Node 22 and later. -
(pdf, ocr): Arabic and Hebrew extraction preserve logical reading order. Tagged native PDFs use trustworthy structure order without reversing table cells, and Tesseract output orders mixed-direction lines and tables from their local text direction and geometry. Sparse whole-image RTL OCR also retries a single-block segmentation mode when it recovers more strong-script tokens without materially reducing confidence, and mixed Arabic/Latin scans recover identifiers only when a bounded English crop provides compatible evidence.
-
(benchmarks): benchmark provenance is bound to the executable that actually ran. Clean-checkout runs now reject stale Xberg binaries whose embedded build identifier does not match the repository commit, and machine-readable
xberg versionoutput includes that identifier for auditability. -
(doc): legacy Word documents preserve headers, footers, footnotes, comments, and text boxes. Non-body stories are now emitted with their document layers and respect the existing header, footer, and footnote filters instead of being dropped whenever the document also contains body text. (GH#2054)
-
(php): Linux packages run on Debian 12 and other glibc 2.36 systems. Release artifacts are built against the declared ABI floor, reject newer GLIBC, GLIBCXX, or CXXABI requirements, and are load-tested in Debian 12 before publication. (GH#2060)
-
(ocr): columned prose and punctuation fragments are no longer fabricated as tables. Long, sparse newsletter columns remain ordinary text in both layout and non-layout extraction, while punctuation-only scan regions fall back to paragraph output without losing recognized content.
-
(ocr): layout extraction preserves scanned-PDF recognition settings. Scanned PDFs no longer force Tesseract into whole-image single-block segmentation when layout assembly has detected regions, while known scans keep their sparse-text segmentation and source-resolution preprocessing hints.
-
(typst): tables wrapped in figures are preserved. A
#table(...)nested inside a#figure(...), including through analign(...)wrapper, now reaches structured and rendered output instead of being discarded with the figure body. -
**(latex): m
- (pdf): pre-extracted spans can use canonical page reading order.
- benchmark-run-37864705744Benchmark Results 2026-10-09 (bca0e2c)pre-release2026-10-09 · 2026-10-09 05:51 UTC
查看更新说明
Comparative benchmark results from workflow run 37864705744.
Commit: bca0e2c12ba0ad90c045e31db814876487b2b56b Date: 2026-10-09
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
Xberg
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.
107 formats · 141 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.
Install · What you get · Capabilities · CLI · Docs
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 |
|---|---|
| 107 document formats | PDFs, Office, images, HTML, email, e-books, scientific publications, and structured data across 141 file extensions, with intelligent MIME detection and bounded extraction controls. |
| 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, 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 Docling DocTags, plus registered custom renderers. |
| Runs anywhere | Library, CLI (14 commands), REST API (xberg serve), MCP server, Docker, Helm — CPU by default, no GPU required. Content-hash caching, parallel batch, per-file timeouts. |
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
pip install xberg
For archived versions and the PyPI storage fallback:
pip install xberg --extra-index-url https://xberg-io.github.io/python-wheels/simple/
PyPI keeps all releases in the current minor and the latest stable patch of each older minor. See the permanent archive and retention policy.
See Python README for full documentation.
npm install @xberg-io/xberg
See Node.js README for full documentation.
cargo add xberg
See Rust README for full documentation.
go get github.com/xberg-io/xberg/packages/go@latest
⚠️ The repository root is not a Go module —
go get github.com/xberg-io/xbergwill fail. Always target the/packages/gosubdirectory as shown above.
See Go README for full documentation.
Available on Maven Central as io.xberg:xberg. See Java README for the dependency snippet.
dotnet add package XbergIo.Xberg
See C# README for full documentation.
gem install xberg
See Ruby README for full documentation.
composer require xberg-io/xberg
See PHP README for full documentation.
Add {:xberg, "~> 1.0"} to your mix.exs dependencies. See Elixir README for full documentation.
npm install @xberg-io/xberg-wasm
See WebAssembly README for full documentation.
Available on Maven Central as io.xberg:xberg-android. See Kotlin README for the dependency snippet.
Add via Swift Package Manager. See Swift README for full documentation.
dart pub add xberg
See Dart README for full documentation.
Add via zig fetch. See Zig README for full documentation.
Build from source as part of this workspace. See C (FFI) README for full documentation.
CLI & Deployment
brew install xberg-io/tap/xberg
Windows users can install the same binary through Scoop:
scoop bucket add xberg https://github.com/xberg-io/scoop-bucket
scoop install xberg
14 commands: extract, batch, detect, formats, version, cache, tree-sitter, doctor, serve, mcp, api, embed, chunk, and completions.
See CLI usage guide for detailed documentation.
docker pull ghcr.io/xberg-io/xberg:latest
Run in API, CLI, or MCP modes. See Docker guide for examples.
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.
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:
{
"mcpServers": {
"xberg": { "command": "xberg", "args": ["mcp"] }
}
}
AI Coding Assistants
Install the Xberg plugin from xberg-io/xberg. Ships extraction APIs, OCR backends, configuration, and language conventions.
The bundle targets Claude Code, Codex, Cursor, Gemini CLI, Kimi, OpenCode, Factory Droid, Hermes, Pi, Agent Plugins and GitHub Copilot CLI. Read the plugin guide for runtime resources, CLI prerequisites and configuration. MCP-capable adapters expose the product's tools; Hermes uses a local stdio bridge and explicitly selected skills. Pi loads skills and prompt templates and requires the product CLI for executable operations.
Install only the public Agent Skills, without a plugin or MCP registration, using the skills CLI:
npx skills add xberg-io/xberg --list
npx skills add xberg-io/xberg
Choose the skills and target agents interactively. Installing instructions does not install the product CLI or configure provider credentials.
/plugin marketplace add xberg-io/xberg
/plugin install xberg@xberg
/plugins add https://github.com/xberg-io/xberg
Search for xberg and select Install Plugin.
Settings → Plugins → Add from URL → https://github.com/xberg-io/xberg, then select xberg.
From a checkout of this repository:
gemini extensions install ./plugin
The manifest is inside plugin/. See the Gemini extension reference
for local installation and updates.
droid plugin marketplace add https://github.com/xberg-io/xberg
droid plugin install xberg@xberg
copilot plugin marketplace add https://github.com/xberg-io/xberg
copilot plugin install xberg@xberg
Install from a local checkout now:
pi install ./plugin
After the next plugin release, install the same package used by OpenCode:
pi install npm:@xberg-io/opencode-xberg
Pi loads the bundled skills and prompt templates. Use /xberg-extract and /xberg-ocr
to start a task. Install the CLI separately as
shown in the plugin README.
This package does not register MCP servers, hooks, or executable extensions in Pi.
Add to opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@xberg-io/opencode-xberg"]
}
Quick Start
Extract text from a document:
use xberg::{extract, ExtractInput, ExtractionConfig};
#[tokio::main]
async fn main() -> xberg::Result<()> {
let config = ExtractionConfig::default();
let output = extract(
ExtractInput::from_uri("document.pdf"),
&config
).await?;
println!("{}", output.results[0].content);
Ok(())
}
Common use cases — see Quick start guide for language-specific examples, OCR, batch processing, and API configuration.
Capabilities
Supported File Formats (107 formats · 141 file extensions · 56 MIME aliases)
107 formats across 140 unique file extensions, with 56 compatibility MIME aliases, intelligent format detection, and comprehensive metadata extraction.
Office Documents
| Category | Formats | Capabilities |
|---|---|---|
| Word Processing | .docx, .docm, .doc, .dotx, .dotm, .dot, .odt, .pages, .wpd, .wp, .wp5, .wp6 | Full text, tables, images, metadata, styles |
| Spreadsheets | .xlsx, .xlsm, .xlsb, .xls, .xla, .xlam, .xltm, .xltx, .xlt, .ods, .numbers | Sheet data, formulas, cell metadata, charts |
| Presentations | .pptx, .pptm, .ppt, .pps, .ppsx, .potx, .potm, .pot, .odp, .key | Slides, speaker notes, images, metadata |
.pdf | Text, tables, images, metadata, OCR support | |
| eBooks | .epub, .fb2 | Chapters, metadata, embedded resources |
| Database | .dbf, .sqlite, .sqlite3, .db, .gpkg, .gpkx | Bounded table extraction, schema metadata, GeoPackage detection |
| Hangul | .hwp, .hwpx | Korean document format, text extraction |
Images (OCR-Enabled)
| Category | Formats | Features |
|---|---|---|
| Raster | .png, .jpg, .jpeg, .gif, .webp, .bmp, .tiff, .tif | OCR, table detection, EXIF metadata, dimensions, color space |
| Advanced | .jp2, .jpg2, .j2c, .j2k, .jpc, .jbig2, .jb2, .pnm, .pbm, .pgm, .ppm | OCR via pure-Rust JPEG2000 decoder, JBIG2 support, table detection |
| HEIC family | .heic, .heics, .heif, .heifs, .hif, .avif, .avcs | EXIF metadata, optional pixel decoding |
| Vector | .svg | DOM parsing, embedded text, graphics metadata |
Audio & Video
| Category | Formats | Features |
|---|---|---|
| Audio | .mp3, .mpga, .m4a, .wav, .webm | Whisper transcription |
| MP4 audio track | .mp4, .mpg4, .mp4v, .m4v | Audio-track transcription only |
| MPEG audio track | .mpeg, .mpg, .mpe, .m1v, .m2v | Audio-track transcription only |
| WebM audio track | .webm | Audio-track transcription only |
Web & Data
| Category | Formats | Features |
|---|---|---|
| Markup | .html, .htm, .xhtml, .xht, .xml, .kml, .svg | DOM parsing, metadata (Open Graph, Twitter Card), link extraction |
| Structured Data | .json, .geojson, .jsonl, .ndjson, .yaml, .yml, .toml, .csv, .tsv | Schema detection, nested structures, validation |
| Text & Markdown | .txt, .adoc, .asciidoc, .vtt, .md, .markdown, .commonmark, .qmd, .rmd, .djot, .dj, .mdx, .doctags, .rst, .org, .rtf | AsciiDoc, CommonMark, MyST Markdown, Quarto, R Markdown, Djot, MDX, DocTags, reStructuredText, Org Mode |
Email & Archives
| Category | Formats | Features |
|---|---|---|
.eml, .msg, .pst | Headers, body (HTML/plain), attachments, threading | |
| Archives | .zip, .tar, .tgz, .gz, .7z | File listing, nested archives, metadata, recursive extraction |
Academic & Scientific
| Category | Formats | Features |
|---|---|---|
| Citations | .bib, .ris, .nbib, .enw | Structured parsing: RIS, PubMed/MEDLINE, EndNote XML, BibTeX/BibLaTeX |
| Scientific | .tex, .latex, .typ, .typst, .jats, .nxml | LaTeX, Typst, PubMed JATS |
| Text notebooks | .ipynb, .md, .py, .R, .jl | Jupyter, MyST-NB, Jupytext percent/light, saved outputs, cell visibility tags |
| Publishing | .fb2, .docbook, .dbk, .docbook4, .docbook5, .opml | FictionBook, DocBook XML, OPML outlines |
Code Intelligence (371 Languages)
Extract structure from 371 programming languages via tree-sitter:
| Feature | Description |
|---|---|
| Structure Extraction | Functions, classes, methods, structs, interfaces, enums |
| Import/Export Analysis | Module dependencies, re-exports, wildcard imports |
| Symbol Extraction | Variables, constants, type aliases, properties |
| Docstring Parsing | Google, NumPy, Sphinx, JSDoc, RustDoc, and 10+ formats |
| Syntax-Aware Chunking | Split code by semantic boundaries for RAG pipelines |
| Diagnostics | Parse errors with line/column positions |
Powered by tree-sitter-language-pack.
Output Formats (6)
| Format | Use case | Example |
|---|---|---|
| Plain | Raw text, no markup | "Chapter 1\nIntroduction" |
| Markdown | Readable, structured, RAG-friendly | "# Chapter 1\n## Introduction" |
| Djot | Modern lightweight markup | Similar to Markdown but stricter |
| HTML | Styled, browser-ready | <h1>Chapter 1</h1> |
| JSON | Machine-readable tree structure | Hierarchical sections with heading levels |
| DocTags | Docling-compatible tag stream for document elements and tables | <text>Chapter 1</text> |
Deployment Modes
| Mode | Command | Transport | Use case |
|---|---|---|---|
| Library | xberg::extract() | Async functions | Embed in your application |
| CLI | xberg extract document.pdf | 14 commands | Scripts, batch jobs, CI/CD |
| REST API | xberg serve | HTTP POST | Microservice, serverless deployment |
| MCP Server | xberg mcp | stdio or HTTP | Claude, Cursor, IDE agents |
| Docker | docker run ghcr.io/xberg-io/xberg | All modes | Container deployment |
OCR Backends
- Tesseract — Native C FFI (Linux/macOS/Windows) and WASM (browser)
- PaddleOCR — ONNX Runtime, mobile-optimized models
- Candle — Pure Rust, CPU-only, lightweight
- VLM — GPT-4 Vision, Claude Vision, Gemini Vision, or 165 providers via liter-llm
Fallback chains. Extensible via plugin system.
Embeddings
Local (ONNX Runtime):
- Preset models: fast, balanced (default), quality, multilingual
- Dimensions: 384, 768, 1024
Provider-hosted:
- OpenAI, Anthropic, Google, Hugging Face, Mistral, Cohere, and 165 providers total
- Via liter-llm integration
Reranking:
- Local ONNX rerankers (cross-encoder models)
- Provider-hosted: Cohere Rerank, others
Structured LLM Extraction
Local engines: Ollama, LM Studio, vLLM
Remote: OpenAI, Anthropic, Google, Mistral, Cohere, and 165 providers via liter-llm
Schema validation. Temperature, top-p, frequency penalty tuning.
Enrichment
- NER — GLiNER or LLM-based entity recognition
- Redaction — Mask PII (phone, email, SSN, credit card, addresses)
- Summarization — Document and section summaries via LLM
- Translation — Multi-language via LLM
- Page Classification — Tag document pages (cover, toc, content, etc.)
- QR Code Detection — Extract and decode QR codes from images
- Keyword Extraction — YAKE or RAKE algorithms
- Language Detection — Detect document language
- Layout Detection — RT-DETR + TATR models for document structure
- Table Extraction — Cell-level structure and content
- Token Reduction — TOON wire format (~30–50% fewer tokens than JSON)
CLI Reference
| Command | Subcommands | Purpose |
|---|---|---|
extract | — | Extract text from a single document (path, URL, or stdin) |
batch | — | Extract from multiple documents in parallel |
detect | — | Identify MIME type of a file |
formats | — | List all supported formats and MIME types |
version | — | Show Xberg version |
cache | stats, clear, manifest, warm | Manage extraction cache and models |
tree-sitter | download, list, cache-dir, clean | Manage code-intelligence grammars |
doctor | — | Diagnose the local installation and runtime dependencies |
serve | — | Start REST API server (default: http://127.0.0.1:8000) |
mcp | — | Start MCP server (stdio or HTTP transport) |
api | schema | Output OpenAPI 3.1 specification |
embed | — | Generate embeddings for text (local or provider-hosted) |
chunk | — | Split text into chunks (text, markdown, YAML, or semantic) |
completions | — | Generate shell completion scripts |
Run xberg --help or xberg <command> --help for detailed options.
Documentation
Full guides, API references for every binding, format reference, and configuration docs live at xberg.io.
- Getting Started
- Quick Start
- Guides
- API Reference (Rust core) — every binding has its own page under
/reference/ - Format Reference
- Live Demo (browser, WASM)
Built with Xberg
Projects that declare Xberg as a dependency. Xberg was previously published as kreuzberg, and most of these projects declare the package under that name.
| Project | What it is | Stars |
|---|---|---|
| basemind | AI context and content layer for coding agents over one MCP server: code map, document RAG, shared memory and web crawl | |
| delulu | A suite of MCP servers and CLI tools that give your LLM better search and fewer hallucinations | |
| docs-mcp-server | Grounded documentation MCP server, an open-source alternative to Context7, Nia and Ref.Tools | |
| erato | The open-source AI platform | |
| fastmail-cli | CLI and MCP server for Fastmail: email, contacts, masked email, attachments and text extraction | |
| ghfdb-portal | Web portal for the Global Heat Flow Database | |
| hawki-toolkit-file-converter | Prepares and converts PDF files for the HAWKI toolkit | |
| haystack-core-integrations | Integrations that extend Haystack with extra components and document stores | |
| kreuzakt | A search engine for humans and computers, aimed at your most boring documents | |
| lilbee | The whole local AI stack in one executable, with conversational search and cited answers over your files, code and the web | |
| llm-workflow-engine | Power CLI and workflow manager for LLMs | |
| MANSPIDER | Spiders entire networks for files sitting on SMB shares, searching filenames or contents with regex | |
| otoroshi-llm-extension | Connect, secure and manage LLM models behind one OpenAI-compatible API | |
| sift-kg | Turns a collection of documents into a knowledge graph, extracting entities and relationships with an LLM | |
| sirchmunk | Turns raw data into a self-evolving, real-time search and intelligence layer | |
| support-chatbot | Level-1 support chatbot for the Netherlands Red Cross 510 team |
Using Xberg in your project? Open a PR adding it to this list.
Contributing
Contributions are welcome! See CONTRIBUTING.md for guidelines.
Join our Discord community for questions and discussion.
Part of Xberg.io
- Xberg — the open-source content-intelligence engine: text, tables, and metadata from 107 formats (141 file extensions), with OCR, transcription, and code intelligence. MIT.
- Xberg Pro — a complete self-hosted content-intelligence backend in a single container. Commercial.
- Xberg Enterprise — the distributed, governed content-intelligence platform, scaled on Kubernetes with team governance and support. Commercial.
- crawlberg — web crawling and scraping with HTML→Markdown and headless-Chrome fallback.
- html-to-markdown — fast, lossless HTML→Markdown engine.
- liter-llm — universal LLM API client with native bindings for 14 languages and 165 providers.
- tree-sitter-language-pack — tree-sitter grammars and code-intelligence primitives.
- alef — the polyglot binding generator that produces every per-language binding across the 5 polyglot repos.
License
MIT License (MIT) — see LICENSE for details.