post_cortex_embeddings/embeddings/mod.rs
1// Copyright (c) 2025 Julius ML
2//
3// Permission is hereby granted, free of charge, to any person obtaining a copy
4// of this software and associated documentation files (the "Software"), to deal
5// in the Software without restriction, including without limitation the rights
6// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7// copies of the Software, and to permit persons to whom the Software is
8// furnished to do so, subject to the following conditions:
9//
10// The above copyright notice and this permission notice shall be included in all
11// copies or substantial portions of the Software.
12
13//! Local Embeddings Engine for semantic understanding.
14//!
15//! The public [`LocalEmbeddingEngine`] wraps any [`EmbeddingBackend`] with
16//! adaptive batching, concurrency control, and timeouts. Backends live under
17//! [`backends`] — currently [`BertBackend`](backends::BertBackend) (Candle +
18//! HuggingFace Hub) and [`StaticHashBackend`](backends::StaticHashBackend)
19//! (hash-based fallback). Swapping in `model2vec-rs` for the
20//! `minishlab/potion-multilingual-128M` migration becomes a new backend impl
21//! plus one branch in [`engine::LocalEmbeddingEngine::new`].
22
23pub mod backend;
24pub mod backends;
25mod concurrency;
26pub mod config;
27pub mod engine;
28mod pool;
29
30#[cfg(test)]
31mod tests;
32
33pub use backend::EmbeddingBackend;
34pub use config::{EmbeddingConfig, EmbeddingModelType};
35pub use engine::LocalEmbeddingEngine;