polyc-embeddings 0.1.3

Provider-agnostic embedding trait for polychrome (local-first tool search).
Documentation
  • Coverage
  • 100%
    18 out of 18 items documented0 out of 10 items with examples
  • Size
  • Source code size: 15.03 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 492.07 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 7s Average build duration of successful builds.
  • all releases: 7s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • christopherwxyz github:officialunofficial:polychrome

Provider-agnostic embedding trait for polychrome.

This crate defines the [EmbeddingProvider] trait that every concrete embedding backend implements. It is the embedding-side analogue of polyc-llm's LlmProvider: a thin seam so the tool-search layer can swap backends — pure-Rust static embeddings (model2vec-rs) by default, a heavier transformer (candle + EmbeddingGemma) when shallow matching isn't enough — without touching its own code.

Tool retrieval is a shallow-semantic task over short strings (a query vs. tool name+description), so the default backend is intentionally tiny and fully deterministic: a fixed lookup table + mean pooling embeds bit-for-bit identically for a pinned model across hardware, which lines up with the reproducible prompt-hash discipline elsewhere in the system.

Modules

  • [error] — the [EmbeddingError] bound that [EmbeddingProvider::Error] must satisfy.
  • [erased] — type erasure to a single [DynEmbeddingProvider] trait object, mirroring polyc-llm's erased module.