pub struct EmbeddingRoutingConfig {
pub query_model: EmbeddingModel,
pub write_models: Vec<EmbeddingModel>,
pub phase: RoutingPhase,
pub migration_id: Option<String>,
}Expand description
Configuration for embedding request routing.
Separates query routing from write routing to enable true rollback. During the rollback window after cutover, queries use the new model but writes continue to both models, ensuring atoms created after cutover are present in both indexes.
§Example
use lattice_embed::backfill::{EmbeddingRoutingConfig, RoutingPhase};
use lattice_embed::EmbeddingModel;
let config = EmbeddingRoutingConfig {
query_model: EmbeddingModel::BgeBaseEnV15,
write_models: vec![EmbeddingModel::BgeSmallEnV15, EmbeddingModel::BgeBaseEnV15],
phase: RoutingPhase::RollbackWindow,
migration_id: Some("mig-001".to_string()),
};
assert!(config.write_models.len() > 1); // dual-write activeFields§
§query_model: EmbeddingModelWhich model to query against.
write_models: Vec<EmbeddingModel>Which models to write to (may be multiple for dual-write).
phase: RoutingPhaseCurrent routing phase.
migration_id: Option<String>Migration ID if in migration/rollback phase.
Trait Implementations§
Source§impl Clone for EmbeddingRoutingConfig
impl Clone for EmbeddingRoutingConfig
Source§fn clone(&self) -> EmbeddingRoutingConfig
fn clone(&self) -> EmbeddingRoutingConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EmbeddingRoutingConfig
impl Debug for EmbeddingRoutingConfig
Source§impl<'de> Deserialize<'de> for EmbeddingRoutingConfig
impl<'de> Deserialize<'de> for EmbeddingRoutingConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for EmbeddingRoutingConfig
impl RefUnwindSafe for EmbeddingRoutingConfig
impl Send for EmbeddingRoutingConfig
impl Sync for EmbeddingRoutingConfig
impl Unpin for EmbeddingRoutingConfig
impl UnsafeUnpin for EmbeddingRoutingConfig
impl UnwindSafe for EmbeddingRoutingConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more