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.1

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

Built distributions (wheels)

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

Total release size: 69.1 MB

Release files / embroider-0.16.1.tar.gz

Download URL embroider-0.16.1.tar.gz
Size 7.4 MB
Tags Source
SHA-256 checksum
How to use checksums
495a113546ee997cafb1a45c5280765be160fadd594b5fe824d2cea993196c45
BLAKE2b-256 checksum
How to use checksums
798d40ee8f9de7cc6e47c113616a85746634f96e811077e278e08f15c0ecf22f
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 30, 2026.

Transparency log

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

Download URL embroider-0.16.1-cp313-cp313-win_amd64.whl
Size 6.2 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
703b312ab8d708cf247c5be6eafbc37c49b6133f12a3c648fe18201a2914e6f7
BLAKE2b-256 checksum
How to use checksums
0e4d080750f82ec85b03d0ef0bf497b7ee91b5017e01a361d967ba166656c25c
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 30, 2026.

Transparency log

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

Download URL embroider-0.16.1-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
51a16ac35a7afd4f0f13a3c1f0a930a757b5098bf80bdaa373778f57f08cb167
BLAKE2b-256 checksum
How to use checksums
cf7c26d32d071588c752283f6d3907ceed4c20d97d9e47d865e92e661c1cca19
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 30, 2026.

Transparency log

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

Download URL embroider-0.16.1-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
55ca15a4589069761b300e4c22589fa31f758f853d844d451b9d2b9894156a33
BLAKE2b-256 checksum
How to use checksums
8103c13ea774983d6bc2c5902156134e7335c8cfd1cb84a3b1e4448c00901ddc
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 30, 2026.

Transparency log

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

Download URL embroider-0.16.1-cp312-cp312-win_amd64.whl
Size 6.2 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
f17b7d4ed1463a048a38009086a00e7bb31719ff5de67bb821f454bf8b164987
BLAKE2b-256 checksum
How to use checksums
76ea34cd3b5f1d314c90665ea5f53d3453b8c5f5c684e5b25ec9e44527193afc
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 30, 2026.

Transparency log

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

Download URL embroider-0.16.1-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
ff368342b6aa3997f954b10890b48c02003688cbf7aa4cd64085742df63e90d6
BLAKE2b-256 checksum
How to use checksums
8ec2a2644b69eeafe4bb2771d97aba9ff8fc58f160020218baf641b4e9742979
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 30, 2026.

Transparency log

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

Download URL embroider-0.16.1-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
6d1be1f306e2cebc8f0d08a41b44c34eed086da04c0c68cffae8fde17e60369b
BLAKE2b-256 checksum
How to use checksums
edb16620ed43cc895fa5f5f208fe623891ae907970df10636fe4b52e49675d6b
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 30, 2026.

Transparency log

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

Download URL embroider-0.16.1-cp311-cp311-win_amd64.whl
Size 6.2 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
9d1b3c89d94dbcbe26762bebe283506d70188e7c3ae46e63cfe206a5361bca98
BLAKE2b-256 checksum
How to use checksums
87d02acfe24f4745c09200e9c05bd8c2e9f9375379d932efc5ae58973c90d616
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 30, 2026.

Transparency log

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

Download URL embroider-0.16.1-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
623a11dab6621594df35e667bdf4af867bcd2d8b112b8f68a6c6a8f88816cb16
BLAKE2b-256 checksum
How to use checksums
c156bc7cb830cded8a157fc34ce1bd1a59c32e3b1d66bfeff8af45ae6ef51e6d
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 30, 2026.

Transparency log

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

Download URL embroider-0.16.1-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
86c919c62a71c052c88314842e82f5364bd400e3ab46900fa8cc89e9918c8673
BLAKE2b-256 checksum
How to use checksums
daf1c5da06ea72edd3959509a14ef30589f5d20761ed6d0bb5bdda50c4ad68d1
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 30, 2026.

Transparency log

Security for embroider 0.16.1

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.1.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 30, 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