Skip to main content

embroider

Frozen embedding, rerank, and decision vectors over ONNX Runtime (Rust core, PyO3)

CI crates.io docs.rs PyPI Python License Website

What it is

embroider turns text — and images — into vectors, scores, and typed decisions: embeddings, cross-encoder rerank, and Choice/Score/Noul gates served through ONNX Runtime from a Rust core, with optional PyO3 bindings. Two embedding families live in the registry — Jina v5 (non-commercial) and EmbeddingGemma 2 (Apache-2.0) — alongside rerankers, GLiClass deciders, Laya marker-layout gates, and the Decider-2B slot engine. No torch, transformers, or optimum in the hot path, so every vector in an index stays directly comparable — or the encode fails loudly instead of silently forking the space.

Two consumers share it differently: okfgraph uses the text + vision contracts for its graph; bobine (PDF/Office → Markdown) reuses only the ONNX plumbing — session policy, provider fallback, CUDA probe — while owning its converter-model sessions.

Since 0.15 every model also names itself: embroider.open(kind, id) returns a Model whose describe() reports the snapshot, the landed device and precision, and for embedders a space string — equal space, identical vectors. python -m embroider.serve puts any model behind HTTP with that identity on GET /v1/models, so a consumer can move between in-process and hosted without re-embedding.

Engines

Capability Loader (Python / Rust) Registry ids Precisions
Text embeddings (Jina v5, Gemma 2) JinaV5 / jina jinaai/jina-embeddings-v5-*, google/embeddinggemma-2 fp32, fp16 (nano also int8)
Vision → text space (Jina, Gemma) JinaV5Vision, GemmaVision / vision, gemma jina-v5-omni-nano-retrieval-vision, google/embeddinggemma-2-vision fp32, fp16
Cross-encoder rerank Reranker / rerank cross-encoder/ms-marco-MiniLM-L-6-v2, cross-encoder/mmarco-mMiniLMv2-L12-H384-v1 fp32, q8
Typed decisions (GLiClass) Decider / decide knowledgator/gliclass-small-v1.0, knowledgator/gliclass-v4-edge fp32 (v4-edge also q8)
Typed decisions (Laya markers) LayaDecider / laya convaiinnovations/laya-{typed-decisions,english,multilingual} fp32 (CUDA fp16 variants)
Typed decisions (decider-2B slots) Decider2B / decider2b Mapika/decider-2b fp32, q8
Custom models under known kinds register_task / register_model, load_registry_file caller-supplied owner/name ids caller-declared, flagged-unmeasured unless validated

Full artifact repos and per-entry licences live in docs/compat.md (Jina weights are non-commercial, EmbeddingGemma 2 and the rerank/decide entries Apache-2.0); the registry design (builtin + overlay, flagged-unmeasured tiers, revision pins) in docs/model-registry-record.md.

New models under known kinds need no source change — register_task / register_model or load_registry_file("models/extra.json") — but a new input contract needs a Rust loader. Rules: ids must be owner/name, builtin and duplicate ids are refused loudly, unlisted tiers fall back to fp32, and caller-supplied non-fp32 tiers run flagged-unmeasured (the drift is the caller's gate). Unknown ids fall through to the legacy path (the id as an HF repo holding onnx/model.onnx); fully local weights skip acquisition via open_files.

Install

pip install embroider                       # Linux / Windows / macOS-arm64, Python 3.11–3.13
pip install onnxruntime==1.31.1             # or -gpu[cuda,cudnn]==1.31.1 — exactly one, never both

okfgraph pulls it in automatically; standalone, install the wheel plus exactly one runtime as above. import embroider finds the pip-installed runtime itself (embroider.locate_runtime(), without importing onnxruntime); ORT_DYLIB_PATH overrides discovery.

From source: maturin build --release, then install the wheel (maturin develop needs pip, which uv venvs lack).

from embroider import JinaV5
m = JinaV5.open("jinaai/jina-embeddings-v5-text-small-retrieval")
v = m.encode("what do badgers eat?", task="query")   # 512-d unit vector, golden-pinned

Any kind through one factory (0.15), and the same model over HTTP:

import embroider
m = embroider.open("embed", "google/embeddinggemma-2", truncate_dim=512)
m.describe()["precision"]   # the weights that loaded, not the request
m.space                     # "embroider/<id>@<sha>:<prec>:<dim>:<max_len>:<tuning>:v1"
python -m embroider.serve --kind embed --model google/embeddinggemma-2 --dim 512

Docs

  • docs/quickref.md — the complete user manual: every loader, every parameter, copy-paste Python and Rust.
  • docs/ARCHITECTURE.md — how it works: module layout, session policy and measurements, runtime discovery, the frozen-contract rules, registry and precision design, conformance.
  • docs/serve.md — python -m embroider.serve: one model of any kind over HTTP, its routes, and the space identity (0.15).
  • docs/compat.md — release matrix, model sizes and serving guidance, per-entry licences.
  • docs/rerank-typed-decision-record.md — how the rerank and decide engines were chosen, measured, and gated.
  • docs/model-registry-record.md — the registry design (builtin + overlay, revision pins).
  • docs/model-conversion.md — the conversion playbook: weights to parity-gated ONNX.

Testing

cargo test --locked                      # 111 pure unit tests, no net/dylib

Engine parity is fixture-pinned and env-gated (tests/*_e2e.rs, ignored — needs the ORT dylib, weight files, ideally CUDA; see the Testing section in quickref). Python parity lives with okfgraph (tests/test_parity.py, slow; test_rust_backend.py / test_rust_e2e.py cover the wheel import, count-tokens contract, and real-model encodes): Rust output against a numpy/transformers replication at ≤ 1e-5. Regenerate goldens only on an intentional contract change — a new minor version plus a re-index-everything notice.

Failure policy

Level Behaviour
Install Missing wheel → clear RuntimeError with the install hint; never a silent fallback.
Device Accelerators are opportunistic: auto/cuda use CUDA when the loaded ORT registers the EP, else warn + CPU. used_cuda reports the outcome.
Encode Fail fast. No fallback — vectors must stay bit-comparable within one index.
Precision auto follows the landed device (CUDA→FP16, CPU→FP32); explicit fp16-on-CPU warns for text, errors for vision.

Same (model, precision, tuning, max_length) or re-embed — never mix precisions or tuning levels in one index.

Metadata

Release files for embroider 0.15.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for embroider 0.15.0
File Size Uploaded Provenance Actions
embroider-0.15.0.tar.gz 7.3 MB With provenance Details for embroider-0.15.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for embroider 0.15.0
File Actions
embroider-0.15.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for embroider-0.15.0-cp313-cp313-win_amd64.whl
embroider-0.15.0-cp313-cp313-manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64 Details for embroider-0.15.0-cp313-cp313-manylinux_2_28_x86_64.whl
embroider-0.15.0-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for embroider-0.15.0-cp313-cp313-macosx_11_0_arm64.whl
embroider-0.15.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for embroider-0.15.0-cp312-cp312-win_amd64.whl
embroider-0.15.0-cp312-cp312-manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64 Details for embroider-0.15.0-cp312-cp312-manylinux_2_28_x86_64.whl
embroider-0.15.0-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for embroider-0.15.0-cp312-cp312-macosx_11_0_arm64.whl
embroider-0.15.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for embroider-0.15.0-cp311-cp311-win_amd64.whl
embroider-0.15.0-cp311-cp311-manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64 Details for embroider-0.15.0-cp311-cp311-manylinux_2_28_x86_64.whl
embroider-0.15.0-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for embroider-0.15.0-cp311-cp311-macosx_11_0_arm64.whl

Total release size: 69.1 MB

Release files / embroider-0.15.0.tar.gz

Download URL embroider-0.15.0.tar.gz
Size 7.3 MB
Tags Source
SHA-256 checksum
How to use checksums
575b8a8f419624a5d1576d633cf239b483df4fcb533bfe7a60dfbf0f56b4cc50
BLAKE2b-256 checksum
How to use checksums
5d6fb013df56c25be821a657bf6baf49e2a7253c9f6d67a1397a19427e229499
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / embroider-0.15.0-cp313-cp313-win_amd64.whl

Download URL embroider-0.15.0-cp313-cp313-win_amd64.whl
Size 6.2 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
1299b549a68f3fee290a6ac0bd920fb1924d59f9b32625954d896dc60965d648
BLAKE2b-256 checksum
How to use checksums
1d74be3b5faea746b7e4de2a792b2279d2f32053309890e493cb90817bd4a560
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / embroider-0.15.0-cp313-cp313-manylinux_2_28_x86_64.whl

Download URL embroider-0.15.0-cp313-cp313-manylinux_2_28_x86_64.whl
Size 7.7 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
f3fb02b621262c608d560b9b2e8939ec59f3e93fc6aa0df29a195b04a87a2ae9
BLAKE2b-256 checksum
How to use checksums
d3b97aafbbe0376f82abaeeaeec96c470307fedd76bd0a21f8470e2595b4d3de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / embroider-0.15.0-cp313-cp313-macosx_11_0_arm64.whl

Download URL embroider-0.15.0-cp313-cp313-macosx_11_0_arm64.whl
Size 6.7 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
853c546cd4c52eccc6456cb89df012716eaa55894e230c87624b0ae0aaa430f7
BLAKE2b-256 checksum
How to use checksums
9779de6f72aca413d4dcd562d112a34cdd921045c9141bdc54220d830ab0960f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / embroider-0.15.0-cp312-cp312-win_amd64.whl

Download URL embroider-0.15.0-cp312-cp312-win_amd64.whl
Size 6.2 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
6d84ca9d7e4f43723e28ccef53cdadc23e30be25c99fdbada780fe4a69838782
BLAKE2b-256 checksum
How to use checksums
ab6689d4813224be34c5a7f35b46afbb2b59d8b1213c4c267cb9f3ecc3597d4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / embroider-0.15.0-cp312-cp312-manylinux_2_28_x86_64.whl

Download URL embroider-0.15.0-cp312-cp312-manylinux_2_28_x86_64.whl
Size 7.7 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
cdb715dd8b7347d71f15ff958dea2a981dbb770df76496e54423d33a31c62280
BLAKE2b-256 checksum
How to use checksums
05950ea20d159c678dd6b96f0bbdf82f1eb1ef9bb26e2eb16aae95f0150a6126
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / embroider-0.15.0-cp312-cp312-macosx_11_0_arm64.whl

Download URL embroider-0.15.0-cp312-cp312-macosx_11_0_arm64.whl
Size 6.7 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
dc5d9c2871e23b0cad2b09d9a81108c90abf743013a200bf5414adbddd424c6d
BLAKE2b-256 checksum
How to use checksums
15b872be8fc9e38b28dc626ec3aa396266585dd72414e088611602d70e50c447
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / embroider-0.15.0-cp311-cp311-win_amd64.whl

Download URL embroider-0.15.0-cp311-cp311-win_amd64.whl
Size 6.2 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
b5bbeba2e2329f6777cb352207ee2c77a2c2c35b9e25eb88f4cb5ba8ab99119d
BLAKE2b-256 checksum
How to use checksums
af5bedb086124b91a2876e48f08fa0ff8ad6cfef407bfa178d244bcbbbfa72a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / embroider-0.15.0-cp311-cp311-manylinux_2_28_x86_64.whl

Download URL embroider-0.15.0-cp311-cp311-manylinux_2_28_x86_64.whl
Size 7.7 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
6cfb55c85906ccb1de09f662b5aa9a77ab51e7ea76ee9e085deecb83a49f7f74
BLAKE2b-256 checksum
How to use checksums
dcf135eda7e64d7c67cffa1285255194d3993c550ed732494095a0118332ddfa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / embroider-0.15.0-cp311-cp311-macosx_11_0_arm64.whl

Download URL embroider-0.15.0-cp311-cp311-macosx_11_0_arm64.whl
Size 6.7 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f45dbf9f4048dfd847d198d15aaf6d7a8e7598b41677ee66c212dbea121d91c8
BLAKE2b-256 checksum
How to use checksums
5571fe5cb2c33b59a1cf7c9ec4f8a77c298b1defa6de898d76397b6faa29d8ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Security for embroider 0.15.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 10 files in this release have been uploaded with provenance metadata.

Select from 10 files

Attestation for embroider-0.15.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page