remove-me: Introduce an env var to change the embeddings chunk size

This commit is contained in:
Clément Renault
2025-07-31 11:40:15 +02:00
committed by Louis Dureuil
parent 58a88c7933
commit 112d3f54e9

View File

@ -321,7 +321,14 @@ impl Embedder {
pub fn prompt_count_in_chunk_hint(&self) -> usize {
match self.data.request.input_type() {
InputType::Text => 1,
InputType::TextArray => 10,
InputType::TextArray => {
let chunk_size = std::env::var("MEILI_EMBEDDINGS_CHUNK_SIZE")
.ok()
.and_then(|chunk_size| chunk_size.parse().ok())
.unwrap_or(10);
assert!(chunk_size <= 100, "Embedding chunk size cannot exceed 100");
chunk_size
}
}
}