feat: correx-managed model lifecycle slice 1 — config + manager factory + boot/shutdown

[[models]] config (ModelConfig/ModelsSettings) parsed by ConfigLoader;
InfrastructureModule.createModelManager + modelConfigToDescriptor; Main.kt
managed boot path spawns the default llama-server when [[models]] is present
(static [[providers]] path preserved when absent) and kills it on shutdown.

Plan: docs/plans/2026-05-31-model-lifecycle-management.md (slice 1 of 5).
This commit is contained in:
2026-06-01 11:03:05 +04:00
parent 5beb866036
commit e45a626cc4
10 changed files with 576 additions and 39 deletions
+37 -12
View File
@@ -30,23 +30,48 @@ enabled = true
[tools.file_edit]
enabled = true
# Provider configuration (array of tables)
[[providers]]
id = "local-llama"
type = "llamacpp"
model_id = "mistral-7b"
# ─────────────────────────────────────────────────────────────
# Managed model configuration (Slice 1: correx spawns + owns llama-server)
#
# When [[models]] is present, correx launches llama-server at boot and kills it on
# shutdown. Use this instead of (or alongside) [[providers]].
#
# [models] — global settings for the managed llama-server process
# [[models]] — one entry per model file; correx will load the defaultModel at startup.
# ─────────────────────────────────────────────────────────────
[models]
default_model = "mistral-7b" # which [[models]] entry to load at boot
llama_server_bin = "llama-server" # path to the llama-server binary (default: llama-server)
host = "127.0.0.1" # host for llama-server to bind / correx to connect
port = 10000 # port for llama-server
[[models]]
id = "mistral-7b"
model_path = "~/models/mistral-7b-gguf/model.gguf"
url = "http://127.0.0.1:10000"
context_size = 8192
capabilities = { General = 1.0, Coding = 0.7, Reasoning = 0.6, Summarization = 0.8, ToolCalling = 0.5 }
# Example: second provider (if you have multiple)
# Example: additional model (swap via TUI in a later slice)
# [[models]]
# id = "codellama-7b"
# model_path = "~/models/codellama-7b-gguf/model.gguf"
# context_size = 4096
# capabilities = { General = 0.8, Coding = 1.0, Reasoning = 0.7, Summarization = 0.6, ToolCalling = 0.7 }
# ─────────────────────────────────────────────────────────────
# Legacy static provider configuration (array of tables)
# Use [[providers]] when correx should connect to an already-running llama-server
# (i.e. you launch the server yourself externally).
# If [[models]] is configured, [[providers]] entries are registered as additional
# static providers alongside the managed one.
# ─────────────────────────────────────────────────────────────
# [[providers]]
# id = "alternative-llama"
# id = "local-llama"
# type = "llamacpp"
# model_id = "neural-chat-7b"
# 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 }
# model_id = "mistral-7b"
# model_path = "~/models/mistral-7b-gguf/model.gguf"
# url = "http://127.0.0.1:10000"
# capabilities = { General = 1.0, Coding = 0.7, Reasoning = 0.6, Summarization = 0.8, ToolCalling = 0.5 }
# Router configuration (optional, defaults shown below)
[router.embedder]