Installation
Kreuzberg ships native bindings for 12 languages and a standalone CLI. Pick your stack, run one command, and start extracting.
Every package includes prebuilt binaries for Linux (x86_64 / aarch64), macOS (Apple Silicon), and Windows — no compile step needed.
CLI / Docker
Section titled “CLI / Docker”The fastest way to try Kreuzberg - no SDK, no code, just your terminal.
curl -fsSL https://raw.githubusercontent.com/kreuzberg-dev/kreuzberg-lts/main/scripts/install.sh | bashbrew install kreuzberg-dev/tap/kreuzbergcargo install kreuzberg-clidocker pull ghcr.io/kreuzberg-dev/kreuzberg-cli:latestdocker run -v $(pwd):/data ghcr.io/kreuzberg-dev/kreuzberg-cli:latest extract /data/document.pdfdocker pull ghcr.io/kreuzberg-dev/kreuzberg-full:latestChoose your language
Section titled “Choose your language”-
Python
Terminal window pip install kreuzberg -
TypeScript (Node.js / Bun)
Terminal window npm install @kreuzberg/node -
TypeScript (Browser / Edge)
Terminal window npm install @kreuzberg/wasm -
Rust
Terminal window cargo add kreuzberg -
Go
Terminal window go get github.com/kreuzberg-dev/kreuzberg-lts/v4@latest -
Java
implementation 'dev.kreuzberg:kreuzberg:4.10.2' -
Ruby
Terminal window gem install kreuzberg -
C# / .NET
Terminal window dotnet add package Kreuzberg -
PHP
Terminal window composer require kreuzberg/kreuzberg -
Elixir
{:kreuzberg, "~> 4.0"} -
R
install.packages("kreuzberg",repos = "https://kreuzberg-dev.r-universe.dev") -
C / C++
Terminal window cargo build -p kreuzberg-ffi
System requirements
Section titled “System requirements”Most of the time you won’t need anything beyond the install command above. The table below only matters if you’re building from source or want OCR:
| Dependency | When you need it |
|---|---|
| AVX/AVX2 CPU instructions | Required for ONNX Runtime features (PaddleOCR, layout detection, embeddings) on x86_64 |
Rust toolchain (rustup) |
Building any native binding from source |
| C/C++ compiler | Building native bindings (Xcode CLI tools / build-essential / MSVC) |
| Tesseract OCR | Optional — brew install tesseract / apt install tesseract-ocr |
| PDFium | Auto-fetched during builds |
The WASM package (@kreuzberg/wasm) has zero system dependencies.
GPU Acceleration
Section titled “GPU Acceleration”Kreuzberg bundles a CPU-only ONNX Runtime — ML features (PaddleOCR, layout detection, embeddings) work out of the box on CPU.
For GPU acceleration, install a GPU-enabled ONNX Runtime and set ORT_DYLIB_PATH:
| Platform | Install | Set ORT_DYLIB_PATH |
|---|---|---|
| Linux (CUDA) | Download from ONNX Runtime releases | export ORT_DYLIB_PATH=/path/to/libonnxruntime.so |
| Python (any OS) | pip install onnxruntime-gpu |
Point at the pip package’s capi/ directory |
| macOS (CoreML) | Works with bundled ORT — no extra setup needed | — |
See AccelerationConfig and ORT_DYLIB_PATH for details.
Language-specific notes
Section titled “Language-specific notes”For most languages the install command above is all you need. The sections below cover edge cases and alternative install methods where they come up.
TypeScript
Section titled “TypeScript”Two npm packages target different runtimes:
| Package | Best for | Performance |
|---|---|---|
@kreuzberg/node |
Node.js, Bun — server-side apps | Native (100%) |
@kreuzberg/wasm |
Browsers, Deno, Cloudflare Workers | WASM (~60-80%) |
Both work with pnpm (pnpm add) and yarn (yarn add) as well.
Supported runtimes: Chrome 74+, Firefox 79+, Safari 14+, Edge 79+, Node.js 22+, Deno 1.35+, Cloudflare Workers.
<dependency> <groupId>dev.kreuzberg</groupId> <artifactId>kreuzberg</artifactId> <version>4.10.2</version></dependency>implementation 'dev.kreuzberg:kreuzberg:4.10.2'Requires Java 25+ (FFM/Panama API). Native libraries are bundled in the JAR.
Elixir
Section titled “Elixir”Add to mix.exs:
def deps do [ {:kreuzberg, "~> 4.0"} ]endmix deps.getShips prebuilt NIF binaries via RustlerPrecompiled. Falls back to compiling from source if no prebuilt matches your platform (requires Rust).
go get github.com/kreuzberg-dev/kreuzberg-lts/v4@latestEnable features selectively in Cargo.toml:
[dependencies]kreuzberg = { version = "4", features = ["tokio-runtime"] }# Optional features: pdf, ocr, chunkingC / C++
Section titled “C / C++”Build the FFI library from source:
cargo build --release -p kreuzberg-ffiThis produces libkreuzberg_ffi.a and a header at crates/kreuzberg-ffi/kreuzberg.h. Link into your project:
HEADER_DIR = path/to/crates/kreuzberg-ffiLIBDIR = path/to/target/release
CFLAGS = -Wall -Wextra -I$(HEADER_DIR)LDFLAGS = -L$(LIBDIR) -lkreuzberg_ffi -lpthread -ldl -lm
my_app: my_app.c $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)Development setup
Section titled “Development setup”Working on the Kreuzberg repo itself:
task setup # installs all language toolchainstask lint # linters across all languagestask dev:test # full test suiteSee Contributing for conventions and expectations.