From c0067d387c49a550411b3c87839f6103e32a7091 Mon Sep 17 00:00:00 2001 From: Alex Clarke Date: Tue, 11 Aug 2026 14:06:57 -0600 Subject: [PATCH] refactor(rag): drop the hardcoded embedding model hint from attach The attach wizard mapped a collection's vector dimension to a hardcoded list of model names and printed them as likely candidates. The list was never checked against the models the user actually has configured, so it could recommend a model they cannot select, and one entry was a parenthetical note rather than a model id and so could never match anything. Any list like this rots as models are released. The dimension itself comes from the server and is worth stating, so it is still printed, as is the warning that a mismatched embedding model returns bad results. Deriving real candidates would need a dimension recorded against each configured model, which the model config does not carry today. --- src/rag/mod.rs | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/src/rag/mod.rs b/src/rag/mod.rs index 0b8a72c..0d76481 100644 --- a/src/rag/mod.rs +++ b/src/rag/mod.rs @@ -491,13 +491,7 @@ impl Rag { ); } if dim > 0 { - let candidates = embedding_model_candidates_for_dimension(dim); - if !candidates.is_empty() { - println!( - "Collection uses {dim}-dim vectors. Likely models: {}", - candidates.join(", ") - ); - } + println!("Collection uses {dim}-dim vectors."); } println!( "⚠️ If the embedding model doesn't match what built this collection, \ @@ -1834,21 +1828,6 @@ fn driver_auth_header(driver: &str) -> (&'static str, &'static str) { } } -/// Embedding models known to produce a given vector dimension, used to hint the -/// user toward a model compatible with the collection they just picked. -fn embedding_model_candidates_for_dimension(dim: u64) -> Vec<&'static str> { - match dim { - 1536 => vec!["text-embedding-3-small", "text-embedding-ada-002"], - 3072 => vec!["text-embedding-3-large"], - 768 => vec!["nomic-embed-text", "all-minilm-l6-v2"], - 1024 => vec![ - "text-embedding-3-small (matryoshka-1024)", - "jina-embeddings-v2-base", - ], - _ => vec![], - } -} - fn select_embedding_model(models: &[&Model]) -> Result { let max_width = models.iter().map(|v| v.id().len()).max().unwrap_or(0); let models: Vec<_> = models