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; int8 on nano and gemma-2
Vision → text space (Jina, Gemma) JinaV5Vision, GemmaVision / vision, gemma jina-v5-omni-nano-retrieval-vision, google/embeddinggemma-2-vision fp32, fp16; int8 on gemma-2 vision
int8 is explicit-only (never auto) and falls back to fp32 when a
model has no measured artifact. The gemma-2 q8 text/vision/audio graphs
serve from opticsWolf/embeddinggemma-2-onnx-int8. The text tier passed
the labelled scifact/nfcorpus retrieval gate at 768/512, and the vision
tier passed the COCO cross-modal gate (2026-11-16). Gemma text and image
precision must match: the fusion text tower runs at the image precision.

| 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.16.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.16.0
File Size Uploaded Provenance Actions
embroider-0.16.0.tar.gz 7.4 MB With provenance Details for embroider-0.16.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for embroider 0.16.0
File Actions
embroider-0.16.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for embroider-0.16.0-cp313-cp313-win_amd64.whl
embroider-0.16.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.16.0-cp313-cp313-manylinux_2_28_x86_64.whl
embroider-0.16.0-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for embroider-0.16.0-cp313-cp313-macosx_11_0_arm64.whl
embroider-0.16.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for embroider-0.16.0-cp312-cp312-win_amd64.whl
embroider-0.16.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.16.0-cp312-cp312-manylinux_2_28_x86_64.whl
embroider-0.16.0-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for embroider-0.16.0-cp312-cp312-macosx_11_0_arm64.whl
embroider-0.16.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for embroider-0.16.0-cp311-cp311-win_amd64.whl
embroider-0.16.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.16.0-cp311-cp311-manylinux_2_28_x86_64.whl
embroider-0.16.0-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for embroider-0.16.0-cp311-cp311-macosx_11_0_arm64.whl

Total release size: 69.1 MB

Release files / embroider-0.16.0.tar.gz

Download URL embroider-0.16.0.tar.gz
Size 7.4 MB
Tags Source
SHA-256 checksum
How to use checksums
f1fe61326bd99324d4c9b38ded1b91816756332036f75711cedc6d95486a1b26
BLAKE2b-256 checksum
How to use checksums
e947b7187c8953472ed335c0632dba18afd6fc8712dac211df1637f823244243
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 29, 2026.

Transparency log

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

Download URL embroider-0.16.0-cp313-cp313-win_amd64.whl
Size 6.2 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
b3cdbacd8baf09cf1fa77bb1074545a991a7fabf89b54cbb6157c179f711712b
BLAKE2b-256 checksum
How to use checksums
d12d486cf288296158bd49a57306da142c14692e35460b1252ad4442ef49f882
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 29, 2026.

Transparency log

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

Download URL embroider-0.16.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
843b8433a54a577c591149fd67227e192a2afb73b09584deb9c2004b564f3995
BLAKE2b-256 checksum
How to use checksums
6ab1ed4705616d61f8d3a323c4ef3172717322fea12bc00ac4f8c1a7f7986c98
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 29, 2026.

Transparency log

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

Download URL embroider-0.16.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
083ac37563d3e69f606def3aff28fc6b7b7657d623b881d3edff04d176731080
BLAKE2b-256 checksum
How to use checksums
4d9d55a785bb4c4420dc5b262f0de8b35989407367eacdd05fb9d02323f55fd8
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 29, 2026.

Transparency log

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

Download URL embroider-0.16.0-cp312-cp312-win_amd64.whl
Size 6.2 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
8f231566563bff8f54c987f7d0674ae5ef106e5af99e512a76a51c87d8744fdd
BLAKE2b-256 checksum
How to use checksums
d46b1c6abec8ad34986db3950a60dea0cec452a1784ccfa0c11876d898b60c34
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 29, 2026.

Transparency log

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

Download URL embroider-0.16.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
b192e215f16dbc7767cbdc22a7eb0828b183e1d2bf7e546d5d4517b031c878d3
BLAKE2b-256 checksum
How to use checksums
ff7286c80ef2e46eceef256e2d8dfca769a2bdfe107fb9af5a3b31bce73811ac
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 29, 2026.

Transparency log

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

Download URL embroider-0.16.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
656d7288ac39954f6ee593dc97972e9cc3531152267ec92e22a115981436c50d
BLAKE2b-256 checksum
How to use checksums
577ce77a1956d67de4b9c0a35d14c166f149e1cc03948081ef67e18ee88b7efc
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 29, 2026.

Transparency log

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

Download URL embroider-0.16.0-cp311-cp311-win_amd64.whl
Size 6.2 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
514ba0aebb218e6462530b73f9de45af42e9b9e991b4d50ec72213439e175d93
BLAKE2b-256 checksum
How to use checksums
04c322cc995363f55db46907442e867b4f247dddf0bf3d4d5acbb1215a06791d
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 29, 2026.

Transparency log

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

Download URL embroider-0.16.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
4fd441379f601b80a60a192902f2fbd790933e2eb5c6be818cd25be4d23d4be8
BLAKE2b-256 checksum
How to use checksums
fed83b84cb01506aa677d25a2e05761d6a6d0968620e2d59a801fa1945b185bf
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 29, 2026.

Transparency log

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

Download URL embroider-0.16.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
428feb6e1d17d0cadfc2bb08d162ac1ab96793d80f59e2e0f5b04b24de8d4698
BLAKE2b-256 checksum
How to use checksums
5fb4587b2c8b1b0f1550f7b55e4f57130a85f05c4cb7a12b1d40ba6109b22049
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 29, 2026.

Transparency log

Security for embroider 0.16.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.16.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 29, 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