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

Built distributions (wheels)

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

Total release size: 69.2 MB

Release files / embroider-0.15.1.tar.gz

Download URL embroider-0.15.1.tar.gz
Size 7.4 MB
Tags Source
SHA-256 checksum
How to use checksums
daaa54abd2e9a59c13ca821cd38c48d0bf82a02831eeb2e5299a219bf4c86bcd
BLAKE2b-256 checksum
How to use checksums
294a212163fcb4590a10caab181df2cb92762bb6ca206ddb18a133d59c9abd0d
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 16, 2026.

Transparency log

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

Download URL embroider-0.15.1-cp313-cp313-win_amd64.whl
Size 6.2 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
43b073ca8f3776b0c5c87e2bc1bd42e796b866cbd64c1bdd4fc3dcc775caff99
BLAKE2b-256 checksum
How to use checksums
75eaf509d8504b8165b2ee9b326a591cb5e87aea387faae84c019035b5823cdf
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 16, 2026.

Transparency log

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

Download URL embroider-0.15.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
5f9dbb3c65f61c74c36382c414a17592e5015df4f7635dcabcb06796e4ec17f9
BLAKE2b-256 checksum
How to use checksums
f82cf22435c920edf358cd6082fe55828a5797a1eddfbb6f8d1101ccaf1f6a01
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 16, 2026.

Transparency log

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

Download URL embroider-0.15.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
6c62de31f7ba25b410f713dd580342de84d52fdc0ba31460851784a581b9efc1
BLAKE2b-256 checksum
How to use checksums
96b9453aca56f0a02f6b4d2e2148d5800befe08800ddcf6ab5b96f2e193da737
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 16, 2026.

Transparency log

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

Download URL embroider-0.15.1-cp312-cp312-win_amd64.whl
Size 6.2 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
58ab8eedf3ad2f4c2ad097908755b4178a50b44244217ecb81fde9f374adbd4f
BLAKE2b-256 checksum
How to use checksums
902c1a707112882c97c3474152f0d8a2997a1864329f9098b7f59b09029110dc
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 16, 2026.

Transparency log

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

Download URL embroider-0.15.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
779ffcebf9138f74683895713d9a3ae7f7c0a77579249d028560456c33bbc70b
BLAKE2b-256 checksum
How to use checksums
2682cd440bbd82527d05194043224b9ce6d20beb61da780863137d2c7a727260
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 16, 2026.

Transparency log

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

Download URL embroider-0.15.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
2b5ec28bfb16a012b3a0971a58271b3440318f115d47e05ccf4d5362d6066a13
BLAKE2b-256 checksum
How to use checksums
77058c425e0efe6129010c096019ab799b97004e8e8ea05d321f2f7dd8c9f57a
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 16, 2026.

Transparency log

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

Download URL embroider-0.15.1-cp311-cp311-win_amd64.whl
Size 6.2 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
034af346dfab0156f7e05b77dc7fb1402127050584c392d1fa34a1f6851b1e47
BLAKE2b-256 checksum
How to use checksums
46a4f16a85b2e9a9b72b4e999e218b569ca8bfdfda424844216ffb9b29e7cab5
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 16, 2026.

Transparency log

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

Download URL embroider-0.15.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
696bcbc404a6f07af2053554cdab49a39e891f30c1530e23fac68c113a42da89
BLAKE2b-256 checksum
How to use checksums
89b4b65149137d90727546a3edc1165a34f9274a6ff75abec9c05c8e9db36def
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 16, 2026.

Transparency log

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

Download URL embroider-0.15.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
0867381e8f5eb8dc6dec0a0f4483938ef5abb7226e61135bc72b4018dc31f9ed
BLAKE2b-256 checksum
How to use checksums
846000591943e00e1db581f4246ad37b931eabff02c6219089cb13095dbedb57
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 16, 2026.

Transparency log

Security for embroider 0.15.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.15.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 16, 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