Skip to main content

Crate embroider

Crate embroider 

Source
Expand description

Embroider — Jina v5 text embeddings through ONNX Runtime.

Rust core with opt-in PyO3 bindings (the bobine pattern). The crate layering: providers/probe/policy/acquire/error/diag are the shared ONNX plumbing (session building, provider fallback, CUDA probing, HF acquisition); jina is the frozen text-embedding contract.

Provenance: a clean move out of OKFgraph’s rust/okf-embed (itself an exact port of EmbeddingEngine._encode, pinned by that repo’s parity harness at ≤1e-5). Session/threading choices follow EmbedAnything’s ort_jina.rs; device fallback semantics mirror bobine: CUDA is opportunistic, never fatal.

§Module layout

  • error — anyhow-based error plumbing (oe stringification)
  • providers — provider-name matrix + clone-and-fallback application
  • probe — corrected CUDA availability check (OnceLock-cached)
  • policy — DeviceReq + explicit SessionPolicy (text vs defaults)
  • acquire — validated HF hub acquisition (blocking, cached)
  • diag — OrtReport observation for logs and diagnostics
  • jina — JinaV5 + TokenizerHandle (the frozen contract)
  • vision — JinaV5Vision (the dynamic-grid image contract)

Re-exports§

pub use acquire::artifact_for;
pub use acquire::artifact_for_task;
pub use acquire::builtin_models;
pub use acquire::builtin_tasks;
pub use acquire::cache_info;
pub use acquire::cache_info_files;
pub use acquire::fetch_repo_file;
pub use acquire::fetch_tokenizer_file;
pub use acquire::lookup_model;
pub use acquire::lookup_task;
pub use acquire::parse_owner_name;
pub use acquire::repo_for_precision;
pub use acquire::Artifact;
pub use acquire::CacheReport;
pub use acquire::ModelSpec;
pub use acquire::TaskKind;
pub use acquire::TaskSpec;
pub use acquire::FP16_TEXT_MODEL;
pub use acquire::FP32_TEXT_MODEL;
pub use acquire::GLICLASS_SMALL;
pub use acquire::GLICLASS_SMALL_MODEL;
pub use acquire::GLICLASS_V4_EDGE;
pub use acquire::GLICLASS_V4_EDGE_MODEL;
pub use acquire::LAYA_BASE;
pub use acquire::LAYA_BASE_MODEL;
pub use acquire::LAYA_MULTI;
pub use acquire::LAYA_MULTI_MODEL;
pub use acquire::LAYA_TD;
pub use acquire::LAYA_TD_MODEL;
pub use acquire::NANO_TEXT_MODEL;
pub use acquire::RERANK_MMARCO;
pub use acquire::RERANK_MMARCO_MODEL;
pub use acquire::RERANK_MINILM;
pub use acquire::RERANK_MINILM_MODEL;
pub use acquire::TEXT_NANO;
pub use acquire::TEXT_SMALL;
pub use acquire::DECIDER2B_MODEL;
pub use diag::configure_runtime;
pub use diag::report;
pub use diag::runtime_report;
pub use diag::runtime_report_for;
pub use diag::save_runtime_report;
pub use diag::OrtReport;
pub use jina::JinaV5;
pub use jina::TokenizerHandle;
pub use jina::MAX_LENGTH;
pub use jina::MODEL_MAX_TOKENS;
pub use jina::NATIVE_DIM;
pub use rerank::Reranker;
pub use rerank::RERANK_ABSOLUTE_MAX;
pub use rerank::RERANK_DEFAULT_MAX;
pub use decide::Decider;
pub use decide::Decision;
pub use decide::Question;
pub use decide::DECIDE_ABSOLUTE_MAX;
pub use decide::DECIDE_DEFAULT_MAX;
pub use decider2b::Decider2B;
pub use decider2b::Decider2BDecision;
pub use decider2b::Decider2BOption;
pub use decider2b::Decider2BQuestion;
pub use laya::LayaDecider;
pub use laya::LayaDecision;
pub use laya::LayaLongDecision;
pub use laya::LayaOption;
pub use laya::LayaQuestion;
pub use laya::LayaTemperatures;
pub use laya::BinningMap;
pub use vision::vision_target_size;
pub use vision::JinaV5Vision;
pub use vision::VISION_MAX_PIXELS;
pub use vision::VISION_MIN_PIXELS;
pub use acquire::VISION_NANO;
pub use acquire::VISION_NANO_MODEL;
pub use acquire::VISION_NANO_REPO;
pub use policy::DeviceReq;
pub use policy::Precision;
pub use policy::SessionPolicy;
pub use probe::cuda_available;
pub use providers::apply_providers;
pub use providers::apply_providers_with_arena;
pub use providers::map_provider;
pub use providers::ProviderMapping;

Modules§

acquire
HuggingFace acquisition (blocking, cached).
decide
The typed-decision contract (GLiClass uni-encoder).
decider2b
Slot-layout typed decisions: serving Mapika/decider-2b.
diag
Runtime observation shared by consumers’ logs and diagnostics.
error
Error plumbing.
jina
The Jina v5 text-embedding contract.
laya
Laya typed-decision serving: the marker-layout contract.
policy
Device requests and session tuning policy.
probe
CUDA availability probing against the loaded ONNX Runtime library.
providers
ONNX Runtime execution-provider plumbing.
rerank
The cross-encoder rerank contract.
vision
The Jina v5 vision contract: dynamic-grid image embeddings (Phase 6).