frankensearch_embed/
lib.rs1pub mod auto_detect;
12pub mod batch_coalescer;
13#[cfg(feature = "bundled-default-models")]
14pub mod bundled_default_models;
15pub mod cached_embedder;
16pub mod model_cache;
17pub mod model_manifest;
18pub mod model_registry;
19pub use auto_detect::{
20 DimReduceEmbedder, EmbedderStack, ModelAvailabilityDiagnostic, ModelStatus, TwoTierAvailability,
21};
22pub use batch_coalescer::{
23 BatchCoalescer, CoalescedBatch, CoalescerConfig, CoalescerMetrics, Priority,
24};
25#[cfg(feature = "bundled-default-models")]
26pub use bundled_default_models::{EmbeddedModelInstallSummary, ensure_default_semantic_models};
27
28#[cfg(not(feature = "bundled-default-models"))]
32pub use lite_fallback::{EmbeddedModelInstallSummary, ensure_default_semantic_models};
33
34#[cfg(not(feature = "bundled-default-models"))]
35mod lite_fallback {
36 use std::path::{Path, PathBuf};
37
38 use frankensearch_core::error::SearchResult;
39
40 #[derive(Debug, Clone, PartialEq, Eq)]
42 pub struct EmbeddedModelInstallSummary {
43 pub model_root: PathBuf,
45 pub models_written: usize,
47 pub bytes_written: u64,
49 }
50
51 pub fn ensure_default_semantic_models(
57 model_root: Option<&Path>,
58 ) -> SearchResult<EmbeddedModelInstallSummary> {
59 let root = model_root.map(|p| p.to_path_buf()).unwrap_or_else(|| {
60 crate::model_registry::ensure_model_storage_layout_checked()
61 .unwrap_or_else(|_| PathBuf::from("models"))
62 });
63 Ok(EmbeddedModelInstallSummary {
64 model_root: root,
65 models_written: 0,
66 bytes_written: 0,
67 })
68 }
69}
70pub use cached_embedder::{CacheStats, CachedEmbedder};
71pub use model_cache::{
72 ENV_DATA_DIR, ENV_MODEL_DIR, KnownModel, MODEL_CACHE_LAYOUT_VERSION, ModelCacheLayout,
73 ModelDirEntry, ensure_cache_layout, ensure_default_cache, is_model_installed, known_models,
74 model_file_path, resolve_cache_root,
75};
76pub use model_manifest::{
77 ConsentSource, DOWNLOAD_CONSENT_ENV, DownloadConsent, MANIFEST_SCHEMA_VERSION, ModelFile,
78 ModelLifecycle, ModelManifest, ModelManifestCatalog, ModelState, ModelTier,
79 PLACEHOLDER_VERIFY_AFTER_DOWNLOAD, VerificationMarker, is_verification_cached,
80 resolve_download_consent, verify_dir_cached, verify_file_sha256, write_verification_marker,
81};
82pub use model_registry::{
83 BAKEOFF_CUTOFF_DATE, EmbedderRegistry, RegisteredEmbedder, RegisteredReranker,
84 registered_embedders, registered_rerankers,
85};
86
87#[cfg(feature = "hash")]
88pub mod hash_embedder;
89
90#[cfg(feature = "hash")]
91pub use hash_embedder::{HashAlgorithm, HashEmbedder};
92
93#[cfg(feature = "model2vec")]
94pub mod model2vec_embedder;
95
96#[cfg(feature = "model2vec")]
97pub use model2vec_embedder::{Model2VecEmbedder, find_model_dir};
98
99#[cfg(feature = "fastembed")]
100pub mod fastembed_embedder;
101
102#[cfg(feature = "fastembed")]
103pub use fastembed_embedder::{FastEmbedEmbedder, OnnxEmbedderConfig};
104
105#[cfg(feature = "download")]
106pub mod model_download;
107
108#[cfg(feature = "download")]
109pub use model_download::{DownloadConfig, DownloadProgress, ModelDownloader};
110
111#[cfg(feature = "api")]
112pub mod api_provider;
113
114#[cfg(feature = "api")]
115pub mod api_embedder;
116
117#[cfg(feature = "api")]
118pub use api_embedder::ApiEmbedder;
119#[cfg(feature = "api")]
120pub use api_provider::{ApiProvider, GeminiProvider, OpenAiProvider};