Scan your whole stack
Are you using bobine?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.10.2
bobine was last scanned on 1 Dec 2026 at version 0.10.2. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.10.2 LATEST | 1 Dec 2026 | No rules fired |
| 0.10.1 | 29 Nov 2026 | No rules fired |
| 0.10.0 | 22 Nov 2026 | No rules fired |
| 0.9.1 | 13 Nov 2026 | Not shown |
| 0.9.0 | 12 Nov 2026 | Not shown |
Findings for v0.10.2. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.10.2; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
Runs on a single onnxruntime shared library with no CUDA-version
coupling: pdf_oxide for fast native PDF text extraction, ONNX models
(TexTeller formula OCR, PP-DocLayout_plus-L layout analysis, PP-OCRv5
det+rec) for the heavy passes.
No torch, no optimum, no opencv — not even on the Python side.
Dual-licensed under the terms of either the MIT License or the Apache License, Version 2.0 — you may choose either (see LICENSE).
The ingestion pipeline was originally entangled with the knowledge-graph
project it served (OKFgraph). This crate moves conversion into its own
package so any consumer — a graph, a CLI, an MCP server, a batch tool — can
reuse it without importing a database stack.
The v0.3.0 rewrite ports the whole pipeline to Rust: same routing
heuristics and output contract as the proven Python implementation
(preserved under legacy/),
with native speed and no Python ML dependencies.
# Python package (wheels: CPython 3.10–3.14; manylinux x86_64, windows x64,
# macOS arm64 — no Rust toolchain needed for these; arm64 Linux uses the
# sdist and needs a Rust toolchain)
pip install bobine
# Rust library (crates.io, no Python involved)
cargo add bobine
# ...or build from source (repo root)
pip install maturin && maturin develop --release
The heavy passes need an ONNX Runtime library — or nothing at all (Office/text/fast-path PDF work needs no models):
pip install bobine[cpu] # adds onnxruntime == 1.31.1 (CPU)
# or: pip install bobine[gpu] # onnxruntime-gpu (self-contained CUDA)
import bobine finds the library with embroider's locator — the same one
every embroider model open and okfgraph use — reading the installed
dist's metadata instead of importing onnxruntime (importing it would
load a second runtime into the process). An already-set ORT_DYLIB_PATH
always wins (e.g. a custom CUDA build), and bobine.runtime_info() reports
what was found and who chose it. With no runtime at all the answer is
dylib=None and nothing else happens — no probe, no loader call — so the
fast Office/text paths still work and a stale system copy is never touched:
export ORT_DYLIB_PATH=/path/to/onnxruntime.dll # e.g. <venv>/Lib/site-packages/onnxruntime/capi/onnxruntime.dll
ort loads the library dynamically (load-dynamic, no CUDA-version
coupling) and refuses runtimes older than 1.28 (BadVersion). The extras
pin exactly 1.31.1, the one runtime shared with okfgraph/embroider
(embroider docs/compat.md). Never install both onnxruntime and
onnxruntime-gpu (same module name, they clobber each other).
import bobine
conv = bobine.HybridConverter(
bobine.ConverterConfig(routing_mode=bobine.RoutingMode.Surgical),
cache_dir="~/.cache/bobine", # hub-cache root (models shared machine-wide)
)
md = conv.convert_pdf("paper.pdf", work_dir="/tmp/out")
latex = conv.recognize_formula("crop.png") # r"\frac{1}{2}"
# Many documents on one converter (0.9): the ONNX sessions stay warm.
for pdf in ["a.pdf", "b.pdf", "c.pdf"]:
doc = conv.ingest_document(pdf, "/tmp/out/" + pdf[:-4]) # .md_path, .page_count
conv.close() # or: with bobine.HybridConverter(...) as conv:
# Out of process, one converter per settings key stays warm:
# python -m bobine.serve --port 8757 --idle-seconds 300
# one-shot helper
md = bobine.convert_to_markdown(
"paper.pdf", bobine.ConverterConfig(), work_dir="/tmp/out",
cache_dir="~/.cache/bobine",
)
# Text documents need no models at all
md = conv.convert("notes.txt", work_dir="/tmp/out")
# Binary files under text-ish extensions fail fast (v0.5.11+):
# UnsupportedFormat("binary file, not text: …") instead of a raw
# "invalid UTF-8" I/O error — content-sniffed, extension-agnostic.
HybridConverter routes pages through four modes:
| Mode | Behaviour | Models loaded |
|---|---|---|
Never |
Fast path only (pdf_oxide). No ONNX models loaded. | none |
Auto (default) |
Heuristics per page → full ONNX layout + OCR on flagged pages. | TexTeller + layout + OCR (table lazy) |
Surgical |
Formula crops via TexTeller only; full pipeline just for scans. | TexTeller only |
Always |
Every page through the full ONNX layout + OCR pipeline; on born-digital pages, formula regions are refined against text-layer math boxes (v0.4.8) and output matches Surgical. |
TexTeller + layout + OCR (table lazy) |
RapidLayout and RapidOCR weights also auto-download from HuggingFace on first use (PP-DocLayout_plus-L ~130 MB, PP-OCRv5 mobile det+rec+dict ~22 MB); explicit local paths can override them. Missing/broken heavy models degrade gracefully to the fast path per page — a conversion never fails because of them.
Converter models live in the standard HuggingFace hub cache (0.6.0+):
cache_dir is the hub-cache root — an override of the env-resolved
default, shared machine-wide, never a per-output sidecar. The first
fetch after upgrading downloads once; repeats reuse the blob (a cached
file costs zero network, logged as "using cached").
bobine.model_status(cache_dir=None) reports per-family status offline
(same dict keys as okfgraph's model_info); ingest_document accepts
an optional cache_dir (None = standard cache).
use bobine::{ConverterConfig, HybridConverter, RoutingMode};
let mut conv = HybridConverter::new(
ConverterConfig { routing_mode: RoutingMode::Surgical, ..Default::default() },
std::path::Path::new("~/.cache/bobine"),
);
let md = conv.convert_pdf(std::path::Path::new("paper.pdf"),
std::path::Path::new("/tmp/out"))?;
ConverterConfig takes the stack-wide vocabulary — device="auto|cpu|cuda"
and precision="auto|fp32|fp16|int8", the same words embroider and
okfgraph accept (bobine.DEVICES / bobine.PRECISIONS list them).
auto keeps each slot's measured policy; cuda puts every pass on the
GPU, including the table slots that are CPU-pinned by default.
conv.describe() reports the resolved plan per pass.
src/
├── lib.rs crate root & re-exports
├── config.rs ConverterConfig · RoutingMode · Device/Precision · runtime_plan
├── engine.rs OnnxEngine (lazy model manager: TexTeller/Layout/OCR/Table/POTATR)
├── converter.rs HybridConverter (core PDF/Office pipeline + binary-sniffed text fallback)
├── tex_teller.rs TexTeller ONNX — ViT encoder → RoBERTa decoder
├── rapid_layout.rs PP-DocLayout_plus-L page layout analysis (RT-DETR)
├── rapid_ocr.rs PaddleOCR det + rec (DBNet / CRNN, CTC decode)
├── rapid_table.rs SLANet-plus table-structure recognition (default backend)
├── rapid_potatr.rs POTATR page-table recognition (opt-in `table_backend`)
├── render_gate.rs Render-health gate (Option C: OCR↔layer agreement, version-scoped to pdf_oxide < 0.3.79)
├── sanitize.rs Post-OCR LaTeX repair (split_cmds, fence fixup, script split)
├── mml.rs MathML → LaTeX (verbatim port, fixture-parity gated)
├── math_source.rs Tagged formula spans, source provenance and warnings
├── pdf_math_raw.rs Bounded raw-object lookup for formula /AF and attributes
├── math_render.rs Optional KaTeX validation / HTML and MathML export
├── input_limits.rs Shared 256 MiB source-file limit
├── jats.rs JATS XML → GFM (formulas/tables/figures, no ONNX needed)
├── pdf_source.rs PdfSource trait — page text without a real PDF file
├── tables.rs HTML table → GFM pipe-table converter
├── excel.rs Excel workbooks → per-sheet csv/json/md
├── office_images.rs Office picture staging (IR walk + package fallback)
├── assets.rs okf-asset://\ staging store
├── documents.rs ConvertedDocument + frontmatter
├── runtime.rs ONNX Runtime discovery (embroider's locator, once per process)
├── pipeline.rs ingest_document / ingest_with_converter (warm) / ProgressHooks
├── error.rs BobineError
└── py_bindings.rs PyO3 surface (behind the extension-module feature)
python/bobine/ Python shim + type stubs + serve.py (import bobine / python -m bobine.serve)
legacy/ frozen pure-Python bobine v0.2.0 (reference implementation)
Reference box: RTX 3090, ORT 1.28.1 (benches predate the 1.31.1 pin — ratios, not absolutes, are the takeaway). Full tables, fixtures, and repro commands in docs/benchmarks.md.
| Workload | CPU | CUDA (RTX 3090) | Routing |
|---|---|---|---|
| Layout (PP-DocLayout_plus-L, 1024²) | 320 ms | 44.6 ms (~7.2×) | CUDA auto-enabled |
| OCR det+rec (PP-OCRv5, 1024²) | 143 ms | 38.0 ms (~3.8×) | CUDA auto-enabled |
| OCR 47-line page (batched) | 0.79 s | 0.32 s (6.3× vs per-line) | CUDA + chunked rec |
| Table (SLANet-plus, 700×400) | 28.8 ms | 49 ms (0.6× — slower) | Pinned to CPU |
| Table (SLANet-plus, 1024²) | 133 ms | 893 ms (0.15× — much slower) | Pinned to CPU |
| TexTeller fp32 + KV-cache | 1.00 s | 0.42 s (2.4×) | Default (CPU + CUDA) |
| TexTeller fp16 | 2.96 s | 0.53 s | CUDA alternative |
| TexTeller int8 | 0.54 s | 1.07 s (0.5× — slower) | CPU alternative |
Takeaways:
Formulas are recognized by TexTeller (80M training pairs), decoded with KV-cache over a ViT encoder → RoBERTa decoder ONNX graph — roughly 5× faster per crop than the RapidLaTeXOCR backend used by the legacy Python package, with markedly better accuracy.
By default bobine downloads the fp32 pair (~1.19 GB total, HF
opticsWolf/texteller3-onnx, pinned revision) into the converter's cache dir
on first use. Two opt-ins:
model_quantization=ModelQuantization::Int8 — dynamic-int8 pair (~303 MB).
The fastest CPU option, at the cost of occasional decode drift.model_precision=ModelPrecision::Fp16 — half-precision pair (~598 MB).
The fastest CUDA option; numerically equivalent to fp32.Preprocessing matches upstream TexTeller exactly, including its normalize-before-pad order (v0.4.4 fixed black pad fill, which measurably degraded recognition).
Quantization is not free. On the 30-formula ikat eval set, int8 matches fp32 exactly on 10/30 (mean similarity 0.83); fp16 matches on 28–29/30 (0.998–1.000, differing only in thin-space placement). int8 drift is mostly stylistic, but a small number of formulas decode differently, and its output also varies by execution provider. Measured on that set, int8 is 1.9× faster than fp32 on CPU, while fp16 is 1.2× faster on CUDA. See docs/benchmarks.md for the full matrix.
On NVIDIA GPUs, point ORT_DYLIB_PATH at a GPU onnxruntime build —
v0.4.9+ auto-enables CUDA for the layout and OCR slots when the loaded
library exposes a usable CUDA execution provider (EP-availability probe,
shared embroider crate since v0.5.10).
Zero config needed; explicit per-slot overrides: layout_ort_providers,
ocr_ort_providers, table_ort_providers, encoder_ort_providers,
decoder_ort_providers. To also run fp32 formula decode on the GPU, set
ort_providers=["CUDAExecutionProvider", "CPUExecutionProvider"] (the
default); for the CUDA speed tier add model_precision=ModelPrecision::Fp16.
Int8 + CUDA is discouraged and warned against; so is fp16 without CUDA.
Formula regions come from the PDF text layer (TeX math fonts such as
cmmi/cmsy/cmex, plus unicode math codepoints), merged line-aware so
multi-line display equations become one crop while separate equations,
columns and prose stay apart. For text-layer-hostile PDFs (Word/InDesign/OCR
output without math fonts), set formula_layout_fallback=True to ask the
layout model for equation regions instead (off by default).
Tagged PDFs can provide formula MathML through the structure tree or an
associated MathML file (/AF). Bobine converts these sources to LaTeX,
places them by page position, and suppresses only overlapping formula OCR
candidates. /Alt remains descriptive text, not formula input. The latest
conversion's source counts and warnings are available from
HybridConverter.math_source_report(). KaTeX validation is enabled in the
published Python wheels; it is opt-in for Rust builds with math-validate.
Rust callers can opt into math-export and use render_math_markup to render
HTML, MathML, or both. The default Rust build includes neither feature.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.