feat: configure FastEmbed model in config and admin, with restart to apply

Expose fastembed_model in config and a model dropdown on Admin → Models.
Persist dimension from the chosen model, require restart to load it, and
align legacy OpenAI default settings so fresh local-embedding installs
start cleanly.
This commit is contained in:
Per Stark
2026-06-04 21:48:12 +02:00
parent 15c9f18f6e
commit 4e20da538d
10 changed files with 735 additions and 82 deletions
+3 -4
View File
@@ -11,11 +11,10 @@ use common::{
storage::{
db::SurrealDbClient,
store::StorageManager,
types::system_settings::SystemSettings,
},
utils::{
config::{get_config, AppConfig},
embedding::EmbeddingProvider,
embedding::{align_fastembed_system_settings, EmbeddingProvider},
},
};
use retrieval_pipeline::reranking::RerankerPool;
@@ -58,9 +57,9 @@ pub(crate) async fn init_with_config(config: AppConfig) -> anyhow::Result<Shared
.await
.context("apply database migrations")?;
let settings = SystemSettings::get_current(&db)
let settings = align_fastembed_system_settings(&db, &config)
.await
.context("load system settings")?;
.context("align fastembed system settings")?;
let openai_client = Arc::new(Client::with_config(
async_openai::config::OpenAIConfig::new()