feat: switchable router embedder and L3 backends via config

Adds [router.embedder] and [router.l3] sections to CorrexConfig with
backend selectors. Ships LlamaCppEmbedder that hits llama.cpp's
/embedding endpoint (handles OpenAI-compatible, simple, and array
response shapes; validates dimension). InfrastructureModule gains
createEmbedderFromConfig and createL3MemoryStoreFromConfig that
dispatch on backend value.

Defaults preserve current behavior (noop embedder + in-memory L3).
Switching to "llamacpp" / "turbovec" is a config-only change — no code
edits required. For turbovec backend, the bundled python sidecar
script is extracted from classpath to ~/.cache/correx/ on first use.
This commit is contained in:
2026-05-30 01:23:14 +04:00
parent 84a7568e15
commit d68c76ee3c
11 changed files with 496 additions and 2 deletions
+15
View File
@@ -50,3 +50,18 @@ capabilities = { General = 1.0, Coding = 0.7, Reasoning = 0.6, Summarization = 0
# model_path = "~/models/neural-chat-7b-gguf/model.gguf"
# url = "http://127.0.0.1:10001"
# capabilities = { General = 0.9, Coding = 0.8, Reasoning = 0.7, Summarization = 0.75, ToolCalling = 0.6 }
# Router configuration (optional, defaults shown below)
[router.embedder]
backend = "noop" # or "llamacpp"
dimension = 1536
# url = "http://127.0.0.1:11000"
# model_id = "nomic-embed-text"
[router.l3]
backend = "in_memory" # or "turbovec"
# persist_path = "~/.config/correx/router/l3/index.tq"
# python_executable = "python3"
# script_path = "~/.config/correx/python/turbovec_sidecar.py"
# dim = 1536
# bit_width = 4